From 43ac7ef8b91735318d7f877e28bf7400d0ee1edd Mon Sep 17 00:00:00 2001 From: Tim Gage Date: Sun, 17 May 2026 20:05:40 +0100 Subject: [PATCH 1/7] Production view refactor --- docs/prd/13-production.md | 15 +- docs/prd/60-ui-overview.md | 7 +- docs/prd/62-ui-planet-detail.md | 40 +++- docs/prd/67-ui-planet-list.md | 183 +++++++++++++++ docs/prd/68-ui-production.md | 224 +++++++++++++++++++ docs/prd/README.md | 2 + tasks/2026-05-17-production-view.md | 334 ++++++++++++++++++++++++++++ tasks/backlog.md | 1 + 8 files changed, 795 insertions(+), 11 deletions(-) create mode 100644 docs/prd/67-ui-planet-list.md create mode 100644 docs/prd/68-ui-production.md create mode 100644 tasks/2026-05-17-production-view.md diff --git a/docs/prd/13-production.md b/docs/prd/13-production.md index 9bdfbf10..3e0888e5 100644 --- a/docs/prd/13-production.md +++ b/docs/prd/13-production.md @@ -555,13 +555,16 @@ The implementation should choose one form and keep it consistent. ## UI Notes -This PRD does not redefine layout from [PRD 08 — UI](08-ui.md), but it does constrain behaviour: +The full editing surface for production queues is defined in [PRD 68 — UI Production](68-ui-production.md). This PRD owns the simulation; PRD 68 owns the screen. -- The production panel should show one queue per selected planet -- Players must be able to add, remove, reorder, and clear queue items -- The UI should display partial progress on the currently building unit -- The UI should display whether the queue is blocked by resource shortage or mineral shortage -- Initial inventory for this phase needs `Mine`, `Factory`, and any owned ship entries returned by PRD 18 endpoints +Behavioural constraints this PRD places on any production UI: + +- One queue per owned planet (no shared queues, no cross-planet templating in scope). +- The UI must allow add, remove, reorder, and clear of queue items via the commands defined above. +- Partial progress on the currently building unit must be visible. +- The UI should surface whether a queue is blocked by resource or mineral shortage. +- Initial palette entries are `mine`, `factory`, `planetary_scanner`, and one entry per owned ship design returned by PRD 18 endpoints. Starbase entries come from [PRD 17 — Starbases](17-starbases.md). +- A separate per-planet quick-edit surface (e.g. in the planet detail panel) is **not** required and is explicitly removed by PRD 68 in favour of a single canonical editor. The planet detail panel retains a read-only queue summary and a link into PRD 68. ## Future Extensions diff --git a/docs/prd/60-ui-overview.md b/docs/prd/60-ui-overview.md index 23ab3316..c2a79664 100644 --- a/docs/prd/60-ui-overview.md +++ b/docs/prd/60-ui-overview.md @@ -7,6 +7,11 @@ This document defines the overall UI design for OpenStars! — the screens, layo - [PRD 61 — Galaxy Map](61-ui-galaxymap.md) - [PRD 62 — Planet Detail Panel](62-ui-planet-detail.md) - [PRD 63 — Fleet Detail Panel](63-ui-fleet-detail.md) +- [PRD 64 — Waypoint Orders](64-ui-waypoint-orders.md) +- [PRD 65 — Fleet Merge & Split](65-ui-fleet-merge-split.md) +- [PRD 66 — Research UI](66-ui-research.md) +- [PRD 67 — Planet List](67-ui-planet-list.md) +- [PRD 68 — Production UI](68-ui-production.md) The goal is a galaxy map that evokes the original Stars! (1995) while bringing the controls and information design into the modern era. @@ -132,10 +137,10 @@ Phase 2 (Basic UI) implements the minimum needed to interact with the Phase 1 en - Waypoint setting by clicking the map - Turn submission and status display - Event log (fleet arrived, planet scanned) +- Production queue management — top-level workspace (see [PRD 68 — UI Production](68-ui-production.md)) - Responsive layout (detail panel collapse on narrow screens) **Out of scope (future phases):** -- Production queue management - Ship designer - Research allocation - Race/trait configuration diff --git a/docs/prd/62-ui-planet-detail.md b/docs/prd/62-ui-planet-detail.md index a83d697e..f21272fd 100644 --- a/docs/prd/62-ui-planet-detail.md +++ b/docs/prd/62-ui-planet-detail.md @@ -16,7 +16,8 @@ When a planet is selected, the detail panel shows what the player knows about it - Mineral summary (see Mineral Display below) - Habitability bars (see Habitability Display below) - Research contribution toggle (own planet only — see Research Contribution below) -- *(Future phases: production queue, defences)* +- Production summary and "Manage production" link (own planet only — see Production Summary below) +- *(Future phases: defences)* **`scan_level: "basic"` (within normal scanner range):** - Planet name @@ -75,7 +76,7 @@ If `has_scanner` is false, show a muted placeholder: Scanner: None installed ``` -No inline production shortcut is shown here — the player uses the production queue panel (future phase) to add one. +No inline production shortcut is shown here — the player uses the Production view (see [PRD 68 — UI Production](68-ui-production.md)) to add a `planetary_scanner` to the queue. ### Enemy Planet (Penetrating Scan) @@ -261,6 +262,37 @@ Only one such command per planet per turn — a second flip replaces the first i ### Visibility -- The section is absent for non-own planets, including enemy planets under a penetrating scanner — the toggle is owner-only, keyed on `PlayerPlanet.contribute_only_leftover_to_research` being present. -- The section is absent on stale own planets (an own planet can become stale if it is captured and later falls out of scanner range); the toggle needs a live planet view to edit. +- The section is absent for non-own planets, including enemy planets under a penetrating scanner — the toggle is owner-only, keyed on `PlayerPlanet.contribute_only_leftover_to_research` being present (and by PRD 11, an own planet is always `scan_level: "detailed"` with `scan_age: 0`, so no separate scan / staleness gate is needed; loss of ownership clears the field). - The section is absent when the player's `PlayerState.research` is absent (e.g. pre-PRD 21 states during migration), since the "Reserved this turn" figure has no source. + +## Production Summary + +Shown on **own planets only**. The full production editor lives in [PRD 68 — UI Production](68-ui-production.md); this section is a compact read-only summary plus a link into that workspace. + +By PRD 11, an own planet is always `scan_level: "detailed"` with `scan_age: 0`. Ownership is therefore the only gate — if the player is the owner, the planet view is live by construction. The de-facto signal in the client is `PlayerPlanet.production_queue` being present (it is `None` for non-owners per PRD 13 visibility). + +### Layout + +``` +┌─────────────────────────────────────────────────────────┐ +│ Production [ Manage → ] │ +│ Queue: 3× Factory, 5× Mine, +1 more │ +└─────────────────────────────────────────────────────────┘ +``` + +Elements: + +- **Header** — section label `Production` with a `Manage →` button on the right. Clicking the button switches the app to Production mode (PRD 68) and pre-selects this planet in the list. +- **Queue summary** — one line summarising the first few queue entries: + - Empty queue: `Queue: empty`. + - One entry: `Queue: ×