Skip to content

Conversation

@llastflowers
Copy link
Contributor

@llastflowers llastflowers commented Jun 5, 2025

Closes https://github.com/github/primer/issues/5118

Changelog

New

  • Detect mobile keyboard visibility by detecting viewport size changes when keyboard appears
  • Calculate keyboard height with original viewport height - reduced viewport height when the keyboard is visible
  • Adjust panel height based on keyboard height to keep footer above keyboard and always visible

(This approach made more sense to me vs. trying to reposition the footer itself to stick to the keyboard, because it seemed a lot simpler to implement, generally less issue-prone, easier to understand the code, required fewer changes, seems more likely to work across different browsers and devices, and the UI interactions are basically exactly the same, if not a bit cleaner. That said, I'm open to feedback ofc!)

Changed

Panel now automatically resizes when mobile keyboard is visible so that content including the footer is not hidden behind the keyboard.

Safari on iOS:

Safari screen before interaction     Safari screen when keyboard appears     Safari screen after keyboard is dismissed

Chrome on iOS:

Chrome screen before interaction     Chrome screen when keyboard appears     Chome screen after keyboard is dismissed

Removed

Removed one line from the corresponding CSS module that I noticed was making the footer button slightly off-center. If this was intentional lmk and I can revert

Button spacing before     Button spacing after

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

  • Test in Storybook on mobile with the following feature flags enabled (or maybe just try this link?), and tap "Open canvas in new tab" so that Storybook UI doesn't interfere with the functionality

Feature flags screenshot from Storybook

  • @tylerjdev offered to test on his Android mobile phone for good measure (ty!)
  • Please let me know if the repositioning movement of the footer when the keyboard opens appears too abrupt/messy in testing. I can probably add a delay or transition to make it look a bit smoother if needed 😅

References

https://developer.mozilla.org/en-US/docs/Web/API/Visual_Viewport_API
https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport

Merge checklist

@changeset-bot
Copy link

changeset-bot bot commented Jun 5, 2025

🦋 Changeset detected

Latest commit: daba652

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

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

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-actions
Copy link
Contributor

github-actions bot commented Jun 5, 2025

👋 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!

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jun 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jun 5, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 94.75 KB (+0.26% 🔺)
packages/react/dist/browser.umd.js 94.91 KB (+0.13% 🔺)

@github-actions github-actions bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Jun 5, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-6170 June 5, 2025 17:24 Inactive
@github-actions github-actions bot removed the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jun 5, 2025
@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jun 9, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-6170 June 9, 2025 19:28 Inactive
@github-actions github-actions bot removed the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jun 9, 2025
@primer-integration
Copy link

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

@primer-integration
Copy link

🟢 golden-jobs completed with status success.

Copy link
Member

@francinelucca francinelucca left a comment

Choose a reason for hiding this comment

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

🧑‍🍳💋

Copy link
Member

@TylerJDev TylerJDev left a comment

Choose a reason for hiding this comment

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

Looks good! Nice work ✨

Left one comment, but non-blocking!

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jun 11, 2025
@github-actions

This comment was marked as resolved.

Copy link
Member

@TylerJDev TylerJDev left a comment

Choose a reason for hiding this comment

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

LGTM! ✨

@github-actions github-actions bot temporarily deployed to storybook-preview-6170 June 11, 2025 16:54 Inactive
@llastflowers llastflowers added this pull request to the merge queue Jun 11, 2025
@llastflowers llastflowers removed this pull request from the merge queue due to a manual request Jun 11, 2025
@jonrohan jonrohan enabled auto-merge June 11, 2025 18:32
@github-actions github-actions bot removed the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jun 11, 2025
@github-actions
Copy link
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 github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jun 11, 2025
@jonrohan jonrohan added this pull request to the merge queue Jun 11, 2025
Merged via the queue into main with commit e4f0fc6 Jun 11, 2025
33 of 34 checks passed
@jonrohan jonrohan deleted the llastflowers/5118/SelectPanel-pin-footer branch June 11, 2025 18:57
@primer primer bot mentioned this pull request Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: SelectPanel integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm primer-quality react

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants