Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"Bash(terraform plan *)",
"Bash(gsutil ls *)",
"Bash(gh run *)",
"Bash(grep *)"
"Bash(grep *)",
"Bash(npm install *)"
]
}
}
15 changes: 9 additions & 6 deletions docs/prd/13-production.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 6 additions & 1 deletion docs/prd/60-ui-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docs/prd/61-ui-galaxymap.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ The map follows the original Stars! visual language:
- **Scanner circles** — two concentric circles per scanner source (PRD 11), matching the original Stars! visual style:
- **Normal scanner range:** red circle (`rgba(255, 0, 0, 0.15)` fill, `rgba(255, 0, 0, 0.4)` border)
- **Penetrating scanner range:** light green circle (`rgba(0, 255, 0, 0.1)` fill, `rgba(0, 255, 0, 0.3)` border) — always smaller, drawn inside the red circle
- Both fleet scanners and planet scanners contribute (planet scanners future phase)
- Scanner circles are drawn per-fleet, centred on the fleet's position
- The effective scanner range for a fleet is the maximum scanner range of any ship design in its composition (same rule for both normal and penetrating)
- Both fleet scanners and planet scanner installations contribute; each draws circles centred on its own position
- For fleets: the effective scanner range is the maximum of any ship design's scanner in its composition
- For planet installations: range comes from `planet.scanner.normal` / `planet.scanner.penetrating` (own planets only, when `installed: true`)
- Toggleable via a keyboard shortcut or UI toggle — can be visually noisy, so the player should be able to show/hide them
- When a fleet is selected, its scanner circles are drawn brighter/more opaque for emphasis
- **Selection indicator** — a ring or bracket around the selected planet/fleet
Expand Down
40 changes: 36 additions & 4 deletions docs/prd/62-ui-planet-detail.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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: <qty>× <label>`.
- Two entries: `Queue: <qty>× <label>, <qty>× <label>`.
- Three or more: `Queue: <qty>× <label>, <qty>× <label>, +<N> more` where `N = queue.length - 2`.
- Labels use the same display names as the Production workspace (ship-design name for `ship` items, friendly type names otherwise).

No add / remove / reorder controls live on the planet detail panel — those gestures all go through PRD 68.

### Visibility

- Present when the viewing player owns the planet (equivalently, `PlayerPlanet.production_queue` is non-null).
- Absent otherwise — including enemy planets under any scan level, and any stale carried-forward record of a planet the player used to own (once ownership is lost, `production_queue` is nulled and the planet ceases to be an "own planet" for visibility purposes).
Loading
Loading