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 @@