Skip to content

SelectPanel: Make panel full screen on narrow screens with Save and optional Cancel button - #5761

Merged
siddharthkp merged 30 commits into
mainfrom
selectpanel-responsive-save-button
Mar 20, 2025
Merged

SelectPanel: Make panel full screen on narrow screens with Save and optional Cancel button#5761
siddharthkp merged 30 commits into
mainfrom
selectpanel-responsive-save-button

Conversation

@siddharthkp

@siddharthkpsiddharthkp commented Mar 11, 2025

Copy link
Copy Markdown
Member

Note


  • Closeshttps://github.com/github/primer/issues/4109
  • Implements Save button on narrow screens which calls onClose('click-outside') to simulate wide screen behavior
  • Accept onCancel prop that renders a Cancel button on narrow which calls onClose('escape')
narrow-selectpanel.mov

With onCancel prop:

selectpanel-cancel.mov

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

@changeset-bot

changeset-botBot commented Mar 11, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 12fb61b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
NameType
@primer/reactPatch

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

@github-actionsgithub-actionsBot added the staff Author is a staff member label Mar 11, 2025
@siddharthkp
siddharthkp changed the base branch from main to responsive-anchored-overlayMarch 11, 2025 16:03
@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 Mar 11, 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!

@siddharthkpsiddharthkp changed the title SelectPanel: Make panel full screen on narrow screensSelectPanel: Make panel full screen on narrow screens with Save buttonMar 11, 2025
@github-actions

github-actionsBot commented Mar 11, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js106.09 KB (+0.18% 🔺)
packages/react/dist/browser.umd.js106.48 KB (+0.32% 🔺)

@siddharthkpsiddharthkp self-assigned this Mar 11, 2025
@github-actions
github-actionsBot requested a deployment to storybook-preview-5761 March 11, 2025 16:08 Abandoned
@siddharthkpsiddharthkp added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Mar 11, 2025
@github-actionsgithub-actionsBot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Mar 11, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5761 March 11, 2025 16:22 Inactive
@github-actionsgithub-actionsBot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Mar 11, 2025

@langermanklangermank 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.

VRT 👍

@francineluccafrancinelucca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking great! Have a few comments, suggestions.
Also can we make sure to merge https://github.com/github/github/pull/367564 before this as to not break main? 🙏

{
"name": "onCancel",
"type": "() => void",
"description": "(Narrow screens) Callback when the user hits cancel or close",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do we expect this to be used in modal as well? If so maybe we need to correct this verbiage

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

We do, but we don't have that yet. Can update once we have modal.

It's going to be a strange description: Narrow screens or variant=modal 😅

Comment on lines +567 to +581
sx={
enabled
? undefined
: {
// .responsiveFooter
display: ['flex', 'flex', 'none', 'none'],
gap: 'var(--stack-gap-condensed)',
justifyContent: 'right',
padding: 3,
// .Footer
borderTop: 'var(--borderWidth-thin) solid',
borderTopColor: 'var(--borderColor-default)',
}
}
className={enabled ? clsx(classes.Footer, classes.ResponsiveFooter) : undefined}

@francineluccafrancineluccaMar 18, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if this is net new code can we code it with (only) css modules from the get-go? 🙏

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Oh we get to that now? I thought we can't yet because it's still behind a feature flag that we'd want the ability to roll back?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should be able to go all in with CSS for new features. The only precaution with having the flag fall back to styled components is that the new styles don't match the old ones. In this case there is nothing to compare the new styles to

Comment threadpackages/react/src/SelectPanel/SelectPanel.tsx Outdated
@siddharthkp

Copy link
Copy Markdown
MemberAuthor

Also can we make sure to merge https://github.com/github/github/pull/367564 before this as to not break main? 🙏

Absolutely. Idk why I thought we can merge them in any order, I'm rusty from my break 😅

@francineluccafrancinelucca mentioned this pull request Mar 18, 2025
13 tasks
@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 Mar 18, 2025
@github-actions

This comment was marked as outdated.

@github-actionsgithub-actionsBot added integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Mar 18, 2025
@github-actions

This comment was marked as outdated.

@github-actions
github-actionsBottemporarily deployed to storybook-preview-5761 March 18, 2025 20:22 Inactive
@github-actionsgithub-actionsBot added integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Mar 18, 2025
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actions

This comment was marked as resolved.

@francineluccafrancinelucca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

✨ yayy, looks great!
smaaaaall nit: if we could add onCancel to our singleSelect story so that the close button shows I think that'd be great. Just realized there's no way to close the panel without changes 🙏
image

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

1 similar comment
@github-actions

This comment was marked as duplicate.

@primer-integration

Copy link
Copy Markdown

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/367822

@primer-integration

Copy link
Copy Markdown

🟢 golden-jobs completed with status success.

@primerprimerBot mentioned this pull request Mar 20, 2025
@siddharthkpsiddharthkp mentioned this pull request Mar 28, 2025
13 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: passingChanges in this PR do NOT cause breaking changes in gh/ghstaffAuthor is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@siddharthkp@francinelucca@emilybrick@jonrohan@langermank