perf(channels): stop rerendering message rows after each channel switch - #269
Merged
Merged
Conversation
…navigation Each channel switch presents its navigation request in two steps: first without a request, then with it. ChannelsPage built openLink and openMediaReview from the current channel and request, so they changed on the second step. By then the warm timeline rows were already mounted, and every memoized MessageRow rendered again for the new callbacks. Read the shown channel and request from a ref at call time instead, as link panel context already does. With 4x CPU throttling, the median warm switch in channel-opening.spec falls from 193ms to 165ms in the same run (24 samples each). Signed-off-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
loganj
marked this pull request as ready for review
September 25, 2026 17:09
kalvinnchau
approved these changes
Sep 25, 2026
wesbillman
reviewed
Sep 25, 2026
wesbillman
left a comment
Collaborator
There was a problem hiding this comment.
Carl, an automated reviewer, commenting via Wes’s GitHub account.
Post-merge review: real, proportionate optimization; no introduced correctness blocker found. Reviewed 2e24935464c06376aa2706deba01c200ba7d4aa5 against 80511fa86c2543e10447779c451ecfaf4652bff6. Already merged as fff36cc7.
- Causality: navigation presentation is installed in a layout effect after an owner change (
src/app/navigation.ts:120–166). Previously that handoff changed both callback props through the memoized timeline. In an isolated build-time probe of the existing warm-switch journey, substituting the exact base version of the sole changed file produced 83 MessageRow calls across four switches versus 48 with this patch. Callback identities changed in the base variant and stayed stable in the patched variant. This reproduction did not include #265. - Safety: the ref records the committed visible destination, rather than an unfinished render. Existing consumers invoke it synchronously; workspace/channel remounts and existing navigation/session authority checks preserve ownership. An isolated production-broker journey passed Chromium and WebKit: repeated channel visits, correct image/thread targets, keyboard activation and focus restoration, channel links/back, and viewer invalidation on back/forward. Three independent source-review lanes were reconciled with this runtime evidence.
- Limits/follow-up: this proves reduced render work, not the reported 193→165 ms latency magnitude. My one-run-per-variant timings overlap; hosted before/after runners also differ. No committed regression test guards this mechanism, so add a deterministic row-render/callback regression test rather than relying only on the 200 ms ceiling. PR CI passed on rerun; Windows was skipped. Merged-main CI 36165809509 was pending at the checked snapshot. No full-suite rerun or native/live-service validation performed.
The new interaction probe initially expected root text that this viewer intentionally omits; corrected to verify a signed reply and image URL. A WebKit pointer-focus assertion also failed with the base implementation; explicit keyboard activation passes both engines. Neither was an introduced regression. No approval submitted.
cynfria
pushed a commit
that referenced
this pull request
Sep 25, 2026
…sh-pr1 * origin/main: Refine direct message opening (#107) feat(messages): report messages to community moderators (#255) perf(channels): stop rerendering message rows after each channel switch (#269) Signed-off-by: Peppermint Butler <29b529ff43be424db89f51bff58a38cf86942acbffff98a14ce50b38c2a57d8f@buzz.block.builderlab.xyz>
zrmarley
added a commit
that referenced
this pull request
Sep 25, 2026
…-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) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖
Summary
Details
src/bundled/channels/ChannelsPage.tsx. It uses the same ref pattern the file already uses for link panel context (linkContext).tests/browser/channel-opening.spec.mjsfell from 193 ms to 165 ms when measured on top of perf(sidebar): stop rerendering every row's menu on channel switch #265 (24 samples each, same run). Component renders across the test's 4 switches fell from 8,522 to 5,380.