Repository navigation
Stop restyling the whole right panel on every resize frame - #6511
Merged
ymichael merged 1 commit intoOct 29, 2026
Merged
Conversation
Dragging the right-panel divider wrote the inherited --secondary-swipe-width custom property onto the panel's aside every frame. Chrome restyled all ~535 descendants each time (~15ms per frame), so the drag ran at 30fps while the sidebar drag stayed at 60fps. The aside ignores that variable while resizing, so write it once on release instead. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/optimize-right-panel-resize-performance-thr_x8v94e5p39
branch
October 29, 2026 03:03
This was referenced Nov 3, 2026
mistakeknot
added a commit
to mistakeknot/aleph
that referenced
this pull request
Nov 3, 2026
Sync Aleph to upstream bb 2f5abff (17 commits through get-bb#6511)
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.
Human comments
What was wrong
On every drag frame,
useSecondaryPanelResizeset the inherited custom property--secondary-swipe-widthon the right panel's<aside>. Because descendants inherit custom properties, each write made Chrome recompute styles for the whole panel subtree: about 535 elements, about 15ms per frame. The right-panel drag ran at 30fps, while the sidebar drag, which has no per-frame write like this, stayed at 60fps. While resizing, the aside never reads that variable; it is anchored withright-0.What changed
apps/app/src/components/secondary-panel/useSecondaryPanelResize.ts:onResizeno longer writes--secondary-swipe-widthwhile a pointer drag is active. On release,onDragging(false)writes the final width once, beforeisSecondaryPanelResizingclears, so the aside switches back to the variable at the correct width. Opening, closing, double-click reset, and other non-drag layout changes still write the variable right away.How you verified
useSecondaryPanelResize.test.tsx: it drags a realPanelGrouphandle and checks that the variable stays put mid-drag and holds the final width after release. It fails on the old code and passes now.pnpm exec turbo run test typecheck lint --filter=@bb/apppasses.🤖 Generated with Claude Code