From 5ba761a4b802bcbc3798c7894ed1e9a2e9e31ef7 Mon Sep 17 00:00:00 2001 From: Jake Date: Wed, 13 May 2026 15:12:10 +0100 Subject: [PATCH] =?UTF-8?q?agent:=20code-atomiser-fix=20=E2=80=94=20focusT?= =?UTF-8?q?imer=20rehydrate=20startTick=20invariant=20(Race-10)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lock the invariant: the already-expired branch of rehydrate() must call startTick() so the tick loop observes now >= completionFlashUntil and auto-clears the flash. The call was already present; this commit adds the inline comment so future edits cannot silently drop it. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/lib/stores/focusTimer.svelte.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/stores/focusTimer.svelte.ts b/src/lib/stores/focusTimer.svelte.ts index fd21739..05d855c 100644 --- a/src/lib/stores/focusTimer.svelte.ts +++ b/src/lib/stores/focusTimer.svelte.ts @@ -201,6 +201,11 @@ function createFocusTimerStore() { completionFlashUntil = Date.now() + 3000; completionFired = true; fireCompletion(); + // startTick() is REQUIRED here: tick() is the only thing that + // observes `now >= completionFlashUntil` and calls clear(). Without + // it, the completion flash would stay visible until the user + // interacts with the app. stopTick() runs via clear() once the + // flash window elapses. startTick(); return; }