ui/phase-19: read-only ship-group inspector + sheet + tab dispatch
Closes Phase 19's UI surface. The inspector dispatches on the
selection variant: local / other groups render class, count, the
four tech levels, mass, cargo (type + amount when loaded),
location (planet name on-orbit, from/to/distance in hyperspace),
and — for local groups only — fleet membership + state. Incoming
groups surface origin / destination / distance / speed and the
inline ETA = ceil(distance / speed); zero speed collapses to the
designer's existing "—" placeholder. Unidentified groups render
just the (x, y) coordinates and the no-data hint, mirroring the
unidentified planet treatment.
Layout / inspector-tab plumbing:
- inspector-tab.svelte derives selectedShipGroup against the
rendered report and mounts <ShipGroup /> when the planet
branch doesn't match. Stale refs (an index that no longer
resolves after a turn refresh) collapse cleanly to the empty
state.
- +layout.svelte mounts <ShipGroupSheet /> alongside the
existing planet sheet on mobile; both share the
`effectiveTool === "map"` guard and clear-on-close.
i18n: en + ru both grow ~30 keys under
`game.inspector.ship_group.*`. Adding a key to one without the
other is a TS error (TranslationKey is `keyof typeof en`), so the
Russian mirror stays mandatory.
Tests:
- inspector-ship-group.test.ts exercises every variant —
on-planet local, in-hyperspace local, cargo-loaded local,
foreign, incoming with ETA, incoming with zero speed,
unidentified, plus the missing-planet `#NN` fallback.
- tests/e2e/inspector-ship-group.spec.ts is a smoke spec that
drives the DEV-only synthetic-report loader from /lobby
through navigation to /games/synthetic-XXX/map.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -246,6 +246,36 @@ const ru: Record<keyof typeof en, string> = {
|
||||
"game.designer.ship_class.preview.range": "дальность при полной загрузке (св.лет/ход)",
|
||||
"game.designer.ship_class.preview.cargo_capacity": "грузоподъёмность одного корабля",
|
||||
"game.designer.ship_class.preview.unavailable": "—",
|
||||
|
||||
"game.inspector.ship_group.kind.local": "ваша группа",
|
||||
"game.inspector.ship_group.kind.other": "группа другой расы",
|
||||
"game.inspector.ship_group.kind.incoming": "входящая группа",
|
||||
"game.inspector.ship_group.kind.unidentified": "неопознанная группа",
|
||||
"game.inspector.ship_group.field.class": "класс",
|
||||
"game.inspector.ship_group.field.count": "кораблей",
|
||||
"game.inspector.ship_group.field.drive": "двигатели",
|
||||
"game.inspector.ship_group.field.weapons": "оружие",
|
||||
"game.inspector.ship_group.field.shields": "защита",
|
||||
"game.inspector.ship_group.field.cargo_tech": "грузоперевозки",
|
||||
"game.inspector.ship_group.field.mass": "масса",
|
||||
"game.inspector.ship_group.field.cargo_load": "груз на борту",
|
||||
"game.inspector.ship_group.field.location": "расположение",
|
||||
"game.inspector.ship_group.field.from": "из",
|
||||
"game.inspector.ship_group.field.to": "в",
|
||||
"game.inspector.ship_group.field.distance": "оставшееся расстояние",
|
||||
"game.inspector.ship_group.field.speed": "скорость (св.лет/ход)",
|
||||
"game.inspector.ship_group.field.eta": "прибытие (ходов)",
|
||||
"game.inspector.ship_group.field.fleet": "флот",
|
||||
"game.inspector.ship_group.field.state": "состояние",
|
||||
"game.inspector.ship_group.field.coordinates": "координаты",
|
||||
"game.inspector.ship_group.cargo.col": "колонисты",
|
||||
"game.inspector.ship_group.cargo.cap": "промышленность",
|
||||
"game.inspector.ship_group.cargo.mat": "сырьё",
|
||||
"game.inspector.ship_group.cargo.emp": "пусто",
|
||||
"game.inspector.ship_group.cargo.none": "нет",
|
||||
"game.inspector.ship_group.location.in_hyperspace": "в гиперпространстве",
|
||||
"game.inspector.ship_group.fleet.none": "—",
|
||||
"game.inspector.ship_group.unidentified_no_data": "данных нет — известны только координаты",
|
||||
};
|
||||
|
||||
export default ru;
|
||||
|
||||
Reference in New Issue
Block a user