From 48c57fbf2466878a3734706d11e8ae4a507da536 Mon Sep 17 00:00:00 2001 From: OGMods <3816927+OGMods@users.noreply.github.com> Date: Sun, 22 Nov 2026 20:52:09 +0300 Subject: [PATCH] Order the steps by area, keep the kind filter with the interface hidden, regroup the short-screen menu Steps: - Order every step by area: the one nearest the last step's tiles, ties in reading order. Power no longer orders them (the island is built out whole either way); the plan still stops at the solve's power. "Most power" becomes "By area", and a stored "power" order reads as it. - A swap that sends both buildings home goes first: two moves in one. - A swap that lands a building where its own kind is still to be built keeps it there and sends the build on, instead of moving it off and buying another for the tile it left. - Pair a kind's spare leavers and arrivals so a tile is one replace rather than a sale and a build. - Boards are scored once per step rather than per candidate (except By kind). On 35 real islands against their solves: 3002 -> 2935 steps, 3.3 -> 1.0 tiles between steps, jumps over 4 tiles 37% -> 3%. Interface: - With the interface hidden, the kind filter stays at the bottom centre on the solver's board. - The readout's menu on a short screen is ordered by use: Hide interface and Center view; Steps, Copy, Share, Save as image; Island stats, Import, Transfer, Settings; map size; Discard last but one. --- src/App.svelte | 21 ++ src/CLAUDE.md | 8 +- src/lib/components/header/OverflowMenu.svelte | 302 +++++++++++------- src/lib/components/hud/CLAUDE.md | 3 +- src/lib/components/hud/MoveStepsBar.svelte | 14 +- src/lib/components/index.ts | 1 + .../inspector/BoardStatsCard.svelte | 10 +- .../components/modals/StepOrderModal.svelte | 4 +- src/lib/simulation/moveSteps.test.ts | 103 ++++-- src/lib/simulation/moveSteps.ts | 249 +++++++++++---- src/lib/state/CLAUDE.md | 41 ++- src/lib/state/ui.svelte.ts | 12 +- src/lib/storage/storage.ts | 2 +- src/lib/types/ui.ts | 7 +- 14 files changed, 521 insertions(+), 256 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index 0c3b25b..00dfeb1 100755 --- a/src/App.svelte +++ b/src/App.svelte @@ -13,6 +13,7 @@ ImportModal, HudToolbar, MoveStepsBar, + KindFilter, PixiCanvas, PreviewBanner, SettingsModal, @@ -344,6 +345,14 @@ > + + {#if !readOnly && uiState.showingSolver && uiState.canSwitchBoards} +
+ {/if} {/if} @@ -552,6 +561,18 @@ color: var(--text); } + /* Bottom centre, where the HUD that normally carries it sits. */ + .hidden-filter { + position: absolute; + left: 50%; + bottom: calc(var(--safe-bottom) + 0.75rem); + transform: translateX(-50%); + max-width: calc(100vw - var(--safe-left) - var(--safe-right) - 1.5rem); + z-index: var(--z-hud); + display: flex; + justify-content: center; + } + /* * `--warn`: this page is past a limit — the deploy it was loaded from is * gone. Nothing is destroyed, so not `--danger`. diff --git a/src/CLAUDE.md b/src/CLAUDE.md index fd29f06..9639f9d 100644 --- a/src/CLAUDE.md +++ b/src/CLAUDE.md @@ -246,10 +246,14 @@ rules still apply on top. Three things pack tighter there: - **The header folds into the readout** on a phone with a readout to fold into (`uiState.headerInCard`): the header is not mounted, its menu sits in the card's head beside the chevron, and Center View and the card's own - actions (Steps, Copy, Discard) become the menu's first rows (`actions` on + actions (Steps, Copy, Discard) become rows of the menu (`actions` on `OverflowMenu`). Two stacked bars become one line. Hosted there, the menu always takes in Share and map size, since no header holds them even on a - landscape phone wider than `isPhone`. `TimelineStatus` goes with the header + landscape phone wider than `isPhone`, and it is ordered by use, each + action placed by its `group`: Hide interface and Center View; Steps, Copy, + Share and Save as image; Island stats, Import, Transfer and Settings; map + size; Discard alone near the foot, away from the thumb's first landing; + Support. `TimelineStatus` goes with the header — the Chronon pill is the full-height screen's — and the menu closes itself on unmount, since `overflowOpen` is one flag across both hosts. With no readout — an empty board of one's own — the header stays, as a corner pill diff --git a/src/lib/components/header/OverflowMenu.svelte b/src/lib/components/header/OverflowMenu.svelte index ac8536b..f450c17 100755 --- a/src/lib/components/header/OverflowMenu.svelte +++ b/src/lib/components/header/OverflowMenu.svelte @@ -2,12 +2,19 @@ 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. + * A row a host adds to 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; + /** + * Where it goes in the readout's menu (`bare`): with Hide interface at + * the top (`view`), with Share and Save as image (`layout`), or alone + * near the foot (`end`), where a destructive row is not the first thing + * a thumb lands on. The header's menu puts every action first. + */ + group: "view" | "layout" | "end"; /** Any lucide icon; they all share one component type. */ icon: typeof LocateFixed; label: string; @@ -45,9 +52,9 @@ */ /* - * Rows the host puts first. On a short phone the readout hosts this menu in - * its head, and its own actions — Center View, Steps, Copy, Discard — come - * in here rather than taking a line of their own. + * Rows the host adds. On a short phone the readout hosts this menu in its + * head, and its own actions — Center View, Steps, Copy, Discard — come in + * here rather than taking a line of their own, each placed by its `group`. */ let { actions = [], @@ -169,126 +176,54 @@ {#if uiState.overflowOpen} +{#snippet actionRows(group?: MenuAction["group"])} + {#each actions.filter((a) => !group || a.group === group) as a (a.key)} + + {/each} +{/snippet} + +{#snippet sizeSection()} + +{/snippet} + +{#snippet shareRow()} + +{/snippet} + + +{#snippet imageRow()} + +{/snippet} + + +{#snippet hideRow()} + +{/snippet} + + +{#snippet importRows()} + {#if showImport} + + + {/if} +{/snippet} + + +{#snippet statsRow()} + +{/snippet} + + +{#snippet settingsRow()} + +{/snippet} +