feat: restyle the web UI as a spaceship cockpit
The map is a canopy with a bezel, an inset window and a sill carrying a Window | Radar view switch. Consoles open as centered screens; Orbits, Outposts, Activity and the snapshot sheet follow one vocabulary of recessed fields, bevelled keys and lamps that stay distinct by shape. - Activity replaces the Restore tab with one log of backups and restores. Rows lead to a snapshot or an orbit; restores and exports start from the snapshot. The model is a pure function with tests. - Restore opens from a snapshot as a two column screen: choose and confirm on the left, job progress or countdown on the right. - Add Segmented and a themed Select (portal list, keyboard and form support). - Add a spotlight-style search panel. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
18
docs/UI.md
18
docs/UI.md
@@ -12,7 +12,18 @@ The persistent viewport maps backup jobs and recovery points. The black hole rep
|
||||
- **Big Screen** expands the map and keeps summary counts, motion controls, and a floating navigation dock. The map and dock spring into position within the current browser viewport. Use **Exit big screen** or Escape to return to the workspace.
|
||||
- Drag the active navbar item sideways and release to open the destination. The regular navbar uses text and a sliding underline. The Big Screen dock uses labeled icons and a liquid highlight.
|
||||
- The navbar stays available above the side panel so you can switch directly between consoles. In the regular workspace it becomes a floating text dock in the same top position. Big Screen keeps its icon dock at the bottom.
|
||||
- Use **Search**, **⌘K**, or **Ctrl+K** from the vault, a console, or Big Screen. An empty field shows navigation shortcuts. Type to find destinations, orbits by name, ID, or provider, and snapshots by orbit name, ID, or displayed capture date. Search uses the summaries already loaded by the vault. Use the arrow keys and Enter, or select a result with a pointer. Escape closes search and returns focus to its button.
|
||||
- Use **Search**, **⌘K**, or **Ctrl+K** from the vault, a console, or Big Screen. An empty field shows navigation shortcuts. Type to find destinations, orbits by name, ID, or provider, and snapshots by orbit name, ID, or displayed capture date. Search uses the summaries already loaded by the vault. Use the arrow keys and Enter, or select a result with a pointer. Escape closes search and returns focus to its button. Search is a spotlight panel over a dimmed, lightly blurred deck: a large input, grouped results with a kind label on the right (the active row adds an Enter mark), a footer of key hints and the result count, and a "No signal" message when nothing matches.
|
||||
|
||||
## Consoles
|
||||
|
||||
- Orbits, Outposts, Activity and Snapshot open as console screens, and Restore opens from a snapshot: a centered panel under the navbar with an engraved label, a title and an Esc key, sized per console (`panelWidths` in `App.tsx`). They fade and rise with the shared spring, and the map behind is inert while one is open.
|
||||
- Orbits is two columns. The left holds the outpost job history and one card per orbit (a failed orbit gets an ember edge; Capture is the single amber key). The right is the permanent New orbit form: Folder | Database and Via hub | Via outpost are `Segmented` switches, fields are recessed, and Cancel resets the form. Below 860 px the form stacks under the list.
|
||||
- Outposts is a gate. With no code it shows a dark eye inside violet rings and one key, Open a wormhole. With a code it shows the code in large mono, a burn bar and a ticking time left (the bar counts down from the time the code was first seen, since the hub sends only the expiry), the agent command with a Copy key, and Generate fresh code. Outpost health is a roster with a lamp, last activity and an Online or Silent label; an outpost is online if it was seen in the last two minutes.
|
||||
- Selects are themed (`ui/Select.tsx`, a drop-in for `<select>` that reads `<option>` children). The trigger is a recessed field with a chevron set in from the edge. The list is drawn in a portal so a console's scroll never clips it, flips above when there is no room below, and shows the active row with an amber edge and the chosen row with a check. Arrow keys, Home, End, type-ahead, Enter and Space work with focus kept on the trigger, and Escape closes only the list. A hidden input carries the value into forms, so `required` still validates.
|
||||
- Activity is one log of backups and restores, and it only leads somewhere; it never acts. A row opens its snapshot (restores start there) or, for a backup that is running or failed and has no snapshot yet, its orbit. Rows are grouped Needs you (a restore in `recovery_required`, or a hub orbit whose last backup failed), Running now (with a five-tick position) and then days. A backup that stored a snapshot is one row. A restore whose snapshot retention has removed is shown without a link. Filter by text or by Backups and Restores. The Activity tab lamp turns ember while anything needs you. Data comes from the snapshot list, `GET /api/v1/capture-jobs`, which covers outpost orbits, `GET /api/v1/restore-jobs`, and the last status of hub orbits, which have no job list, so a failed one has no time. File exports are not logged: the hub keeps those sessions in memory and cannot list them, so a running export is followed from the Restore screen, which the footer reopens while one is active. The model is in `web/src/lib/activity.ts`.
|
||||
- The Restore screen is two columns. The left chooses and confirms: the recovery point as a card, the snapshot select, and a Restore to database | Export file on hub switch (shown for managed database snapshots). Database mode picks a registered target, shows an amber warning that the target is replaced, and asks for the typed confirmation before Queue database restore is enabled. The right follows the work. For a database it is the newest restore job as a five-step progress list (Queued, Verifying, Safety backup, Applying restore, Complete); a failed step becomes an ember diamond with the hub's reason, and recovery acknowledgement appears there when the job needs it. Older jobs are listed compactly. For a file export it is the countdown ring, which keeps counting from the hub's session, with Abort on the left. Below 860 px the right column stacks under the left.
|
||||
- The snapshot sheet opens from a moon, a history row or search. Its label says where the point sits (Recovery point · 1 of 4). A hero shows a small orbit with up to four moons and the chosen one lit; Captured, Payload (with the change against the previous snapshot of the same orbit) and Recovery sit in one plate; the id has a Copy key. Database recovery options (or Export file on hub) is the primary key, Download is secondary, and Delete is deliberately quiet and asks for confirmation in an ember panel.
|
||||
- Buttons are bevelled keys (`Button`, `.console-control`): raised with a top highlight, pressed with an inset shadow. Amber marks the one primary action, ember marks a destructive one.
|
||||
|
||||
## Data and rendering
|
||||
|
||||
@@ -33,7 +44,10 @@ The persistent viewport maps backup jobs and recovery points. The black hole rep
|
||||
- The galaxy loop publishes its disk clock and the capture absorption to the renderer through a shared signal, so Flowing, coasting and capture spin-up drive the disk. A locked map renders once and sleeps.
|
||||
- Quality adapts to the device. A few synchronised frames are timed at startup and after a resize, and the tier steps down until the median fits the frame budget: `high`, `medium`, `low`, `minimal`, then `still`, which freezes ambient motion. Ambient drawing is capped at 30 fps or lower. Tiers and the governor live in `quality.ts`.
|
||||
- Without WebGL2, or after a lost context, the scene falls back to the SVG core and backdrop.
|
||||
- **Radar view** in the map toolbar switches between the realistic and radar looks. The choice is remembered per browser. Without WebGL2 the button is hidden. The radar sweep runs on its own clock rather than the scene's, so it keeps turning on a locked map. Reduced motion switches looks at once and holds the sweep still and evenly lit, and the still quality tier does the same. A page that loads with the radar look applies it at once, with no wave. While the sweep runs the map redraws at the tier's frame-rate cap, so radar costs more battery than a locked realistic map, which draws nothing.
|
||||
- The map is a cockpit canopy: chamfered corners with a bezel line and corner screws (`.canopy-frame`, drawn over the map and ignoring pointer events), clipped by `.vault-scene`'s `clip-path`. Big Screen drops the frame. The bezel stays neutral in both looks.
|
||||
- The deck around the canopy follows the same vocabulary: the navbar is a tray of switches with a lamp per tab (the thumb still springs and drags), the overview is a slim telemetry rail, consoles carry an engraved label and a corner screw, and status lamps glow and stay distinct by shape. The canopy's sill holds the legend, the view switch and the motion and big-screen controls; below 760 px, and in Big Screen, the controls move up to the map toolbar.
|
||||
- Icon-only keys (Pause or Resume motion, Big screen, Sign out, Search) share one size, `--key`, and one gap, `--key-gap`, and keep their names in `aria-label` and the tooltip. Read-outs that sit beside keys (Hub online, the Big Screen status and telemetry) are recessed plates of the same height. Telemetry readings carry a lamp: ice for orbits, mint for failed at zero, ember diamond for failed above zero, a pale diamond for snapshots, violet for payload.
|
||||
- **Window | Radar** is a two-position view switch on the canopy sill (`ViewSwitch` in `VaultScene.tsx`, a `radiogroup`; arrow keys move between positions). Its thumb rides the shared spring and tints amber for the window and mint for radar. It switches between the realistic and radar looks. The choice is remembered per browser. Without WebGL2 the button is hidden. The radar sweep runs on its own clock rather than the scene's, so it keeps turning on a locked map. Reduced motion switches looks at once and holds the sweep still and evenly lit, and the still quality tier does the same. A page that loads with the radar look applies it at once, with no wave. While the sweep runs the map redraws at the tier's frame-rate cap, so radar costs more battery than a locked realistic map, which draws nothing.
|
||||
- The radar look draws range rings every 6 M, a bearing scale at 30 M just outside the disk, a crosshair and a rotating sweep head whose phosphor fades behind it. The lensed grid only shows outside about 20 M, so it never crowds the disk. The disk is drawn as contour bands equal in log brightness, and the long dim outer disk stays faint so the inner contours carry the weight.
|
||||
- A realistic and a stylized radar look share the same trace. The radar look arrives as a wave spreading outward from the hole: each pixel picks its look from its distance to a spring-driven front, with a thin leading edge (mint going to radar, amber coming back). `look.ts` holds the spring and queues a request made mid-wave rather than reversing it. `web/blackhole-proto.html` is a standalone page for tuning the look; Vite serves it in development and the build ignores it. Add `?throttle=N` to emulate a GPU N times slower.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user