PageLayout: move pane resize viewport clamping to CSS#7848
Conversation
🦋 Changeset detectedLatest commit: 0623106 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-authored-by: mattcosta7 <8616962+mattcosta7@users.noreply.github.com>
Co-authored-by: mattcosta7 <8616962+mattcosta7@users.noreply.github.com>
|
|
A successful canary CI run (i.e., a valid canary version published via the Next steps:
For more details, see this workflow run. |
Fast window resizes were still running JS on every resize tick to keep
--pane-max-widthin sync, which madePageLayoutpane/sidebar updates lag behind the viewport. This change moves the visual clamp into CSS and reduces JS resize work to a single trailing sync for ARIA/state parity.Changelog
New
PageLayoutderives viewport-aware pane ceilings in CSS:--pane-viewport-max--sidebar-viewport-max--page-layout-viewport-width(100dvwwhen supported, fallback to100vw)data-constrain-to-viewportwhen needed.Changed
CSS-first visual clamp
.Pane[data-resizable]and.Sidebar[data-resizable]now use CSSclamp()/min()/max()for viewport-dependent max width.--pane-max-width-diffswitch at1280pxremains the source of truth.Sidebarcontinues to use the constant--sidebar-max-width-diffpath.Trailing-only JS resize sync
data-draggingtoggling.maxPaneWidthcurrentWidthif neededstartTransitionStatic-ish authored width variables
--pane-max-widthis now written as:--pane-widthand--pane-min-widthbehavior stays aligned with the existing drag/persistence code path.Behavioral parity
min/default/maxwidth handlingconstrainToViewportbehavior forSidebarSSR_DEFAULT_MAX_WIDTHRemoved
--pane-max-widthduring window resizeusePaneWidthdata-dragging) in the hookRollout strategy
Testing & Reviewing
PageLayout.module.cssandusePaneWidth.tstogether; the viewport clamp formula now exists in CSS while JS remains responsible for the final post-resize sync.min/default/maxPanecustom max withconstrainToViewport=falseSidebarcustom max withconstrainToViewport=true1280pxMerge checklist