Skip to content

fix(desktop): memoize sidebar flatRows and row renderers (#75714 salvage) - #77328

Merged
kshitijk4poor merged 3 commits into
NousResearch:mainfrom
kshitijk4poor:salvage/75714-sidebar-memo
Aug 3, 2026
Merged

fix(desktop): memoize sidebar flatRows and row renderers (#75714 salvage)#77328
kshitijk4poor merged 3 commits into
NousResearch:mainfrom
kshitijk4poor:salvage/75714-sidebar-memo

Conversation

@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Salvage of #75714 by @StanleyStetson — both commits cherry-picked to preserve authorship (rebased clean), plus one lint follow-up commit.

Context — what this changes for users

Sidebar scrolling jittered because every render handed VirtualSessionList a FRESH flatRows array — same data, new identity — re-rendering the whole virtualized tree for nothing (the desktop guide's "preserve reference identity on no-ops" invariant). Memoizing flatRows (and the row renderers) keeps the reference stable across unrelated re-renders; the PR's second commit adds tests that pin exactly this (identity stable across re-render, changed when sessions actually change — verified regression-sensitive: removing the memo or either dep fails them).

Review & verification (real vitest runs)

  • Dep-array audit: all 5 memo/callback arrays complete against their captured variables (flatRows: [dateGrouped, displayEntries]; renderRow: all 9 captured handlers/values — no stale-handler risk).
  • Comparator interplay traced: SidebarSessionRow's rowPropsEqual deliberately ignores callback identity, so nothing defeats it; the flatRows useMemo is the piece the tests prove and the perf fix users feel. The useCallback wrappers are inert-but-harmless groundwork (their consumers aren't memo()'d yet) — noted, not blocking.
  • 2/2 tests green, tsc clean; exported VirtualSessionListProps matches the codebase's established *Props export convention (~27 precedents).

Follow-up commit

  • eslint --fix on the new test file (perfectionist/sort-imports would have failed lint CI).

Closes #75714.

StanleyStetson and others added 3 commits August 2, 2026 23:53
…croll jitter (fixes NousResearch#73629)

Fix direction inspired by PR NousResearch#73674 by @drbronson with added Vitest component unit tests.
Review follow-up on the NousResearch#75714 salvage: perfectionist/sort-imports
would fail lint CI; autofixed.
@kshitijk4poor
kshitijk4poor enabled auto-merge (rebase) August 3, 2026 04:23
@kshitijk4poor
kshitijk4poor merged commit 372494f into NousResearch:main Aug 3, 2026
31 checks passed
@kshitijk4poor
kshitijk4poor deleted the salvage/75714-sidebar-memo branch August 5, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants