From 0a34c1d0981c65ebba0551904ad598704036d725 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 4 Sep 2026 07:19:12 -0700 Subject: The carousel stutter is the ark history memo re-cooling on a timer: rebuilding it costs ~60ms (sort + dedupe + gift resolve + secp256k1), and its 1.5s TTL meant an unhurried flick always hit a cold rebuild, stuttering the slide's tail — 'warms up if I keep going fast, cold if I pause, refresh reproduces' is the classic TTL-expiry signature. Now keyed on a state revision (_save bumps state._rev) so it's reused until the data actually changes and never re-cools between flicks. Diagnostics still on to confirm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MrkLsNScXe9b6BviUSdmMr --- src/ark/manager.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ark/manager.js') diff --git a/src/ark/manager.js b/src/ark/manager.js index a443370..471c4e0 100644 --- a/src/ark/manager.js +++ b/src/ark/manager.js @@ -161,6 +161,10 @@ export class ArkManager { } _save() { + // a monotonic revision that bumps on every state change — lets memoized + // derivations (history build, etc.) invalidate exactly when the data + // changes instead of on a timer that re-cools between interactions + this.state._rev = (this.state._rev || 0) + 1; this.storage.save(this.state); this.onUpdate(this); } -- cgit v1.2.3