From 073fb9f718ed33562a9951294cf4ad305d483890 Mon Sep 17 00:00:00 2001 From: Senrokai Date: Wed, 30 Sep 2026 16:14:28 +0200 Subject: [PATCH] Ring only the planet hosts inside the survey edge, so the Kepler field is not a band over the view 4c8e4a0 added 3 277 hosts from the archive, 2 883 of them past 250 pc and 916 past a kiloparsec, most in the Kepler field. Every host got a 12 px ring whatever its distance and a place in the draw budget's first tier after the pinned stars, rules set when 1 of 1 379 hosts lay past 250 pc. At boot the opening view held 3 332 rings against 1 290 before, 1 687 of them in its lower right (x > 1000, y > 550 at 1600x1000) where there were 116, over the 250-350 pc grid labels; hosts 1-3 kpc away read as neighbours in a view whose range is 307 pc, and 629 stars past a kiloparsec were drawn where there had been 3. Rings and the host tier now take the hosts within SURVEY_EDGE_PC only. The far hosts still compete for the budget by brightness, and search still enters them. Measured in the running app at 1600x1000: 1 853 rings in all, 1 698 in the opening view, 199 in its lower right; 31 stars past a kiloparsec drawn; 1 767 hosts drawn. This reverses "a ring on every host" for the far ones: that was the user's rule of 2026-09-17, when the only far host was one star, so it is flagged for them. The scene test's fixture gains the lens's planet, 6.7 kpc out. The new test checks the ring count and the host tier; the opening-view test now expects the lens out of that tier. Control: dropping the distance condition fails the new test and that one (2 of 824). Co-Authored-By: Claude Opus 5.5 (1M context) --- .../galaxy-system-scene.component.spec.ts | 14 ++++++++++++-- .../galaxy-system-scene.component.ts | 15 ++++++++------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/app/features/galaxy-system/galaxy-system-scene.component.spec.ts b/src/app/features/galaxy-system/galaxy-system-scene.component.spec.ts index 508f28e..dbd3e3a 100644 --- a/src/app/features/galaxy-system/galaxy-system-scene.component.spec.ts +++ b/src/app/features/galaxy-system/galaxy-system-scene.component.spec.ts @@ -60,6 +60,9 @@ const PROXIMA_B: ExoplanetRecord = { orbit: { semiMajorAxisAu: 0.0485, eccentricity: 0.02 } }; +// A microlensing planet, whose host the archive places 6.7 kpc out. +const LENS_B: ExoplanetRecord = { id: 'KMT-2016-BLG-1107L b', hostStarId: LENS.id, hostStarName: 'KMT-2016-BLG-1107L', name: 'KMT-2016-BLG-1107L b', orbit: {} }; + const DEEP_SKY_OBJECT: DeepSkyRecord = { id: 'NGC0224', name: 'Andromeda Galaxy', @@ -186,7 +189,7 @@ class FakeDataLoaderService { } loadExoplanets(): Promise { - return Promise.resolve([PROXIMA_B]); + return Promise.resolve([PROXIMA_B, LENS_B]); } loadDeepSky(): Promise { @@ -237,6 +240,12 @@ describe('GalaxySystemSceneComponent camera-flight transitions', () => { await flushAsync(); }); + it('rings the systems inside the survey edge, and puts them first in the draw budget, not a host kiloparsecs out', () => { + const scene = fixture.componentInstance as unknown as { hostRings: { count: number }; hostStars: Uint8Array }; + expect(scene.hostRings.count).toBe(2); + expect([...scene.hostStars]).toEqual(STARS.map((star) => (star === SUN || star === PROXIMA ? 1 : 0))); + }); + it('starts in the galaxy view with the system group hidden', () => { const component = fixture.componentInstance as unknown as { galaxyGroup: THREE.Group; systemGroup: THREE.Group }; expect(component.galaxyGroup.visible).toBe(true); @@ -296,7 +305,8 @@ describe('GalaxySystemSceneComponent camera-flight transitions', () => { expect(refocus).toHaveBeenCalledTimes(1); const [focus] = refocus.mock.calls[0]; expect(focus.view).toBeDefined(); - // The Sun has Earth and Proxima its b, so both are hosts; the others have nothing catalogued. + // The Sun has Earth and Proxima its b, so both are hosts; the lens has a planet too, but 6.7 kpc + // out, past the survey edge; the others have nothing catalogued. expect(Array.from(focus.hosts ?? [])).toEqual([1, 0, 1, 0, 0, 0]); }); diff --git a/src/app/features/galaxy-system/galaxy-system-scene.component.ts b/src/app/features/galaxy-system/galaxy-system-scene.component.ts index 84b3cfc..35f48f1 100644 --- a/src/app/features/galaxy-system/galaxy-system-scene.component.ts +++ b/src/app/features/galaxy-system/galaxy-system-scene.component.ts @@ -760,14 +760,15 @@ export class GalaxySystemSceneComponent implements AfterViewInit, OnDestroy { this.starsByBrightness, publishedTemperaturesK(exoplanets), ); - this.hostStars = Uint8Array.from(stars, (star) => - this.starIdsWithBodies.has(star.id) ? 1 : 0, - ); + // Ringed, and drawn ahead of the brightness tier, only inside the survey edge. The 2 883 hosts + // the archive places past it, 916 of them beyond a kiloparsec, mostly the Kepler field's, were + // a band of 1 687 fixed-size rings over the opening view's lower right, on the 250-350 pc grid + // labels, and read as neighbours; they still compete for the budget by brightness, and search + // still enters them. + const ringed = (star: StarRecord): boolean => this.starIdsWithBodies.has(star.id) && Math.hypot(star.x, star.y, star.z) <= SURVEY_EDGE_PC; + this.hostStars = Uint8Array.from(stars, (star) => (ringed(star) ? 1 : 0)); this.galaxyGroup.add(this.starField.object); - this.hostRings = new HostStarRings( - stars.filter((star) => this.starIdsWithBodies.has(star.id)), - HUD_ACCENT, - ); + this.hostRings = new HostStarRings(stars.filter(ringed), HUD_ACCENT); this.galaxyGroup.add(this.hostRings.object); this.jumpLinks = new JumpLinkRenderer(HUD_ACCENT); this.galaxyGroup.add(this.jumpLinks.object);