Skip to content

perf(web): workspace switches leave off-screen chats alone - #31615

Closed
flamboh wants to merge 6614 commits into
pingdotgg:maria/redesign/6-workspace-panesfrom
flamboh:t3/redesign-fix-switch-slide-stalls
Closed

flamboh wants to merge 6614 commits into
pingdotgg:maria/redesign/6-workspace-panesfrom
flamboh:t3/redesign-fix-switch-slide-stalls

Conversation

@flamboh

@flamboh flamboh commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Note

🤖 Claude Opus 5.5 on behalf of Oliver

Fix for the redesign stack, targets layer 6 (#28845).

Problem

Every workspace switch (Ctrl+Alt+U/I) re-rendered every mounted chat, even chats in workspaces the switch never touches. With four chat workspaces, one warmed switch ran ChatView 9 times and ChatComposer 11 times.

There were two causes:

  • The pane look flips for every chat. The slide gives panes their split look, and that split flag changed for every chat's pane state when the slide began and again when it landed, including chats not on screen.
  • The route flips a window-wide flag. Each switch changes the URL, so AppSidebarLayout's window-wide "suppress panel animations" flag turned on, then off two frames later. Every chat already has its own copy of that flag. But React's lazy context propagation still called every ChatView and ChatComposer that reads it, both times.

Fix

  • A chat that isn't on screen keeps a steady pane state: no split look, not narrow. It now only re-renders when it comes on screen, which re-renders it anyway.
  • Chats read only their own panel-animation flag. They no longer subscribe to the window-wide one, so its flips stop reaching them. Everything outside chats reads the window flag as before.

Numbers

Dev build with the React Compiler on, headless Chromium at 1280×800, four Replay chat workspaces (all visited) plus an empty one. Render counts come from a React commit hook. All 8 warmed switches gave the same counts:

Per switch Layer 6 This PR
ChatView renders 9 5 (only the two chats in the switch)
ChatComposer renders 11 7

The savings grow with the number of chats outside the switch. Rapid bursts improve less, because most mounted chats join the slide.

Before / after

What to look for: before, workspace shortcuts cycle through four Replay chats; after, the same sequence still works with the off-screen chat change.

https://gh-file-drop-api-prod-galwoqjslzlnws6s.oliver-boorstein.workers.dev/f/1a909bfdd8b3fcbc/31615-1x.mp4

Motion slowed 5× in the page:

https://gh-file-drop-api-prod-galwoqjslzlnws6s.oliver-boorstein.workers.dev/f/e1fd2a5cd40a6499/31615-5x.mp4

These development recordings verify shortcut behavior. They do not establish the render counts above.

Validation

  • Render counts above, measured in one isolated dev server.
  • No new test: the change is which components re-render, with no new logic.

Claude Opus 5.5 (Claude Code)

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants