feat(ui): F8-10 — tables planets / ship-groups / fleets, ship-classes delete guard (#53)
Lights up three previously-stubbed table active views and tightens the
existing one:
- table-planets: 4 kind checkboxes (own / foreign / uninhabited /
unknown) + race dropdown that filters the foreign slice; row click
selects + centres the planet on the map.
- table-ship-groups: local + foreign groups in one grid, owner
checkboxes, planet dropdown (destination OR origin), class
dropdown; on-planet click focuses the destination planet, in-space
click focuses the ship group itself (camera follows interpolated
position).
- table-fleets: own fleets only with the shared planet dropdown;
on-planet click focuses the planet, in-space click centres the
camera on the interpolated fleet position without altering the
selection (no fleet variant in Selected).
- table-ship-classes: per-row Delete is disabled with a count tooltip
while at least one local ship group references the class. The
engine refuses the removal anyway; the UI pre-empts the surface.
Wires the click → map flow through a transient `SelectionStore.focus`
/ `focusPoint` channel that `map.svelte` consumes once on mount —
in-memory only, so an F5 does not re-centre.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -293,8 +293,12 @@ export function shipGroupsToPrimitives(
|
||||
* — the planet inspector lists them instead. Returns null when either
|
||||
* the group is on-planet, or the origin / destination planets are
|
||||
* not visible to the local player.
|
||||
*
|
||||
* Exported so the active-view map can centre the camera on an
|
||||
* in-space group when the F8-10 tables raise a `selection.focus`
|
||||
* request for one.
|
||||
*/
|
||||
function computeInSpacePosition(
|
||||
export function computeInSpacePosition(
|
||||
group: ReportLocalShipGroup | ReportOtherShipGroup,
|
||||
planetIndex: Map<number, ReportPlanet>,
|
||||
mapWidth: number,
|
||||
|
||||
Reference in New Issue
Block a user