Uh oh!
There was an error while loading. Please reload this page.
Optimize MessagesTimeline work row stability - #2527
Conversation
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
juliusmarminge
commented
May 6, 2026
@cursor can we use |
Replaced the hand-rolled
|
Replace hand-rolled areWorkGroupsUnchanged with Equal.equals from effect/Equal, which provides structural equality for plain objects and arrays in Effect v4. This removes custom comparison code in favor of the library primitive. Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
ApprovabilityVerdict: Approved Small optimization change that uses deep equality instead of reference equality for comparing grouped entries, improving memoization stability. The change is self-contained with a corresponding test. You can customize Macroscope's approvability policy. Learn more. |
Uh oh!
There was an error while loading. Please reload this page.
Brings in: server CLI submodule split (pingdotgg#2545), process/trace diagnostics views (pingdotgg#2532), JetBrains editor support (pingdotgg#2475), MessagesTimeline render optimizations (pingdotgg#2527, pingdotgg#2498), git/terminal test stabilization (pingdotgg#2540), keybindings settings editor (pingdotgg#2533), and provider update advisories (pingdotgg#2312). Conflict resolutions: - packages/contracts/src/settings.ts: kept aa's diffFontFamily and terminalFontFamily alongside upstream's dismissedProviderUpdateNotificationKeys. - apps/desktop/src/clientPersistence.test.ts: same shape, fixture mirrors the schema. - apps/web/src/components/settings/SettingsPanels.tsx: kept both import groups (FontPicker from aa, ProviderUpdateLaunchNotification.logic from upstream). - apps/web/src/localApi.test.ts: extended both fixtures with diffFontFamily and terminalFontFamily so the merged ClientSettings shape typechecks against the strict desktop bridge contract. Pre-existing aa typecheck issues fixed at the root so the merge commit is green: - apps/desktop/src/electron.d.ts: declaration-merge "local-fonts" into Electron's Session.setPermissionRequestHandler permission union (the Electron 40 typings omit it even though the runtime supports it). - apps/web/src/components/DiffPanel.tsx: conditionally spread style on Virtualizer instead of passing undefined, satisfying exactOptionalPropertyTypes.
Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>


What Changed
Why
react-doctor flagged MessagesTimeline as a render hot spot, and manual review found work-log rows lost structural sharing because grouped arrays were compared by array identity. A react-scan before/after browser probe showed
WorkGroupSectionrendered once before this fix during an equivalent timeline re-derivation and no longer rendered after the fix.UI Changes
No visual UI changes.
Checklist
Note
Fix
isRowUnchangedto use value equality forworkrowgroupedEntriesIn MessagesTimeline.logic.ts, the
isRowUnchangedfunction previously used strict reference equality (===) to comparegroupedEntriesonworkrows. This caused rows to be considered changed even when the arrays had identical content but were different instances — a common outcome when timeline derivations recompute grouped arrays.The fix replaces the reference check with
Equal.equalsfromeffect/Equal, so structurally equivalentgroupedEntriesarrays now correctly mark the row as unchanged and reuse the existing row reference.Macroscope summarized 4646c2a.
Note
Low Risk
Low risk: changes only affect memoization/equality checks for
worktimeline rows and add a regression test; no data handling or auth logic touched.Overview
Improves
MessagesTimelinerow stability by treatingworkrows as unchanged when theirgroupedEntriesarrays are equivalent, even if re-derived as new array instances (switches comparison toEqual.equals).Adds a regression test ensuring
computeStableMessagesTimelineRowsreuses priorworkrow objects across equivalent derivations to avoid unnecessary re-renders.Reviewed by Cursor Bugbot for commit 4646c2a. Bugbot is set up for automated code reviews on this repo. Configure here.