From c77d3ed1d9c582cb69bdf593a15ff25e431ac549 Mon Sep 17 00:00:00 2001 From: Senrokai Date: Thu, 17 Sep 2026 15:21:41 +0200 Subject: [PATCH] Keep the Routes panel's entries across a trip to another tab The panel was unmounted with its tab, so leaving it reset departure, destination and range. The range reset was also a lie: the slider came back at 3 pc while the scene kept drawing the graph at the range last chosen. The panel now stays mounted and is hidden while another tab is open, which still replays the acquire wipe when it is shown again. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_016jxMkwA2rbicdGxHosecYi --- .../features/hud/hud-dock.component.spec.ts | 28 +++++++++++++++++ src/app/features/hud/hud-dock.component.ts | 31 ++++++++++--------- 2 files changed, 45 insertions(+), 14 deletions(-) diff --git a/src/app/features/hud/hud-dock.component.spec.ts b/src/app/features/hud/hud-dock.component.spec.ts index 0ced268..9018ecf 100644 --- a/src/app/features/hud/hud-dock.component.spec.ts +++ b/src/app/features/hud/hud-dock.component.spec.ts @@ -252,4 +252,32 @@ describe('HudDockComponent', () => { fixture.detectChanges(); expect(tab('Readout').getAttribute('aria-selected')).toBe('true'); }); + + it('keeps what the Routes panel was set to across a trip to another tab', () => { + setReadout(); + fixture.componentRef.setInput('routing', true); + fixture.componentRef.setInput('routeOptions', [{ id: 7, name: 'Sirius', subtitle: '2.6 pc' }]); + fixture.componentRef.setInput('defaultTab', 'routes'); + fixture.detectChanges(); + + const destination = host().querySelector('#route-to')!; + destination.value = 'Sir'; + destination.dispatchEvent(new Event('input')); + fixture.detectChanges(); + host().querySelector('#dock-panel-routes ul button')!.click(); + const range = host().querySelector('#route-range')!; + range.value = '6'; + range.dispatchEvent(new Event('input')); + fixture.detectChanges(); + + tab('Readout').click(); + fixture.detectChanges(); + expect(host().querySelector('#dock-panel-routes')!.hidden).toBe(true); + tab('Routes').click(); + fixture.detectChanges(); + + expect(host().querySelector('#dock-panel-routes')!.hidden).toBe(false); + expect(host().querySelector('#route-to')!.value).toBe('Sirius'); + expect(host().querySelector('#route-range')!.value).toBe('6'); + }); }); diff --git a/src/app/features/hud/hud-dock.component.ts b/src/app/features/hud/hud-dock.component.ts index 1330b25..ddf757e 100644 --- a/src/app/features/hud/hud-dock.component.ts +++ b/src/app/features/hud/hud-dock.component.ts @@ -128,20 +128,6 @@ function isWideViewport(): boolean { } } - @case ('routes') { -
- -
- } @case ('bookmarks') {
@if (bookmarks.bookmarks().length) { @@ -198,6 +184,23 @@ function isWideViewport(): boolean { } } } + + @if (routing()) { +
+ +
+ }