Name the neighbours, from inside the system
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
This commit is contained in:
@@ -110,12 +110,17 @@ node .claude/skills/run-star-map/driver.mjs probe inner
|
||||
{ "name": "Earth", "kind": "Planet" },
|
||||
{ "name": "Mercury", "kind": "Planet" },
|
||||
{ "name": "Venus", "kind": "Planet" }
|
||||
],
|
||||
"neighbours": [
|
||||
{ "name": "Proxima Centauri", "distance": "1.30 pc" },
|
||||
{ "name": "Barnard's Star", "distance": "1.82 pc" }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
`probe` accepts the same four view names. Labels are read from the CSS2D layer
|
||||
(`.map-label` > `.map-label-name` + `.map-label-kind`).
|
||||
(`.map-label` > `.map-label-name` + `.map-label-kind`). `neighbours` is the ring of nearby
|
||||
stars named from inside a system (`.map-label--ghost`); it is absent where there are none.
|
||||
|
||||
## Run (human path)
|
||||
|
||||
|
||||
@@ -211,21 +211,27 @@ async function probe(page, view) {
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
// Labels are plain DOM in a CSS2D layer: .map-label > .map-label-name + .map-label-kind.
|
||||
const labels = await page.locator('.map-label').evaluateAll((nodes) =>
|
||||
// Neighbouring stars named from inside a system carry .map-label--ghost; they are reported
|
||||
// apart from the system's own bodies, since they are not in the system being probed.
|
||||
const all = await page.locator('.map-label').evaluateAll((nodes) =>
|
||||
nodes
|
||||
.filter((n) => n.offsetParent !== null)
|
||||
.map((n) => ({
|
||||
name: n.querySelector('.map-label-name')?.textContent?.trim() ?? '',
|
||||
kind: n.querySelector('.map-label-kind')?.textContent?.trim() ?? null
|
||||
kind: n.querySelector('.map-label-kind')?.textContent?.trim() ?? null,
|
||||
ghost: n.classList.contains('map-label--ghost')
|
||||
}))
|
||||
);
|
||||
const labels = all.filter((label) => !label.ghost).map(({ name, kind }) => ({ name, kind }));
|
||||
const neighbours = all.filter((label) => label.ghost).map(({ name, kind }) => ({ name, distance: kind }));
|
||||
console.log(
|
||||
JSON.stringify(
|
||||
{
|
||||
title: (await title(page).textContent())?.trim(),
|
||||
level: (await level(page).textContent())?.trim(),
|
||||
labelCount: labels.length,
|
||||
labels
|
||||
labels,
|
||||
...(neighbours.length ? { neighbours } : {})
|
||||
},
|
||||
null,
|
||||
2
|
||||
|
||||
Reference in New Issue
Block a user