feat: show what each backup is doing as a light that moves like a rocket

Replace the single-shot meteor with a per-orbit activity system. A backup's state
is read from how a small glowing triangle moves, not from a drawing of a rocket.

- Events come from status changes between polls, so scheduled backups animate
  too. A click shows its own verdict until a poll that began after it has landed,
  which keeps one backup from being animated twice or flipping through a stale
  status. Loading the page only sets a baseline and never replays history.
- Queued waits on its star. Running circles it, climbing and spinning up.
- Success waits for a launch window, where the light's own motion already carries
  it round the black hole, then departs with that velocity. It falls under a
  pseudo-Newtonian pull after a burn that trims angular momentum to just under
  the capture limit, so the path spirals with the orbits, always arrives, and
  never slows on the way in. Near the shadow it reddens, dims and stretches, and
  the disk spins up as it feeds.
- Failure explodes in place or, when the hub says the transfer failed, launches,
  loses power and falls back. The star keeps its busy look until the outcome and
  then turns red. Rehearsal is a faint dashed light that lands on its star.
- Position and velocity are integrated and a mode change only swaps forces, so
  every transition is continuous and interruptible. Parameters use the shared
  spring tokens. Trails follow the path actually flown.
- At most ten lights are drawn; reduced motion draws none and shows outcomes at once.
- Pure modules with tests for activity, physics and trails. The Playwright capture
  script now checks lights by data-orbit. The animation guideline in docs/UI.md
  describes the simulation approach in place of the old single progress value.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-13 23:04:25 +07:00
parent d0f22c4ad0
commit 8b6efe1eaa
16 changed files with 1571 additions and 143 deletions

View File

@@ -1,4 +1,4 @@
import { useLayoutEffect, useRef } from "react";
import { useCallback, useLayoutEffect, useRef } from "react";
export function useGalaxyMotion(draw: (elapsed: number) => boolean) {
const latest = useRef(draw);
@@ -37,4 +37,7 @@ export function useGalaxyMotion(draw: (elapsed: number) => boolean) {
latest.current = draw;
if (draw(0)) wake.current?.();
});
/** Start the loop from outside a render, for example when something arrives asynchronously. */
return useCallback(() => wake.current?.(), []);
}