Skip to content

Revert "Remove Box usage and sx prop from PageLayout (#6872)" - #6940

Merged
TylerJDev merged 1 commit into
mainfrom
chore/revert-6872
Oct 3, 2025
Merged

Revert "Remove Box usage and sx prop from PageLayout (#6872)"#6940
TylerJDev merged 1 commit into
mainfrom
chore/revert-6872

Conversation

@francinelucca

Copy link
Copy Markdown
Member

This reverts commit 4e797ef.

This wont play well with our useSlots strategy, reverting and will fix up for next release

Closes #

Changelog

New

Changed

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@francinelucca
francinelucca requested a review from a team as a code ownerOctober 3, 2025 13:45
@francinelucca
francinelucca requested review from Copilot and siddharthkp and removed request for siddharthkpOctober 3, 2025 13:45
@changeset-bot

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a3af68f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actionsgithub-actionsBot added the staff Author is a staff member label Oct 3, 2025

CopilotAI 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.

Pull Request Overview

This PR reverts a previous commit that removed Box usage and the sx prop from PageLayout components. The revert is necessary because the original changes conflict with the useSlots strategy, and the team plans to fix the implementation in a future release.

  • Restores the sx prop to all PageLayout components and subcomponents
  • Re-adds Box/BoxWithFallback usage throughout the PageLayout implementation
  • Reverts CSS module changes that were part of the original removal

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
packages/styled-react/src/index.tsxRestores PageLayout export from @primer/react instead of local implementation
packages/styled-react/src/components/PageLayout.tsxRemoves the entire styled-components wrapper implementation
packages/react/src/PageLayout/PageLayout.tsxRe-adds sx prop support and BoxWithFallback usage across all components
packages/react/src/PageLayout/PageLayout.stories.tsxAdds sx prop to story template
packages/react/src/PageLayout/PageLayout.module.cssRemoves draggable handle CSS classes
packages/react/src/PageLayout/PageLayout.dev.stories.tsxConverts CSS classes to sx prop usage
packages/react/src/PageLayout/PageLayout.dev.stories.module.cssRemoves CSS file entirely
.changeset/gold-geckos-send.mdRemoves changeset for the original breaking change

Comment on lines +281 to +290
<Box
sx={{
position: 'absolute',
inset: '0 -2px',
cursor: 'col-resize',
bg: isDragging || isKeyboardDrag ? 'accent.fg' : 'transparent',
transitionDelay: '0.1s',
'&:hover': {
bg: isDragging || isKeyboardDrag ? 'accent.fg' : 'neutral.muted',
},

CopilotAIOct 3, 2025

Copy link

Choose a reason for hiding this comment

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

The empty fragment wrapper <>...</> around the Box component is unnecessary. The Box can be returned directly without the fragment wrapper.

See below for a potential fix:

 <Box
sx={{
position: 'absolute',
inset: '0 -2px',
cursor: 'col-resize',
bg: isDragging || isKeyboardDrag ? 'accent.fg' : 'transparent',
transitionDelay: '0.1s',
'&:hover': {
bg: isDragging || isKeyboardDrag ? 'accent.fg' : 'neutral.muted',
},
}}
role="slider"
aria-label="Draggable pane splitter"
aria-valuemin={minWidth}
aria-valuemax={maxWidth}
aria-valuenow={currentWidth}
aria-valuetext={`Pane width ${currentWidth} pixels`}
tabIndex={0}
onMouseDown={event => {
if (event.button === 0) {
setIsDragging(true)
onDragStart?.()
}
}}
onKeyDown={event => {
if (
event.key === 'ArrowLeft' ||
event.key === 'ArrowRight' ||
event.key === 'ArrowUp' ||
event.key === 'ArrowDown'
) {
setIsKeyboardDrag(true)
onDragStart?.()
}
}}
onDoubleClick={onDoubleClick}
/>

Copilot uses AI. Check for mistakes.
}}
onDoubleClick={onDoubleClick}
/>
</>

CopilotAIOct 3, 2025

Copy link

Choose a reason for hiding this comment

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

The empty fragment wrapper <>...</> around the Box component is unnecessary. The Box can be returned directly without the fragment wrapper.

See below for a potential fix:

 <Box
sx={{
position: 'absolute',
inset: '0 -2px',
cursor: 'col-resize',
bg: isDragging || isKeyboardDrag ? 'accent.fg' : 'transparent',
transitionDelay: '0.1s',
'&:hover': {
bg: isDragging || isKeyboardDrag ? 'accent.fg' : 'neutral.muted',
},
}}
role="slider"
aria-label="Draggable pane splitter"
aria-valuemin={minWidth}
aria-valuemax={maxWidth}
aria-valuenow={currentWidth}
aria-valuetext={`Pane width ${currentWidth} pixels`}
tabIndex={0}
onMouseDown={event => {
if (event.button === 0) {
setIsDragging(true)
onDragStart?.()
}
}}
onKeyDown={event => {
if (
event.key === 'ArrowLeft' ||
event.key === 'ArrowRight' ||
event.key === 'ArrowUp' ||
event.key === 'ArrowDown'
) {
setIsKeyboardDrag(true)
onDragStart?.()
}
}}
onDoubleClick={onDoubleClick}
/>

Copilot uses AI. Check for mistakes.
@github-actionsgithub-actionsBot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Oct 3, 2025
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@TylerJDev
TylerJDev merged commit aa033b4 into mainOct 3, 2025
44 checks passed
@TylerJDev
TylerJDev deleted the chore/revert-6872 branch October 3, 2025 13:52
francinelucca added a commit that referenced this pull request Oct 3, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommendedThis change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpmstaffAuthor is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@francinelucca@TylerJDev