You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yield before the first chunk so cold start doesn't block the initial
paint, and clear stale source on file switch so prior attribution
doesn't flash against the new file's AST on re-navigation.
Copy file name to clipboardExpand all lines: claude-notes/plans/2026-04-15-node-attribution.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,7 +118,7 @@ Minor tweaks to fix build issues under hub-client's stricter TypeScript config:
118
118
119
119
8.**Run-length encoding as the default producer** (`3265de11`) — Automerge history is replayed into a sorted `AttributionRun[]` rather than a per-char `CharAttribution[]`. Realistic batched workloads see 4× faster updates, 5× faster queries, 20× smaller storage, and arbitrary-size bulk inserts don't need the splice-chunking workaround. Numbers below.
120
120
121
-
9.**Cold-start latency tuning**(`d880d643`) — Two small, unambiguous changes to `buildRunListAttribution` / `waitForIdle`: (a) skip the `await waitForIdle()` before the *first* chunk so attribution work begins immediately, and (b) pass `{ timeout: 100 }`to `requestIdleCallback` so the build isn't starved when React is still mounting. A progressive-rendering variant was tried and reverted — partial runs describe an intermediate text state whose byte positions don't align with the current AST, so intermediate paints could briefly show attribution against the wrong bytes.
121
+
9.**Cold-start latency tuning**— The hook returns `null` until the build resolves, so the document renders with no attribution visible and re-renders once the map is ready. Given that, `buildRunListAttribution` now yields via `waitForIdle()` before *every* chunk including the first, letting the initial paint settle before attribution CPU work begins. `waitForIdle` still passes `{ timeout: 100 }`so subsequent chunks aren't starved during sustained activity. An earlier iteration (`d880d643`) skipped the first yield to reduce time-to-attribution, but that made the first chunk block the post-mount paint — reverted in favour of prioritizing initial load over fast attribution. A progressive-rendering variant was tried and reverted — partial runs describe an intermediate text state whose byte positions don't align with the current AST, so intermediate paints could briefly show attribution against the wrong bytes.
0 commit comments