Step 20.4: CR-020 amendments, regression and screenshots
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f948a22d8c
commit
716002b3c7
|
|
@ -94,7 +94,7 @@ export async function playToDeal(page: Page) {
|
||||||
await page.goto("/");
|
await page.goto("/");
|
||||||
await dismissLogbook(page);
|
await dismissLogbook(page);
|
||||||
await page.getByRole("button", { name: "Shake on it" }).click();
|
await page.getByRole("button", { name: "Shake on it" }).click();
|
||||||
await expect(page.getByRole("heading", { level: 1, name: "HQ" })).toBeVisible();
|
await expect(page.getByRole("heading", { level: 1, name: "Dashboard" })).toBeVisible();
|
||||||
// Both pilots have skill points at the deal (CR-017); the pop-up says so.
|
// Both pilots have skill points at the deal (CR-017); the pop-up says so.
|
||||||
const skills = page.getByRole("dialog", { name: "Your pilots are ready to train" });
|
const skills = page.getByRole("dialog", { name: "Your pilots are ready to train" });
|
||||||
await expect(skills.getByLabel("Unspent skill points")).toContainText(/You: \d+ points?/);
|
await expect(skills.getByLabel("Unspent skill points")).toContainText(/You: \d+ points?/);
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ export function Layout({
|
||||||
|
|
||||||
<nav
|
<nav
|
||||||
aria-label="Main"
|
aria-label="Main"
|
||||||
className="fixed inset-x-0 bottom-0 z-10 grid h-(--nav-h) grid-cols-8 border-t border-space-700/80 bg-space-950/85 pb-[env(safe-area-inset-bottom)] backdrop-blur-xl md:inset-x-auto md:top-0 md:left-0 md:flex md:h-dvh md:w-24 md:flex-col md:gap-1 md:border-t-0 md:border-r md:pt-[calc(var(--header-h)+0.75rem)] md:pb-4"
|
className="fixed inset-x-0 bottom-0 z-10 grid h-(--nav-h) grid-cols-8 border-t border-space-700/80 bg-space-950/85 pb-[env(safe-area-inset-bottom)] backdrop-blur-xl md:inset-x-auto md:top-0 md:left-0 md:flex md:h-dvh md:w-24 md:flex-col md:gap-0.5 md:overflow-y-auto md:border-t-0 md:border-r md:pt-[calc(var(--header-h)+0.75rem)] md:pb-4"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
|
|
@ -106,7 +106,7 @@ function NavTab({
|
||||||
to={path}
|
to={path}
|
||||||
end={path === "/"}
|
end={path === "/"}
|
||||||
className={({ isActive }) =>
|
className={({ isActive }) =>
|
||||||
`group relative flex flex-col items-center justify-center gap-0.5 transition-colors md:py-2 ${
|
`group relative flex flex-col items-center justify-center gap-0.5 transition-colors md:py-1.5 ${
|
||||||
isActive ? "text-amber-300" : "text-ink-400 hover:text-ink-50"
|
isActive ? "text-amber-300" : "text-ink-400 hover:text-ink-50"
|
||||||
}`
|
}`
|
||||||
}
|
}
|
||||||
|
|
@ -120,7 +120,7 @@ function NavTab({
|
||||||
}`}
|
}`}
|
||||||
/>
|
/>
|
||||||
<span
|
<span
|
||||||
className={`relative grid size-10 place-items-center rounded-xl transition md:size-12 ${
|
className={`relative grid size-10 place-items-center rounded-xl transition md:size-11 ${
|
||||||
isActive
|
isActive
|
||||||
? "bg-amber-500/15 shadow-glow-amber"
|
? "bg-amber-500/15 shadow-glow-amber"
|
||||||
: "group-hover:bg-white/5 group-active:scale-95"
|
: "group-hover:bg-white/5 group-active:scale-95"
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 631 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 286 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 702 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 282 KiB |
|
|
@ -66,6 +66,7 @@ Record these in `DECISIONS.md` (as plan §0.5.47–0.5.51).
|
||||||
### Step 10E.4 — HQ dashboard
|
### Step 10E.4 — HQ dashboard
|
||||||
- Company hero (name, credits large), icon stat tiles, a "Next arrival" panel with a route strip and live progress, pilot rest, the tutorial card as a story panel, goals with reward pills, the loan with a meter.
|
- Company hero (name, credits large), icon stat tiles, a "Next arrival" panel with a route strip and live progress, pilot rest, the tutorial card as a story panel, goals with reward pills, the loan with a meter.
|
||||||
- **Test:** existing HQ, goals, loan and rest tests pass. **Manual check.**
|
- **Test:** existing HQ, goals, loan and rest tests pass. **Manual check.**
|
||||||
|
- **Amended by CR-020:** The HQ dashboard became the Dashboard ("Bridge"), led by the player pilot's ship and an Alerts panel; "Next arrival" became "Ships on jobs" (every flight); owned HQs moved to their own tab (Phase 20).
|
||||||
|
|
||||||
### Step 10E.5 — Contracts and dispatch
|
### Step 10E.5 — Contracts and dispatch
|
||||||
- Location switcher as planet chips. Contract cards: a route strip (origin art → line → destination art), cargo and mass, a large payout, requirement pills, expiry, and a prominent Dispatch button. The tutorial board gets the same card, with suggested and scripted variants. The dispatch sheet uses the `Sheet` and shows each ship with its art and the numbers as stat tiles.
|
- Location switcher as planet chips. Contract cards: a route strip (origin art → line → destination art), cargo and mass, a large payout, requirement pills, expiry, and a prominent Dispatch button. The tutorial board gets the same card, with suggested and scripted variants. The dispatch sheet uses the `Sheet` and shows each ship with its art and the numbers as stat tiles.
|
||||||
|
|
|
||||||
|
|
@ -529,6 +529,7 @@ The game has had no server since CR-014. When a later or unfinished change reque
|
||||||
- **Test:** A component test renders the layout and each route shows its placeholder title. Manual check: the layout fits a 375px-wide viewport with no horizontal scroll.
|
- **Test:** A component test renders the layout and each route shows its placeholder title. Manual check: the layout fits a 375px-wide viewport with no horizontal scroll.
|
||||||
- **Amended by CR-005:** The header becomes a HUD bar and navigation becomes icon tabs: a bottom bar on phones, a left rail from 768 px, with attention badges (decision 0.5.49, Step 10E.3).
|
- **Amended by CR-005:** The header becomes a HUD bar and navigation becomes icon tabs: a bottom bar on phones, a left rail from 768 px, with attention badges (decision 0.5.49, Step 10E.3).
|
||||||
- **Amended by CR-011:** The header gains a Settings gear (Step 10K.2).
|
- **Amended by CR-011:** The header gains a Settings gear (Step 10K.2).
|
||||||
|
- **Amended by CR-020:** The first screen is the Dashboard (tab "Bridge") instead of HQ, and an HQs tab lists the player's HQs: eight tabs (Steps 20.1–20.3).
|
||||||
|
|
||||||
### Step 8.2 — Typed API client
|
### Step 8.2 — Typed API client
|
||||||
- Build an API client from the route catalog so every call is typed and responses are validated.
|
- Build an API client from the route catalog so every call is typed and responses are validated.
|
||||||
|
|
|
||||||
|
|
@ -454,3 +454,6 @@ Spec: `memory-bank/change-requests/CR-020-bridge-dashboard.md`. New decisions re
|
||||||
- [x] **Step 20.1 — Navigation: Bridge and HQs.** `SCREENS`: `/` is now "Dashboard" with the tab label "Bridge" and a new `helm` icon; `/hqs` ("HQs", HQ icon) sits after Pilots, with a first `HQs` screen (header only until 20.2). The bottom bar is eight columns; labels tighten their tracking below `sm` so "PILOTS"/"PLACES" fit about 48 px. The goals badge stays on `/`. The HQ screen's heading is "Dashboard"; the away summary's "Claim on HQ" is "Claim on the Bridge" (tests that looked for the "HQ" heading updated). Test: `layout.test.tsx` (eight links, Bridge first and current on launch, HQs at `/hqs`; every screen's heading at its path).
|
- [x] **Step 20.1 — Navigation: Bridge and HQs.** `SCREENS`: `/` is now "Dashboard" with the tab label "Bridge" and a new `helm` icon; `/hqs` ("HQs", HQ icon) sits after Pilots, with a first `HQs` screen (header only until 20.2). The bottom bar is eight columns; labels tighten their tracking below `sm` so "PILOTS"/"PLACES" fit about 48 px. The goals badge stays on `/`. The HQ screen's heading is "Dashboard"; the away summary's "Claim on HQ" is "Claim on the Bridge" (tests that looked for the "HQ" heading updated). Test: `layout.test.tsx` (eight links, Bridge first and current on launch, HQs at `/hqs`; every screen's heading at its path).
|
||||||
- [x] **Step 20.2 — HQs screen.** `screens/HQs.tsx`: one emerald feature card per bay (labelled "HQ at <place>"): location art and name, fuel price there (cheapest highlighted), ships at the location with Idle / In the shop, flights inbound to it with countdowns, unassigned pilots there (level, resting), and links to the location's contracts and to Pilots for hiring; the header says what an HQ allows (`HQ_ALLOWS`). No bays: a short explanation and "Lease one in Places". Leasing stays on Places. Test: `hqs-screen.test.tsx` (an HQ's ships, inbound flight, spare pilot, fuel price and links; ships elsewhere not listed; one card per HQ; empty state).
|
- [x] **Step 20.2 — HQs screen.** `screens/HQs.tsx`: one emerald feature card per bay (labelled "HQ at <place>"): location art and name, fuel price there (cheapest highlighted), ships at the location with Idle / In the shop, flights inbound to it with countdowns, unassigned pilots there (level, resting), and links to the location's contracts and to Pilots for hiring; the header says what an HQ allows (`HQ_ALLOWS`). No bays: a short explanation and "Lease one in Places". Leasing stays on Places. Test: `hqs-screen.test.tsx` (an HQ's ships, inbound flight, spare pilot, fuel price and links; ships elsewhere not listed; one card per HQ; empty state).
|
||||||
- [x] **Step 20.3 — Dashboard.** `screens/HQ.tsx` → `screens/Dashboard.tsx` (`Dashboard`; `tutorialHint` moved with it). Leads with **Your ship** (`pilotShip(state)`: the avatar's assigned ship, the company loaner during the tutorial, or none): art, name and model, Idle / In flight / In the shop, where it is or its route with a route strip, cargo ("6 t Medical Supplies for Meridian Health" or "Flying empty"), arrival countdown and Priority chip, shop countdown, fuel gauge with the low-fuel warning (`lowFuel`, decision 0.5.113; "Supplied by Halvorsen" for the loaner), the avatar's duty meter or rest countdown, and "Find work here" / "Fleet" when idle; with no ship, "Assign yourself on Pilots". Beside it, **Alerts**: "No alerts. In-flight alerts and news will appear here." Then the stat tiles, the tutorial panel, **Ships on jobs** (every active dispatch, soonest first, with route, countdown and a trip meter; replaces "Next arrival"), pilot rest, in the shop, goals and the loan. Test: `dashboard.test.tsx` (was `hq.test.tsx`): ships on jobs in arrival order with live countdowns; your ship idle (place, fuel, duty, Find work here), low fuel, in flight with cargo and arrival, in the shop with a resting pilot, no ship, the tutorial loaner; the Alerts placeholder.
|
- [x] **Step 20.3 — Dashboard.** `screens/HQ.tsx` → `screens/Dashboard.tsx` (`Dashboard`; `tutorialHint` moved with it). Leads with **Your ship** (`pilotShip(state)`: the avatar's assigned ship, the company loaner during the tutorial, or none): art, name and model, Idle / In flight / In the shop, where it is or its route with a route strip, cargo ("6 t Medical Supplies for Meridian Health" or "Flying empty"), arrival countdown and Priority chip, shop countdown, fuel gauge with the low-fuel warning (`lowFuel`, decision 0.5.113; "Supplied by Halvorsen" for the loaner), the avatar's duty meter or rest countdown, and "Find work here" / "Fleet" when idle; with no ship, "Assign yourself on Pilots". Beside it, **Alerts**: "No alerts. In-flight alerts and news will appear here." Then the stat tiles, the tutorial panel, **Ships on jobs** (every active dispatch, soonest first, with route, countdown and a trip meter; replaces "Next arrival"), pilot rest, in the shop, goals and the loan. Test: `dashboard.test.tsx` (was `hq.test.tsx`): ships on jobs in arrival order with live countdowns; your ship idle (place, fuel, duty, Find work here), low fuel, in flight with cargo and arrival, in the shop with a resting pilot, no ship, the tutorial loaner; the Alerts placeholder.
|
||||||
|
- [x] **Step 20.4 — Regression and review.** CR-020 amendments added to plan Step 8.1 and CR-005 Step 10E.4. The e2e `playToDeal` now waits for the "Dashboard" heading. With eight tabs the desktop rail cut off Places in a 720 px-tall window (first screenshot), so rail tabs are more compact (`md:size-11`, `md:py-1.5`) and the rail scrolls if a window is shorter still. Full suite: typecheck, lint, 1341 unit tests and 9 e2e tests pass. Screenshots (taken after the deal with one ship on a job): `docs/screenshots/20-4-bridge-desktop.png`, `20-4-bridge-phone.png`, `20-4-hqs-desktop.png`, `20-4-hqs-phone.png`.
|
||||||
|
|
||||||
|
**Phase 20 is complete; stopped for review.**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue