镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

perf(sidebar): subscribe to selected live and list facts - #1966

Merged
kalvinnchau merged 1 commit into
mainfrom
peon/sidebar-selectors
Oct 31, 2026
Merged

kalvinnchau merged 1 commit into
mainfrom
peon/sidebar-selectors

Conversation

@kalvinnchau

@kalvinnchau kalvinnchau commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

The sidebar, profile button and sidebar startup no longer re-render on every message, live head update and preview.

Each subscribed to a whole snapshot that the store replaces on unrelated changes:

  • ScopedSidebar read the Solo navigation snapshot for its title and the channel list for the conversation's destination. Solo regions are rebuilt on every message, and the list on every preview.
  • ProfileButton read the live snapshot for its roster and status, and useSidebarStartup read it for the roster state. Live heads change on every message and prefetch.

Each now selects only the fact it reads: the Solo title, the conversation's destination, the roster state and the live status. All of these are strings or stable references, so useSyncExternalStore skips the render when they are unchanged. The profile refresh effect keeps the same dependency values.

Blox workstations, main 561265d against this change: 5 Linux and 5 macOS, production builds, Playwright WebKit 26.6 and Chromium 153, 100 channels with 10 tabs, 200 history rows and 100 thread replies. Each machine ran every cell once per variant, interleaved with three other candidate changes.

Medians of 5 runs over a 20 s idle window with traffic (20 messages, 79 typing/liveness events):

Linux before Linux after Linux Δ macOS before macOS after macOS Δ
WebKit, background traffic: frame overrun (ms) 669 625 -7% 1381 1318 -5%
WebKit, background traffic: frames over 50 ms 1 0 -1 1 2 +1
WebKit, background traffic: p99 frame (ms) 37 35 -5% 26 25 -4%
WebKit, open-channel traffic: frame overrun (ms) 301 291 -3% 1442 1392 -3%
WebKit, open-channel traffic: frames over 50 ms 0 1 +1 2 2 +0
WebKit, open-channel traffic: p99 frame (ms) 26 25 -4% 25 26 +4%
Chromium, background traffic: script (ms) 180 164 -9% 324 309 -4%
Chromium, background traffic: task (ms) 931 900 -3% 2247 2270 +1%
Chromium, open-channel traffic: script (ms) 187 172 -8% 318 304 -4%
Chromium, open-channel traffic: task (ms) 746 709 -5% 1896 1873 -1%

Repeated switch latency over 12 switches per run, 5 runs (55 samples):

Linux before Linux after Linux Δ macOS before macOS after macOS Δ
WebKit, background traffic: switch p50 (ms) 434 435 +0% 129 128 -1%
WebKit, open-channel traffic: switch p50 (ms) 521 515 -1% 130 130 +0%
Chromium, background traffic: switch p50 (ms) 125 125 -0% 77 75 -3%
Chromium, background traffic: script per switch (ms) 106 103 -3% 62 61 -3%
Chromium, open-channel traffic: switch p50 (ms) 126 125 -1% 75 77 +2%
Chromium, open-channel traffic: script per switch (ms) 109 106 -3% 62 62 -0%

Switch latency is unchanged (p50 within 3%), and keystroke, sidebar hover and Tab focus to frame stay within 2 ms.

In a later round with the same setup, this change stacked on #1967 lowered Chromium idle script by 8% on Linux (176 → 162 ms) and 5% on macOS (332 → 314 ms), and script per switch by 5% and 6%.

Validation:

  • useSidebarStartup.test.tsx: a new test checks that a live heads change does not render the hook again, while a roster change does. It fails on main and passes with this change.
  • pnpm check, and Vitest for src/app/shell and src/bundled/channels (1128/1128). Full Vitest: 13,941 passed; browser-host/project-git.test.mjs failed once under full-suite load and passes alone.
  • Playwright in Chromium and WebKit: navigation-sidebar, sidebar-reveal, solo-navigation, solo-rename, account-profile, startup (94 passed).

🤖 Generated with Claude Code

the sidebar, profile button and sidebar startup subscribed to whole live,
solo navigation and channel list snapshots, which are replaced on every
message, head update and preview. select only the facts they read: the
solo title, the conversation's destination, the roster state and the
live status.

Co-authored-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
@kalvinnchau
kalvinnchau marked this pull request as ready for review October 30, 2026 14:55
@kalvinnchau
kalvinnchau requested a review from a team as a code owner October 30, 2026 14:55

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Star Lord’s automated source review via Wes’s account, integrating independent Rocket, Mantis and Groot review.

No actionable findings in the four-file change and its affected call paths. The selected values preserve Solo title/destination updates, profile-refresh inputs, startup readiness and independently subscribed recovery controls. The existing stores supply stable roster references and primitive selector results; the added regression test checks that heads-only updates do not rerender the startup hook.

Reviewed head: 7dc7e67
Base: 561265d

Source-only: no tests, builds or app execution were performed. The PR’s performance measurements and test results are author-reported, not independently reproduced here; native behavior, rendered focus/accessibility and human acceptance remain unverified. Public PR description and commit metadata were inspected; the description contains no attached images. This COMMENT is not an approval or merge authorization.

@kazemek21 kazemek21 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kyle reviewed this PR and the Nexus review-tracker notes and approves with no comments.

Posted by Codex (gpt-6.1-sol) on behalf of kylez.

@kalvinnchau
kalvinnchau merged commit fbb9dbd into main Oct 31, 2026
37 checks passed
@kalvinnchau
kalvinnchau deleted the peon/sidebar-selectors branch October 31, 2026 17:08
shellz-n-stuff added a commit that referenced this pull request Oct 31, 2026
Picks up the month-boundary StatusEditor test fix (#2064).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* origin/main: (56 commits)
  perf(sidebar): subscribe to selected live and list facts (#1966)
  feat(desktop): align the sign-in callback page with web branding (#2038)
  Show linked PRs in Solo headers and move idle huddles to Chat actions (#1968)
  feat(messages): mark edited messages with "(edited)" (#2020)
  feat(desktop): bundle the buzz CLI in every package (#2027)
  feat(plugins): open a plugin page from buzz://plugin links (#2053)
  feat(plugins): managed plugin sources (#2052)
  test(browser): prevent sampled clock pause races (#1955)
  test: fix month-boundary and Sonner mount races in StatusEditor and RelayStaff tests (#2064)
  test: stop tests leaving temp dirs and a flake-check fixture behind (#1977)
  fix(messages): release Virtua's held range when scrolling stops (#2032)
  test(mcp): allow protection checks in bundled help fixture (#2061)
  fix(emoji): recover transient image failures without reopening chats (#2000)
  test: wait for dialog focus, reach a reading position, re-sign pair() (#1975)
  feat(plugins): sign builderlab in through the native fi session in fi builds (#1461)
  feat(agents): offer bundled Buzz help (#2033)
  fix(github): show pull request status for anchors and subpages (#2055)
  fix(dialogs): focus safe controls and task inputs (#2021)
  fix(composer): truncate workspace names at narrow widths (#2043)
  AIDA-2287: Refresh public channel search incrementally (#2023)
  ...

Signed-off-by: Alex Rosenzweig <arosenzweig@squareup.com>
morgmart added a commit that referenced this pull request Oct 31, 2026
…isibility

* origin/main: (23 commits)
  feat(profiles): show NIP-FI verified names (BUZZ-433) (#2005)
  feat(identity): sign in to the organization when Buzz opens (#2086)
  perf(identity-names): stop rerunning name policy for live member churn (#2092)
  fix(sidebar): keep the channel drag preview under the pointer (#2019)
  fix(identity): use xyz.block.buzz.desktop federated-session keychain service (#2094)
  perf(relay): read each channel's remote access once per accepted batch (#2091)
  fix(styles): keep page status :has() on each rule's subject (#2081)
  fix(navigation): show a notice for invalid deep links (#2054)
  fix(messages): preserve held readers through equal-height resizes (#1963)
  perf(sidebar): subscribe to selected live and list facts (#1966)
  feat(desktop): align the sign-in callback page with web branding (#2038)
  Show linked PRs in Solo headers and move idle huddles to Chat actions (#1968)
  feat(messages): mark edited messages with "(edited)" (#2020)
  feat(desktop): bundle the buzz CLI in every package (#2027)
  feat(plugins): open a plugin page from buzz://plugin links (#2053)
  feat(plugins): managed plugin sources (#2052)
  test(browser): prevent sampled clock pause races (#1955)
  test: fix month-boundary and Sonner mount races in StatusEditor and RelayStaff tests (#2064)
  test: stop tests leaving temp dirs and a flake-check fixture behind (#1977)
  fix(messages): release Virtua's held range when scrolling stops (#2032)
  ...

# Conflicts:
#	src/bundled/channels/ChannelMemberAvatars.tsx
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.

3 participants