From d397aaa7e056a3ec026c2f278d7d6febb1dd6bf4 Mon Sep 17 00:00:00 2001 From: Senrokai Date: Fri, 21 Aug 2026 15:08:40 +0200 Subject: [PATCH] Let the Solar System be kept MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Sun's catalogue id is 0, and the readout's keep control was shown by `@if (keepableStarId(); as starId)` — which reads zero as "there is no star here". Of the six hundred and thirty-four systems the map can be inside, the one nobody could keep was Sol. Checked against null now, with a test that keeps star zero, because this is the sort of thing that comes back. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_016jxMkwA2rbicdGxHosecYi --- src/app/features/hud/hud-dock.component.spec.ts | 15 +++++++++++++++ src/app/features/hud/hud-dock.component.ts | 15 +++++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/app/features/hud/hud-dock.component.spec.ts b/src/app/features/hud/hud-dock.component.spec.ts index 1e43963..8fdf075 100644 --- a/src/app/features/hud/hud-dock.component.spec.ts +++ b/src/app/features/hud/hud-dock.component.spec.ts @@ -210,6 +210,21 @@ describe('HudDockComponent', () => { expect(host().querySelector('[aria-label="Forget Sirius"]')?.getAttribute('aria-pressed')).toBe('true'); }); + it('keeps the one system whose catalogue id is zero, which truthiness would have lost', () => { + // The Sun is star 0. A `@if (id; as ...)` reads that as "no star" and hides the control. + const bookmarks = TestBed.inject(BookmarksStore); + setReadout(); + fixture.componentRef.setInput('title', 'Sol'); + fixture.componentRef.setInput('keepableStarId', 0); + fixture.componentRef.setInput('defaultTab', 'readout'); + fixture.detectChanges(); + + host().querySelector('[aria-label="Keep Sol"]')?.click(); + fixture.detectChanges(); + + expect(bookmarks.has('star', 0)).toBe(true); + }); + it('offers nothing to keep where the readout is a scale rather than a place', () => { setReadout(); fixture.componentRef.setInput('defaultTab', 'readout'); diff --git a/src/app/features/hud/hud-dock.component.ts b/src/app/features/hud/hud-dock.component.ts index 2cfe244..6358467 100644 --- a/src/app/features/hud/hud-dock.component.ts +++ b/src/app/features/hud/hud-dock.component.ts @@ -91,16 +91,19 @@ function isWideViewport(): boolean {

{{ eyebrow() }}

{{ title() }}

- @if (keepableStarId(); as starId) { + + @if (keepableStarId() !== null) { }