Skip to content

(reverted) SelectPanel: Prepare for non-anchored variants #5230

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

Merged
merged 5 commits into from
Nov 8, 2024

Conversation

siddharthkp
Copy link
Member

@siddharthkp siddharthkp commented Nov 5, 2024


Replace AnchoredOverlay with Overlay + useAnchoredPosition to prepare for variants that would skip anchored position

need to check

  • are integration tests passing?
  • are the props okay? (were some props going to anchoredoverlay that need to be re-routed)
  • are the types okay? (same as props)
  • is the rendered dom the same?
    • button is missing tabIndex="0" and id, both of these are okay, as we don't need to do this forwarding anymore
    • check if data-has-active-descendant is still correct, it is
  • is the rendered a11y tree the same
  • check if footer focus works

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

@siddharthkp siddharthkp self-assigned this Nov 5, 2024
Copy link

changeset-bot bot commented Nov 5, 2024

🦋 Changeset detected

Latest commit: f0be480

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 github-actions bot added the staff Author is a staff member label Nov 5, 2024
Copy link
Contributor

github-actions bot commented Nov 5, 2024

👋 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 Nov 5, 2024
@github-actions github-actions bot temporarily deployed to storybook-preview-5230 November 5, 2024 11:40 Inactive
Copy link
Contributor

github-actions bot commented Nov 5, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 98.71 KB (+0.14% 🔺)
packages/react/dist/browser.umd.js 99.13 KB (+0.24% 🔺)

@primer-integration
Copy link

primer-integration bot commented Nov 5, 2024

🔴 golden-jobs completed with status failure.

@siddharthkp siddharthkp marked this pull request as ready for review November 7, 2024 11:20
@siddharthkp siddharthkp requested a review from a team as a code owner November 7, 2024 11:20
@siddharthkp siddharthkp requested review from mperrotti and broccolinisoup and removed request for mperrotti November 7, 2024 11:20
@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT 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 Nov 7, 2024
@siddharthkp
Copy link
Member Author

@broccolinisoup Verified everything works well, ready for review

@@ -56,11 +57,6 @@ function isMultiSelectVariant(
return Array.isArray(selected)
}

const focusZoneSettings: Partial<FocusZoneHookSettings> = {
// Let FilteredActionList handle focus zone
disabled: true,
Copy link
Member Author

Choose a reason for hiding this comment

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

Note fore reviewer: We no longer need this block, we simply don't add a focusZone now. (we still add focusTrap)

@@ -172,10 +219,13 @@ export function SelectPanel({
})
}, [onClose, onSelectedChange, items, selected])

const inputRef = React.useRef<HTMLInputElement>(null)
Copy link
Member Author

Choose a reason for hiding this comment

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

Note for reviewer: inputRef still exists, it's just declared sooner

const inputRef = React.useRef<HTMLInputElement>(null)
const focusTrapSettings = {
/** Focus trap */
useFocusTrap({
Copy link
Member Author

@siddharthkp siddharthkp Nov 7, 2024

Choose a reason for hiding this comment

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

Note fore reviewer: Adding missing focus trap from AnchoredOverlay. The new keys are passed on what AnchoredOverlay used to do

While it's not possible to Tab out of the filter input to outside the panel, it is possible to Tab to a footer button and then out of the panel, that's why we still need focus trap

Copy link
Member

@broccolinisoup broccolinisoup left a comment

Choose a reason for hiding this comment

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

Looks great! 🎉

@broccolinisoup broccolinisoup added this pull request to the merge queue Nov 8, 2024
Merged via the queue into main with commit dce754b Nov 8, 2024
43 checks passed
@broccolinisoup broccolinisoup deleted the selectpanel-use-anchored-position branch November 8, 2024 08:45
@primer primer bot mentioned this pull request Nov 8, 2024
@primer-integration
Copy link

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

@github-actions github-actions bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh labels Nov 8, 2024
siddharthkp added a commit that referenced this pull request Nov 8, 2024
github-merge-queue bot pushed a commit that referenced this pull request Nov 8, 2024
@siddharthkp siddharthkp changed the title SelectPanel: Prepare for non-anchored variants (reverted) SelectPanel: Prepare for non-anchored variants Nov 11, 2024
siddharthkp added a commit that referenced this pull request Nov 11, 2024
@siddharthkp siddharthkp restored the selectpanel-use-anchored-position branch November 11, 2024 19:10
@siddharthkp siddharthkp deleted the selectpanel-use-anchored-position branch November 11, 2024 19:16
github-merge-queue bot pushed a commit that referenced this pull request Nov 12, 2024
)

* Revert "Revert "SelectPanel: Prepare for non-anchored variants (#5230)" (#5255)"

This reverts commit 64802f1.

* Revert "tiny formatting to make it easier to review"

This reverts commit f0be480.

* different way of writing the same thing
siddharthkp added a commit that referenced this pull request Nov 13, 2024
@siddharthkp siddharthkp mentioned this pull request Mar 27, 2025
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: failing Changes in this PR cause breaking changes in gh/gh staff Author is a staff member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants