Skip to content

Llastflowers/5118/select panel unhide footer - #6170

Merged
jonrohan merged 22 commits into
mainfrom
llastflowers/5118/SelectPanel-pin-footer
Jun 11, 2025
Merged

Llastflowers/5118/select panel unhide footer#6170
jonrohan merged 22 commits into
mainfrom
llastflowers/5118/SelectPanel-pin-footer

Conversation

@llastflowers

@llastflowersllastflowers commented Jun 5, 2025

Copy link
Copy Markdown
Contributor

Closeshttps://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 interactionSafari screen when keyboard appearsSafari screen after keyboard is dismissed

Chrome on iOS:

Chrome screen before interactionChrome screen when keyboard appearsChome 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 beforeButton 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

changeset-botBot commented Jun 5, 2025

Copy link
Copy Markdown

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

@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 Jun 5, 2025
@github-actions

github-actionsBot commented Jun 5, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js94.75 KB (+0.26% 🔺)
packages/react/dist/browser.umd.js94.91 KB (+0.13% 🔺)

@github-actionsgithub-actionsBot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Jun 5, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6170 June 5, 2025 17:24 Inactive
@github-actionsgithub-actionsBot 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-actionsgithub-actionsBot 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
Comment threadpackages/react/src/SelectPanel/SelectPanel.tsx Outdated

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

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
Copy Markdown
ContributorAuthor

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-actionsgithub-actionsBot 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

This comment was marked as duplicate.

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

This comment was marked as duplicate.

@llastflowers
llastflowersforce-pushed the llastflowers/5118/SelectPanel-pin-footer branch from a8454eb to 22e9b8aCompareJune 9, 2025 19:14
@github-actionsgithub-actionsBot 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
@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-actionsgithub-actionsBot 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
@primer-integration

Copy link
Copy Markdown

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

@primer-integration

Copy link
Copy Markdown

🟢 golden-jobs completed with status success.

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

🧑‍🍳💋

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

Looks good! Nice work ✨

Left one comment, but non-blocking!

Comment threadpackages/react/src/SelectPanel/SelectPanel.tsx Outdated
@github-actions

This comment was marked as resolved.

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

LGTM! ✨

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

@primerprimerBot mentioned this pull request Jun 11, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: SelectPanelintegration-tests: passingChanges in this PR do NOT cause breaking changes in gh/ghintegration-tests: recommendedThis change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpmprimer-qualityreact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@llastflowers@joshblack@hectahertz@TylerJDev@francinelucca@jonrohan