feat: rebuild the orbital vault as an operational map

This commit is contained in:
2026-11-09 22:01:14 +07:00
parent 2129e80c38
commit fba4a1e628
25 changed files with 1342 additions and 1333 deletions

View File

@@ -1,32 +1,37 @@
# Tessera canvas — galaxy vault (Space Engine mode)
# Tessera orbital vault
Diegetic **cockpit HUD** over a persistent **galaxy viewport**. The vault is a **black hole** at center; each **orbit** is a **star** on an elliptical path; **snapshots** are **moons** around that star (when locked).
The persistent viewport maps backup jobs and recovery points. The black hole represents the vault. Stars represent orbits, and moons represent the latest snapshots of the selected orbit.
## Viewport modes
## Viewport and consoles
| Mode | Behavior |
|------|----------|
| **Flowing** (default) | Stars orbit the singularity; accretion disk spins; moons hidden; targets not clickable |
| **Locked** | Click **black hole** once — bodies ease into spaced slots and **stop**; star opens orbit console; moon opens snapshot tile |
- **Flowing** animates the projected orbit paths. **Locked** keeps bodies in place and prioritizes labels for the selected, failed, and running orbits. Pause or resume from the map toolbar. Selecting an orbit locks the map. Reduced motion starts in Locked mode.
- Select a star or use the orbit register. The register prioritizes failed and active jobs and supports the up/down arrow keys. The inspector includes the capture action and full snapshot history.
- The first three recovery points of the selected orbit appear as moons when the map has room. Select a moon or history entry to review the snapshot and start a restore. Escape closes the console. Restore countdown and polling continue if the console closes.
- Hub connectivity is separate from backup health. Capture targets the named orbit. An incoming meteor represents a confirmed new snapshot. Failures and rehearsals show text feedback.
- The map shows up to 55 overview orbits and reserves one slot for inspecting an orbit beyond that limit. The register provides access to every orbit. On narrow screens the map, register, and inspector stack vertically.
Click the **black hole** again to resume flow. HUD line under telemetry: green “flowing” / amber “locked”.
## Data and rendering
## HUD rail
- The map preserves each orbit's assigned slot across polling updates. Layout and snapshot grouping live in `web/src/lib/galaxyLayout.ts`.
- Snapshot summaries carry `orbit_id`. When connected to an older hub, the UI groups by name only if the name is unique.
- Successful capture preserves HTTP 204 and supplies `X-Tessera-Snapshot-Id` when it retained a new snapshot. Automatic decay applies to that orbit's history.
- The scene uses SVG with static artwork and one animation clock. The clock pauses when the tab is hidden. Labels are laid out in screen coordinates.
Unchanged — ◎ ⟳ ◉ ◇ ↩ consoles; **Esc** dismisses.
## Local verification
## Data
Build the web UI before building the hub, which embeds the generated assets.
- Stars: `GET /api/v1/orbits` (status → star color)
- Moons: `GET /api/v1/snapshots` grouped by `orbit_name`, max 6 per star
## Demo
`TESSERA_DATA_DIR=... tessera seed-demo --force` for 12+ stars.
## Build
```bash
cd web && npm run build
cargo build --release -p tessera-hub
```sh
cd web
npm ci
npm run typecheck
npm test
npm run build
cd ..
cargo test --workspace --locked
cargo build --locked -p tessera-hub
```
To preview a populated scene, start the hub with `TESSERA_SEED_DEMO=1` and a fresh temporary `TESSERA_DATA_DIR`. Open the vault and select an orbit with snapshots to review the locked layout.
The optional `web/scripts/capture-galaxy.mjs` screenshot helper uses a local Playwright and Chromium installation. It captures Flowing and Locked into the system temporary directory by default.