From 05ecc489f89ac96082dc49754b9931647d1efac3 Mon Sep 17 00:00:00 2001 From: OGMods <3816927+OGMods@users.noreply.github.com> Date: Fri, 13 Nov 2026 17:08:06 +0300 Subject: [PATCH] Fit the app to short screens: fold the header into the readout, steps bar alone in step mode A phone split-screened beside the game gives the app 330-450px, and the full chrome left the board a sliver. Below 600px tall (and under the sidebar breakpoint, so short desktop windows keep their chrome): - The header folds into the readout: its menu sits beside the fold chevron, styled like it, with Center view, Steps, Copy and Discard as its first rows (two-press confirmations kept). With no readout the header stays as a logo-less corner pill. - The readout starts folded without touching the stored preference, and opened it leaves out the building counts the kind filter already shows. - In step mode the header and readout go; the steps bar puts its arrows beside the step's line and drops the slider. - The overflow menu opens as a top-layer popover so the card cannot clip it, closes on resize and on unmount. - Step arrows and the steps close button are smaller at every height. --- src/App.svelte | 33 ++-- src/CLAUDE.md | 62 +++++-- src/lib/components/canvas/PixiCanvas.svelte | 6 +- src/lib/components/header/Header.svelte | 33 +++- src/lib/components/header/OverflowMenu.svelte | 166 +++++++++++++++++- .../components/header/PreviewBanner.svelte | 4 +- src/lib/components/hud/MoveStepsBar.svelte | 141 +++++++++------ .../inspector/BoardStatsCard.svelte | 110 +++++++++++- src/lib/components/inspector/CLAUDE.md | 4 +- src/lib/state/ui.svelte.ts | 38 ++++ src/lib/state/viewport.svelte.ts | 22 +++ 11 files changed, 526 insertions(+), 93 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index cb78649..0c3b25b 100755 --- a/src/App.svelte +++ b/src/App.svelte @@ -78,6 +78,9 @@ viewportState.isCompact && uiState.sheetDetent !== "closed", ); + /* See `uiState.stepFocus` and `uiState.headerInCard`. */ + let stepFocus = $derived(uiState.stepFocus); + /* * Undo and redo from the keyboard. * @@ -275,7 +278,9 @@ instead of being the one thing left floating over a bare board. --> {#if !uiState.uiHidden} -
+ {#if !uiState.headerHidden} +
+ {/if} -
- -
+ {#if !stepFocus} +
+ +
+ {/if} {#if !readOnly && !hudHidden} -

+

+ import type { LocateFixed } from "lucide-svelte"; + + /** + * A row a host adds to the top of the menu. `onclick` returns `false` to + * keep the menu open — a two-press confirmation that has only armed, whose + * second press has to land on the same row. + */ + export interface MenuAction { + key: string; + /** Any lucide icon; they all share one component type. */ + icon: typeof LocateFixed; + label: string; + onclick: () => unknown; + /** Destroys something: the colour law's `--danger`. */ + danger?: boolean; + /** Armed and waiting for its second press. */ + armed?: boolean; + } + +