aboutsummaryrefslogtreecommitdiffstats
path: root/src/features
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-09-04 07:19:12 -0700
committerAdam Soltys <[email protected]>2026-09-04 07:19:12 -0700
commit0a34c1d0981c65ebba0551904ad598704036d725 (patch)
tree86700e99e32e1a78a1bac63b516960f230394e86 /src/features
parentbae8f183e4f7095b027b81c3cc79f55dafbd2bba (diff)
downloadcoinosv3-0a34c1d0981c65ebba0551904ad598704036d725.tar.gz
coinosv3-0a34c1d0981c65ebba0551904ad598704036d725.zip
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
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MrkLsNScXe9b6BviUSdmMr
Diffstat (limited to 'src/features')
-rw-r--r--src/features/ark.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/features/ark.js b/src/features/ark.js
index f846cac..1426592 100644
--- a/src/features/ark.js
+++ b/src/features/ark.js
@@ -3069,16 +3069,16 @@ export function arkFeature(ctx) {
if (sel && sel !== 'spending') return []; // ark movements are the Spending timeline
const s = arkStateNow();
if (!s) return [];
- // Memoized briefly: this rebuilds, sorts, and dedupes the whole
- // movements list plus the accounted-inputs set — fine once, wasteful
- // on every repaint. Movements only change through saves that trigger
- // a render themselves, so a short reuse window costs nothing visible.
- const key = `${(s.movements || []).length}:${(s.actions || []).length}`;
- if (this._histMemo && this._histMemo.key === key && Date.now() - this._histMemo.t < 1500) {
- return this._histMemo.val;
- }
+ // Memoized on the state's REVISION, not a timer. This rebuild sorts and
+ // dedupes every movement, resolves gifts, and touches secp256k1 — ~60ms
+ // cold. A 1.5s TTL used to re-cool it between unhurried flicks, so every
+ // account switch paid the rebuild and stuttered the slide; keyed on _rev
+ // it's reused until the data actually changes (each _save bumps _rev),
+ // and stays warm no matter how slowly the user flicks back and forth.
+ const key = `${s._rev || 0}:${(s.movements || []).length}:${(s.actions || []).length}`;
+ if (this._histMemo && this._histMemo.key === key) return this._histMemo.val;
const val = this._histBuild(s);
- this._histMemo = { key, t: Date.now(), val };
+ this._histMemo = { key, val };
return val;
},
_histBuild(s) {