-
Notifications
You must be signed in to change notification settings - Fork 658
refactor(PageLayout): drag/resize performance with inline styles and O(1) CSS selectors #7349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
df64c00
more page layout optimizing
mattcosta7 a1fafe2
organization
mattcosta7 e9f14e7
Add changeset
mattcosta7 7ff9f17
Update changeset
mattcosta7 38705c0
Update changeset with accurate changes
mattcosta7 164e57f
snapshots
mattcosta7 a28253a
update test
mattcosta7 fc284bf
resize
mattcosta7 b569c7a
Apply suggestion from @mattcosta7
mattcosta7 f8ecc3b
remove unused test
mattcosta7 f679bf2
perf: disable transition on drag handle during drag for instant feedback
mattcosta7 1cbbda0
Merge branch 'main' into second-optimization-pass-for-page-layout
mattcosta7 b30a9dd
update snapshots
mattcosta7 b232aa1
perf: add contain-intrinsic-size for content-visibility optimization
mattcosta7 ea160a9
gr snapshots
mattcosta7 19a05e4
Refine PageLayout performance optimizations: improve resize handling …
Copilot 79430bb
Merge branch 'main' into second-optimization-pass-for-page-layout
mattcosta7 77daf97
Update packages/react/src/PageLayout/PageLayout.tsx
mattcosta7 a4f5c3e
Update packages/react/src/PageLayout/PageLayout.tsx
mattcosta7 56db8bd
Update packages/react/src/PageLayout/PageLayout.tsx
mattcosta7 d127f79
Update packages/react/src/PageLayout/PageLayout.tsx
mattcosta7 fd649b4
Update packages/react/src/PageLayout/PageLayout.tsx
mattcosta7 64dbf83
Update packages/react/src/PageLayout/PageLayout.tsx
mattcosta7 ea61584
Remove will-change: width and use actual element height in PageLayout…
Copilot 4fb8c0b
Merge branch 'main' into second-optimization-pass-for-page-layout
mattcosta7 7fb56ef
Refactor PageLayout drag/resize optimizations to use CSS attribute se…
Copilot 5c0533c
Debounce window resize containment cleanup in PageLayout (#7386)
Copilot b1068f2
Update packages/react/src/PageLayout/usePaneWidth.ts
mattcosta7 a8a43ae
Update .changeset/optimized-page-layout-resize.md
mattcosta7 f78cdb1
Apply suggestions from code review
mattcosta7 ad5b3c7
[WIP] WIP address feedback on drag/resize performance in PageLayout (…
Copilot 5009206
[WIP] Update drag/resize performance in PageLayout based on feedback …
Copilot 08207c4
Merge branch 'main' into second-optimization-pass-for-page-layout
mattcosta7 020eed7
Merge branch 'main' into second-optimization-pass-for-page-layout
mattcosta7 545af79
refactor(PageLayout): use contentWrapperRef for drag containment
mattcosta7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| --- | ||
| "@primer/react": patch | ||
| --- | ||
|
|
||
| PageLayout: Optimize drag/resize performance with inline styles and new optimizations | ||
|
|
||
| **Refactored:** | ||
| - Use direct attribute selectors (`.Pane[data-dragging='true']`) instead of descendant selectors for CSS containment (O(1) vs O(n) selector matching) | ||
| - Extract optimization utilities to `paneUtils.ts` | ||
| - Apply drag handle visual feedback via inline styles and CSS variables | ||
|
|
||
| **Added:** | ||
| - `content-visibility: auto` during drag/resize to skip off-screen content rendering | ||
| - rAF throttle for drag updates (one update per frame, latest position wins) | ||
| - Containment during window resize (parity with drag) | ||
|
|
||
| These changes improve style recalculation performance on large DOMs (100k+ nodes) by eliminating descendant selector traversal. |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.