Files
SenrokaiandClaude Opus 5 43b9b1f081 Give the map a scale bar, and rings that say how far from the Sun
The map had one way to read a distance: the Range readout, a number for how
far back the camera is. The local grid's five rings sat at 50 to 250 pc,
fixed and unlabelled. They said nothing from inside a 2 pc hop, and nothing
past 250 pc now that the Hipparcos stars Gaia places there are drawn.

A scale bar now sits under the scale rail. It shows the longest round length
(1, 2 or 5 x 10^n) that fits in 120 px, in AU inside a system and in parsecs
or kiloparsecs outside. It is measured at the depth the view is centred on,
since under perspective every depth has its own scale; under the plan view
it is exact everywhere.

The local grid's rings are now distances from the Sun, at a round step of
about a fifth of the camera's distance and out past the camera: 50 to 350 pc
from the opening view, 2 to 20 pc from twenty parsecs out. Each ring is
labelled with its distance, on the side facing what the view is centred on,
or across the far side of the grid when that is the Sun (the near side is
under the camera and out of frame). The survey edge at 250 pc stays called
out, as "Survey edge", whatever the step.

The rounding lives in one place, scale-bar.ts, shared by the bar and the
rings and tested there. Its formatter keeps three significant digits: one
digit, enough for the bar's round lengths, printed the 250 pc ring as
"300 pc".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016jxMkwA2rbicdGxHosecYi
2026-09-11 19:26:39 +02:00
..
@
2026-08-03 16:50:10 +02:00

End-to-end tests (Playwright)

These tests run the real Angular dev server in a real Chromium browser, covering interactions that unit/component tests (under src/**/*.spec.ts, run via npm test) can only approximate under jsdom — most importantly the galaxy↔system camera-flight transitions (real WebGPU/ WebGL2 initialization + raycaster picking) and cross-view search navigation.

Running

npm run e2e             # headless run against a freshly started dev server
npx playwright test --ui # interactive UI mode
npx playwright show-report

playwright.config.ts starts npm run start -- --port=4300 automatically and waits for it to respond before running the suite (webServer.reuseExistingServer is true outside CI, so an already-running ng serve on port 4300 is reused instead of starting a second one). Port 4300 is used instead of the Angular CLI's conventional 4200 to avoid colliding with an unrelated server a developer might already have running there.

Notes

  • The Sun (Sol) is always placed at the coordinate-system origin (x=0,y=0,z=0), which is exactly where the default galaxy-view camera looks. camera-flight.spec.ts relies on this to reliably click-select it by clicking the center of the canvas, without needing pixel-perfect knowledge of the star field's on-screen layout.
  • Data (bootstrap fetch of stars.bin/stars-index.json/bodies.json/exoplanets.json/ deepsky.json) loads asynchronously after the page loads, so tests poll (re-click/re-check) rather than assume the scene is interactive immediately after page.goto().
  • deepsky.json is the one dataset the scene treats as optional: it only feeds the decorative backdrop, so a failure to load it is logged and the star field comes up regardless.