Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
editorState,
layoutState,
solverState,
timelineState,
uiState,
viewportState,
} from "./lib/state";
Expand Down Expand Up @@ -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
Expand Down
17 changes: 1 addition & 16 deletions src/lib/components/header/TimelineStatus.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<script lang="ts">
import { formatNumber } from "@reactor2/solver";
import {
solverState,
timelineState,
uiState,
viewportState,
} from "../../state";
import { timelineState, uiState, viewportState } from "../../state";
import {
asset,
formatClockTime,
Expand Down Expand Up @@ -44,16 +39,6 @@
let visible = $derived(power > 0 || record !== null);
let compact = $derived(viewportState.isPhone);

// Re-score the islands whenever a saved board or the rules change; the call
// reads its inputs before its first await, so this tracks exactly those.
$effect(() => {
// Stored solves are read off storage, which nothing tracks; a solve that
// lands or a variant applied is what changes them.
void solverState.optimizationResult;
void solverState.appliedVariant;
void timelineState.refreshIslands();
});

let pace = $derived(timelineState.pace);

/*
Expand Down
9 changes: 6 additions & 3 deletions src/lib/state/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,12 @@ terrain under today's roster, research and anomaly, so one found before an
upgrade counts at the tier the player has now — no signature check, because the
shape is all that is used. An island whose solve makes less than its board keeps
the board. `targetEta.secondsWithSolves` is the wait at that power, shown only
when it beats the game's. Storage is not reactive, so `TimelineStatus`'s refresh
effect also reads `solverState.optimizationResult` and `appliedVariant`: a solve
landing or a variant applied is what changes a stored solve.
when it beats the game's. Storage is not reactive, so the refresh effect also
reads `solverState.optimizationResult` and `appliedVariant`: a solve landing or a
variant applied is what changes a stored solve. **That effect lives in
`App.svelte`, not in the header**: the header is unmounted on a short screen, in
step mode and with the interface hidden, and an import made there left the
island list, Island stats and every price on the boards it replaced.

**Without a timeline, nothing that needs one shows.** A game code from a build
that writes no section 7 — or no import at all — leaves `record.timeline` null,
Expand Down