From da0dd5950a9870a05f847917b0d80a80a5dee527 Mon Sep 17 00:00:00 2001 From: OGMods <3816927+OGMods@users.noreply.github.com> Date: Fri, 27 Nov 2026 23:44:34 +0300 Subject: [PATCH] Re-score the islands from the shell, so an import on a short screen updates them The refresh effect lived in the header's TimelineStatus, which is unmounted on a short screen, in step mode and with the interface hidden. An import made there left the island list, Island stats and the prices on the replaced boards. --- src/App.svelte | 20 +++++++++++++++++++ .../components/header/TimelineStatus.svelte | 17 +--------------- src/lib/state/CLAUDE.md | 9 ++++++--- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index 00dfeb1..4e4b017 100755 --- a/src/App.svelte +++ b/src/App.svelte @@ -4,6 +4,7 @@ editorState, layoutState, solverState, + timelineState, uiState, viewportState, } from "./lib/state"; @@ -39,6 +40,25 @@ }); $effect(() => () => keepScreenAwake(false)); + /* + * Re-score every island whenever a saved board or the rules change — an + * import above all. The call reads its inputs before its first await, so + * this tracks exactly those. Stored solves are read off storage, which + * nothing tracks; a solve that lands or a variant applied is what changes + * them. + * + * In the shell rather than in the header's `TimelineStatus`, which is where + * it used to be: the header is unmounted on a short screen, in step mode and + * with the interface hidden, and the island list, Island stats, prices and + * the cash limit all read these figures — so an import made there left + * every one of them on the boards it replaced. + */ + $effect(() => { + void solverState.optimizationResult; + void solverState.appliedVariant; + void timelineState.refreshIslands(); + }); + /* * On a compact viewport the config panel is a bottom sheet, and once it is * pulled past `peek` it earns a scrim: the canvas behind it is no longer the diff --git a/src/lib/components/header/TimelineStatus.svelte b/src/lib/components/header/TimelineStatus.svelte index acc410f..9239228 100644 --- a/src/lib/components/header/TimelineStatus.svelte +++ b/src/lib/components/header/TimelineStatus.svelte @@ -1,11 +1,6 @@