A system view could say everything about the star it was inside and nothing about where that star was. The four nearest catalogue stars are now named around the edge of it, each with its distance, each a button that flies there — so a chain of neighbours can be walked without pulling back out to the field between hops. These are bearings, not sky positions, and that is the one deliberate compromise here. A true direction was tried first and does not work: at this field of view the visible cone is about 30 degrees, so on average one neighbour in fifteen falls inside the frame — measured, not guessed, at one label of four in Sol and none at all after a small orbit. What survives the ring is the half of the direction a viewer can act on, which way to turn to face it, and the ring reads as instrument rather than as scene because it sits at a fixed radius. Real distance was never an option: Proxima is 268 000 AU from Sol, thirteen far planes out, so the distance goes on the type line. Proximity is answered by a new pure module rather than by a scan. A uniform grid over the catalogue answers both "the k nearest to this star" and "every star within n parsecs", the second being what the jump-link graph in the next PR is built from — one scan per node, and the quadratic would show. Its spec pins the grid against a brute-force sweep of a pseudo-random cloud, because a spatial index is an optimisation and never a different answer. Where the ring meets the HUD, the HUD wins: placement is given the boxes the readout, the strip and the object card occupy, and slides a name along the ring until it clears them, or drops it rather than print it half hidden. That rule is a pure function with its own spec. Four defects found while verifying this, three of them older than it: The dock's flex column was pointer-events-auto and as wide as its strip, so an invisible band above the strip swallowed every click in it — including, but not only, a neighbour's. The column is transparent now and each surface opts back in. The ring was sized against the frame's height alone, which on a phone held upright put it a viewport and a half wide: no neighbour was reachable on any portrait screen. It is sized against the shorter side. Picking a search result reopened the readout, which on a narrow viewport is a sheet over most of the scene — reopening it onto whatever was just flown to. Below sm it now folds away. A selectable label's two lines are adjacent spans, so it announced as "Sirius2.64 pc"; it carries an explicit label saying what it does. Verified: build clean, 558/558 unit, 7/7 end-to-end including a new spec that flies Sol to Barnard's Star by its label, design detector clean, screenshots at 1440x900 and 390x844 in Sol and Proxima Centauri, and the keyboard path walked: both names are in the tab order, focusable, with the accent ring. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016jxMkwA2rbicdGxHosecYi
33 lines
1.6 KiB
TypeScript
33 lines
1.6 KiB
TypeScript
import { expect, test } from '@playwright/test';
|
|
|
|
import { openSearch } from './support/open-search';
|
|
|
|
test.describe('Neighbour jump', () => {
|
|
test('a neighbour named from inside one system flies into that one', async ({ page }) => {
|
|
// Two full camera flights on a software rasterizer shared with the rest of the suite: into
|
|
// Sol, then out and into the star its label names. See the same note on camera-flight.
|
|
test.setTimeout(120_000);
|
|
await page.goto('/?stars=4000');
|
|
|
|
const searchInput = await openSearch(page);
|
|
await searchInput.fill('Sol');
|
|
await page.getByRole('button', { name: /^Sol\b/ }).first().click();
|
|
|
|
const readout = page.getByTestId('hud-title');
|
|
await expect(readout).toHaveText('Sol', { timeout: 30_000 });
|
|
|
|
// Its nearest neighbours are named around the edge of the view; each is a button that flies
|
|
// there. Barnard's Star rather than the Alpha Centauri trio, whose three members share one
|
|
// bearing and so are decluttered down to whichever the label pass reaches first.
|
|
const neighbour = page.getByRole('button', { name: /Barnard's Star/ });
|
|
await expect(neighbour).toBeVisible({ timeout: 30_000 });
|
|
await neighbour.click();
|
|
|
|
await expect(readout).toHaveText("Barnard's Star", { timeout: 45_000 });
|
|
// And from there the walk goes on: the new system names its own neighbours. Which ones is
|
|
// not asserted — several of Barnard's nearest share a bearing, so which of them survives
|
|
// the declutter is a property of the view, not a fact about the catalogue.
|
|
await expect(page.locator('.map-label--ghost')).not.toHaveCount(0, { timeout: 30_000 });
|
|
});
|
|
});
|