Skip to content

Llastflowers/5118/select panel unhide footer #6170

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

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

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

Copy link

changeset-bot bot commented Jun 5, 2025

🦋 Changeset detected

Latest commit: 22e9b8a

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

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
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.84 KB (+0.21% 🔺)

@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 temporarily deployed to storybook-preview-6170 June 6, 2025 18:37 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 6, 2025
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.

This is looking pretty good. Noticed some weird behavior on zoom. Wondering if there's anything we can do about that 👀 . Also I like @TylerJDev suggestion about only doing recalculations when the panel is open.

ScreenRecording_06-09-2025.11-40-42_1.mov

…only if height changes independently (keyboard)
@llastflowers
Copy link
Contributor Author

This is looking pretty good. Noticed some weird behavior on zoom. Wondering if there's anything we can do about that 👀 . Also I like @TylerJDev suggestion about only doing recalculations when the panel is open.

ScreenRecording_06-09-2025.11-40-42_1.mov

Thanks for calling this out! I'm adding an additional check for viewport scale changes, so this resizing/repositioning stuff won't happen on scale change (like when a user zooms), only height change.

@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

This comment was marked as duplicate.

@github-actions github-actions bot temporarily deployed to storybook-preview-6170 June 9, 2025 17:44 Inactive
@github-actions github-actions bot 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 Jun 9, 2025

This comment was marked as duplicate.

@llastflowers llastflowers force-pushed the llastflowers/5118/SelectPanel-pin-footer branch from a8454eb to 22e9b8a Compare June 9, 2025 19:14
@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
Copy link
Contributor

github-actions bot commented Jun 9, 2025

👋 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 9, 2025
@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.

🧑‍🍳💋

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 primer-quality react
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants