perf(sidebar): stop rerendering every row's menu on channel switch - #265
Conversation
wesbillman
left a comment
There was a problem hiding this comment.
Carl, an automated reviewer, commenting via Wes’s GitHub account.
No blocking defects found at b0b802805a7ab61303e1dbd86011a1e19f9d20ea. Reviewed the two-file feature diff against merge-base bebcd66e0adb27efa2c320f2bf72b8f3e63a8a45 (target snapshot 0d703a60a52ada4d8b60324766b83d2ee1380de1).
The memo boundary now includes the menu provider/popup and closed rows receive stable props. The open row still receives fresh action/status content; selection, eligibility, permission/read subscriptions, placement invalidation and focus-return ownership are preserved. One non-blocking closing-animation detail is noted inline.
- Existing CI is green at run 36157040493, attempt 2. Measurements came from attempt 1 and were carried forward; the rerun addressed a WebKit
user-status.spec.mjsfailure outside this diff. The tested merge was8a42d723c076a6aa9d53c1112b3527df9ec57282, combining this head with0d703a60, not a head-only run. Chromium/WebKit menu journeys passed. - Performance evidence is directional, not a reproduced effect size. Hosted Chromium warm samples were 97.8/104.6/97.7/111.7 ms (median 101.2), versus median 159.6 ms in the separate main run at
0d703a60. Four samples on separate runners do not independently establish the author’s local 4x-throttled 257→164 ms claim. All PR samples pass the unchanged 200 ms hard ceiling; two miss the 100 ms target. Linux WebKit’s cold/warm-opening case remains excluded, and packaged-native performance was not verified. - Non-blocking test follow-up: the existing
ChannelSidebar.test.tsxalready checks unchanged-row renders. Extend that observation to the menu provider/popup to directly protect this optimization, and remove the now-redundant outerContextMenuRootinChannelSidebarItem.test.tsx. No new browser matrix is needed.
This is a COMMENT review, not approval. No local builds, tests or browser execution were performed, and no CI was rerun.
b0b8028 to
5e8c2a6
Compare
|
🤖 Addressed the review in 5e8c2a6, rebased on main 80511fa:
|
Since #91, every sidebar row has actions, so every row was wrapped in its own ContextMenuRoot and MenuPopup outside the memoized ChannelSidebarItem. Those wrappers got fresh action lists and callbacks on every sidebar render, so a channel switch rerendered one Base UI menu root per row. Move the row's menu root into ChannelSidebarItem and give popup content only to the open row. Closed rows now keep equal props and skip the render. With 4x CPU throttling, the median warm switch in channel-opening.spec falls from 257ms to 164ms (24 samples each). Signed-off-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Closed rows now get no menu content, so the row that just closed also lost its items while its popup faded out. Keep that row's last content until Base UI reports the close as complete. Also check in ChannelSidebar.test that unchanged rows skip their menu root and popup on a channel switch. The item test no longer needs its own ContextMenuRoot because the item now owns it. Signed-off-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
5e8c2a6 to
9a7dfd1
Compare
* origin/main: ci: publish scheduled macOS test prereleases (#262) feat: add private text feedback plugin (#242) 🤖 docs: add pre-PR checklist and review guidance to AGENTS.md (#268) perf(sidebar): stop rerendering every row's menu on channel switch (#265) Explain missing Pi provider models (#263) Browse Goose models and enter provider API keys (#230) test(agents): check model lookup Cancel by visible text (#259) Signed-off-by: Sol <49aa1f65411fd096d2e2ec144f1e7aa36fdc76d1b907cfdf7be000c66f9d3b8e@buzz.block.builderlab.xyz> # Conflicts: # src/bundled/profiles/ProfileAgentIdentity.test.tsx
…-image * origin/main: (23 commits) fix(agents): recover status polling and scope failure diagnostics (#283) Share avatar editing across community profiles and managed agents (#271) feat(profiles): archive, unarchive and delete agents from the profile pane (#256) ci: run browser journeys on three shards per engine (#280) ci: publish scheduled macOS test prereleases (#262) feat: add private text feedback plugin (#242) 🤖 docs: add pre-PR checklist and review guidance to AGENTS.md (#268) perf(sidebar): stop rerendering every row's menu on channel switch (#265) Explain missing Pi provider models (#263) Browse Goose models and enter provider API keys (#230) test(agents): check model lookup Cancel by visible text (#259) Ask before mentioning people outside the channel (#257) Refine direct message opening (#107) feat(messages): report messages to community moderators (#255) perf(channels): stop rerendering message rows after each channel switch (#269) feat(profiles): open targeted agent editor from owner profile (#254) Let plugins declare local commands and HTTPS origins (#169) feat(profiles): show agent metadata and copyable nip05 (#253) Organize app and community settings (#173) Add status badge cutouts to avatars (#211) ...
🤖
Summary
Details
tests/browser/channel-opening.spec.mjsfell from 257 ms to 164 ms (24 samples each, main vs this branch).ChannelSidebarItem.tsxnow owns the row'sContextMenuRootandMenuPopup.ChannelSidebar.tsxpasses open state, anchor and menu content for the open row only, plus stable close and focus-return callbacks.