Record CR-020: Bridge dashboard and HQs tab (Phase 20)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
fireshaper 2026-10-10 22:19:51 -04:00
parent e9d5a7e463
commit 4b6bf64a82
4 changed files with 67 additions and 0 deletions

View File

@ -1655,3 +1655,8 @@ Implementation decisions not spelled out in `memory-bank/implementation-plan.md`
- **e2e 12.6 no longer shows a Heavy job blocked by skill on the board**: under CR-019 the job isn't offered until someone has the skill, so the test checks that instead and dispatches once the skill is learned. The dispatch sheet's "Needs Heavy Cargo 1 (pilot has 0)" reason is still covered by the component tests. - **e2e 12.6 no longer shows a Heavy job blocked by skill on the board**: under CR-019 the job isn't offered until someone has the skill, so the test checks that instead and dispatches once the skill is learned. The dispatch sheet's "Needs Heavy Cargo 1 (pilot has 0)" reason is still covered by the component tests.
- **The balance simulator reads boards the way the engine does** (qualifying fleet, read-time filter). The new `jobsShown`/`uncompletableShown` counts make "never sees a job it can't complete" a checked invariant. - **The balance simulator reads boards the way the engine does** (qualifying fleet, read-time filter). The new `jobsShown`/`uncompletableShown` counts make "never sees a job it can't complete" a checked invariant.
## CR-020 — Bridge Dashboard and HQs Tab (Phase 20)
- **Requested by the user directly** (not a supplied CR), so it takes the next free numbers: CR-020, Phase 20, decisions 0.5.118–0.5.121.
- **Asked:** the Dashboard's tab label (user chose "Bridge", since eight tabs leave about 48 px each on a phone and "Dashboard" won't fit) and whether Alerts should already list alerts the game can derive (user chose an empty placeholder for the future in-flight alerts/news).

View File

@ -0,0 +1,48 @@
# Change Request CR-020 — Bridge Dashboard and HQs Tab
**Project:** Deadhead: Space Freight Tycoon
**Applies to:** a build with CR-001 to CR-019 complete
**Do this:** as **Phase 20**, after Phase 19
**Related docs:** `CR-005-ui-overhaul.md` (HQ dashboard, Step 10E.4), `CR-015-fixed-map-fuel-tanks.md`, `CR-018-fuel-tuning.md`, `DECISIONS.md`
---
## 1. Why
User request (2026-10-10):
> I'd like to overhaul the HQ page to be Dashboard instead, we can move HQs to a new tab that just has info about the owned HQs. The Dashboard should show similar info like we have already with the ships on jobs and goals, but it should also be a dashboard for the player pilot to show information about his ship like status, fuel, and it will show alerts in the future when we add in-flight alerts/news.
Asked and answered: the tab is labelled **Bridge** (the screen title is "Dashboard"), and the alerts panel starts as an **empty placeholder**.
## 2. Decisions
Record as plan §0.5.118–0.5.121.
- **0.5.118 Bridge.** The first tab (`/`) is the Dashboard, labelled "Bridge" in the navigation. It replaces the HQ screen: company stats, every ship on a job, pilot rest, ships in the shop, goals and the loan stay; the tutorial panel stays during the tutorial.
- **0.5.119 Your ship.** The Dashboard leads with the player pilot's ship: the ship the avatar is assigned to, or the company loaner during the tutorial. It shows status (idle where, in flight with route, progress, arrival and cargo, or in the shop), fuel with the low-fuel warning (decision 0.5.113), and the avatar's duty or rest. With no ship assigned it says so and links to Pilots.
- **0.5.120 Alerts.** The Dashboard has an Alerts panel that is empty for now ("No alerts"), the place future in-flight alerts and news will appear.
- **0.5.121 HQs tab.** A new "HQs" tab lists the player's HQs (bays) with information only: location, fuel price there, ships there, unassigned pilots there, and what an HQ allows. Leasing stays on Places; the empty state links there. Eight tabs in all.
## 3. Rules
- All rules in `implementation-plan.md` §0.1 apply. Update `progress.md` after every step.
- Copy that names the old screen changes with it: the away summary's "Claim on HQ" becomes "Claim on the Bridge". Tests that looked for the "HQ" heading look for "Dashboard".
- Visual steps end with desktop and phone screenshots. Stop for review at the end of Phase 20.
## 4. Steps — Phase 20
### Step 20.1 — Navigation: Bridge and HQs
- `SCREENS`: `/` becomes Dashboard (label "Bridge", a new bridge icon); add `/hqs` (title "HQs", label "HQs", the HQ icon) after Pilots. The navigation fits eight tabs on phones and on the desktop rail. The HQ attention badge (goals ready) moves with `/`.
- **Test:** `layout.test.tsx` (eight links; each screen's heading at its path; Bridge is the first tab).
### Step 20.2 — HQs screen
- One card per bay: location art and name, fuel price there (cheapest highlighted), ships at the location (name, model, idle or in the shop), unassigned pilots there, what an HQ allows (hire pilots, take delivery of new ships), and links to the location's contracts and to Pilots for hiring. No bays: a short explanation and a link to Places.
- **Test:** `hqs-screen.test.tsx` (a bay's card lists its ships and pilots and fuel price; ships elsewhere aren't listed; the empty state links to Places).
### Step 20.3 — Dashboard
- "Your ship" panel per decision 0.5.119 (helper `pilotShip(state)`), Alerts placeholder per 0.5.120, company stats, "Ships on jobs" (every active dispatch with route strip, progress and arrival, soonest first), and the kept panels.
- **Test:** `dashboard.test.tsx` (your ship idle with fuel and low-fuel warning; in flight with cargo and countdown; in the shop; no ship assigned; tutorial loaner; alerts placeholder; every ship on a job listed); existing HQ tests renamed and updated.
### Step 20.4 — Regression and review
- Plan amendments (Steps 8.1 and 10E.4), full suite, coverage, lint, build, screenshots of Dashboard and HQs at desktop and phone width. Stop for review.

View File

@ -173,6 +173,10 @@ These answer the pre-build review. Log each one in `DECISIONS.md` as it is imple
115. **Qualifying fleet** (CR-019). Owned ships at the location, or in flight there and arriving before the board period ends, each with its assigned pilot, or with any unassigned pilot at the location when the player has a bay there; the whole fleet when no pair qualifies. 115. **Qualifying fleet** (CR-019). Owned ships at the location, or in flight there and arriving before the board period ends, each with its assigned pilot, or with any unassigned pilot at the location when the player has a bay there; the whole fleet when no pair qualifies.
116. **Permanent checks only** (CR-019). Completable means passing cargo fit (effective capacity), landing, range (full-tank reach, or the fuel on board where the origin sells none), the no-strand rule, the Priority window and the cargo and Long Haul skills. Rest, the shop, fuel on board and credits don't count. 116. **Permanent checks only** (CR-019). Completable means passing cargo fit (effective capacity), landing, range (full-tank reach, or the fuel on board where the origin sells none), the no-strand rule, the Priority window and the cargo and Long Haul skills. Rest, the shop, fuel on board and credits don't count.
117. **Mid-period changes** (CR-019). A stored board keeps the fleet snapshot it was generated with; reads hide jobs the current qualifying fleet can no longer complete; new capability shows at the next board period. Replaces 0.5.53's weight warning. 117. **Mid-period changes** (CR-019). A stored board keeps the fleet snapshot it was generated with; reads hide jobs the current qualifying fleet can no longer complete; new capability shows at the next board period. Replaces 0.5.53's weight warning.
118. **Bridge** (CR-020). The first tab (`/`) is the Dashboard, labelled "Bridge"; it replaces the HQ screen and keeps its company stats, ships on jobs, rest, shop, goals, loan and tutorial panels.
119. **Your ship** (CR-020). The Dashboard leads with the avatar's assigned ship (the loaner during the tutorial): status, trip and cargo, fuel with the low-fuel warning, and the avatar's duty or rest.
120. **Alerts** (CR-020). An Alerts panel, empty for now, where in-flight alerts and news will appear.
121. **HQs tab** (CR-020). A new tab lists the player's HQs with information only (location, fuel price, ships and unassigned pilots there, what an HQ allows); leasing stays on Places.
### 0.6 Translating change requests written for the server (CR-014 §7) ### 0.6 Translating change requests written for the server (CR-014 §7)
@ -846,6 +850,12 @@ Steps 19.1–19.5 are specified in `memory-bank/change-requests/CR-019-completab
--- ---
## Phase 20 — Bridge Dashboard and HQs Tab (CR-020)
Steps 20.1–20.4 are specified in `memory-bank/change-requests/CR-020-bridge-dashboard.md` §4. Stop for review at the end.
---
## Definition of Done (Base Game) ## Definition of Done (Base Game)
- All step tests pass in CI. - All step tests pass in CI.

View File

@ -447,3 +447,7 @@ Spec: `memory-bank/change-requests/CR-019-completable-boards.md` (received as "C
- [x] **Step 19.5 — Plan amendments and regression.** CR-019 §6 applied: plan 0.5.52 and 0.5.53, Steps 3.9, 9.4 and 12.1; CR-002's 0.5.5 (stored boards keep the fleet snapshot); CR-007 Steps 10G.3 and 10G.8; and this repo's CR-006 Steps 10F.1, 10F.3 and 10F.4, which it supersedes. The balance simulator now generates each board for that location's qualifying fleet and hides jobs the fleet can no longer complete, as the engine does. It counts the jobs shown: none in any of the 14 runs was uncompletable. e2e 12.6 is reordered: a Heavy Cargo job now appears only after the pilot learns the skill, so the pilot raises Heavy Cargo first; the test then waits for a Heavy Cargo 1 job at the Moon and checks the Lighter's pair can take it. Before that, it checks no Heavy Cargo job is offered. Full suite: typecheck, lint, 1327 unit tests and 9 e2e tests pass. Balance (7 worlds): deal 3.7 min, first Market purchase 36.6 (30–95), discovery 36.6, loan paid off 123.0, four ships 118.4 vs 122.9, no violations. - [x] **Step 19.5 — Plan amendments and regression.** CR-019 §6 applied: plan 0.5.52 and 0.5.53, Steps 3.9, 9.4 and 12.1; CR-002's 0.5.5 (stored boards keep the fleet snapshot); CR-007 Steps 10G.3 and 10G.8; and this repo's CR-006 Steps 10F.1, 10F.3 and 10F.4, which it supersedes. The balance simulator now generates each board for that location's qualifying fleet and hides jobs the fleet can no longer complete, as the engine does. It counts the jobs shown: none in any of the 14 runs was uncompletable. e2e 12.6 is reordered: a Heavy Cargo job now appears only after the pilot learns the skill, so the pilot raises Heavy Cargo first; the test then waits for a Heavy Cargo 1 job at the Moon and checks the Lighter's pair can take it. Before that, it checks no Heavy Cargo job is offered. Full suite: typecheck, lint, 1327 unit tests and 9 e2e tests pass. Balance (7 worlds): deal 3.7 min, first Market purchase 36.6 (30–95), discovery 36.6, loan paid off 123.0, four ships 118.4 vs 122.9, no violations.
**Phase 19 is complete; stopped for review.** Manual check for the user: with only the deal's Courier and Clipper, browse the Earth board and confirm every job can be dispatched with one of them; boards elsewhere (e.g. Mars, where neither pilot has Long Haul) say no job fits. **Phase 19 is complete; stopped for review.** Manual check for the user: with only the deal's Courier and Clipper, browse the Earth board and confirm every job can be dispatched with one of them; boards elsewhere (e.g. Mars, where neither pilot has Long Haul) say no job fits.
## Phase 20 — Bridge Dashboard and HQs Tab (CR-020)
Spec: `memory-bank/change-requests/CR-020-bridge-dashboard.md`. New decisions recorded as plan §0.5.118–0.5.121.