Answer the review: sky toggles in system view too, one media query, idempotent openSearch

Three findings from the automated review, all confirmed before acting.

The Sky toggle did nothing in system view. Its write lived only in the galaxy
crossfade, which the tick parks while the system group is up — and the sky is
still on screen there. It is now also written on toggle, in applyDisplay. The
suggested form of that fix crashed the scene on mount: the effect that calls
applyDisplay fires once at construction, before the engine has a scene, and
getScene() throws — the dock rendered no tabs at all. Guarded on
engine.isInitialized; verified with a screenshot of Proxima with the sky off.

isWideViewport built a fresh MediaQueryList on every document pointer-down;
one module-level query is read instead. And openSearch in the e2e support
clicked the Search tab unconditionally, which would fold it closed if a test
ever called it while already open; it now checks aria-selected first.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016jxMkwA2rbicdGxHosecYi
This commit is contained in:
2026-08-18 21:35:52 +02:00
co-authored by Claude Fable 5
parent 4a1cc5240a
commit 8b507427d8
3 changed files with 16 additions and 4 deletions
+5 -1
View File
@@ -5,6 +5,10 @@ import { Locator, Page } from '@playwright/test';
* type has to open it first — the way a user does, or with the `/` shortcut. Returns the field.
*/
export async function openSearch(page: Page): Promise<Locator> {
await page.getByRole('tab', { name: 'Search' }).click();
// Clicking the active tab folds it closed, so only click when it is not already open.
const tab = page.getByRole('tab', { name: 'Search' });
if ((await tab.getAttribute('aria-selected')) !== 'true') {
await tab.click();
}
return page.getByPlaceholder('Search stars, planets, exoplanets…');
}