Skip to content
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

Improve programmatic state management of UnderlinePanels #5527

Merged
merged 20 commits into from
Jan 23, 2025

Conversation

ddoyle2017
Copy link
Contributor

@ddoyle2017 ddoyle2017 commented Jan 10, 2025

Closes #4575

Changelog

New

  • Adds an optional onSelect() prop to both UnderlinePanels and UnderlinePanels.Tab. This allows users to define a function that gets called when a tab is selected.

Changed

  • Updated UnderlinePanels to handle updates to tabs and panels within a useEffect() hook. This ensures that the selected tab is updated when the aria-selected attribute changes, as well as keeping prop data fresh.

Removed

  • N/A

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

  • [WIP] Are there other ways to test these changes outside of unit testing?
  • Added unit tests verifying that the onSelect() function is called when a tab is clicked + the selected tab can be managed programmatically via updating the aria-selected prop

Merge checklist

Copy link

changeset-bot bot commented Jan 10, 2025

🦋 Changeset detected

Latest commit: 88d19b6

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 Minor

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 integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jan 10, 2025
Copy link
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!

Copy link
Contributor

github-actions bot commented Jan 10, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 104.53 KB (0%)
packages/react/dist/browser.umd.js 104.91 KB (0%)

@github-actions github-actions bot temporarily deployed to storybook-preview-5527 January 14, 2025 16:21 Inactive
@github-actions github-actions bot 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 Jan 14, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-5527 January 14, 2025 20:32 Inactive
@ddoyle2017 ddoyle2017 self-assigned this Jan 14, 2025
@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 Jan 21, 2025
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 temporarily deployed to storybook-preview-5527 January 21, 2025 19:25 Inactive
@ddoyle2017 ddoyle2017 changed the title [WIP] Improve programmatic state management of UnderlinePanels Improve programmatic state management of UnderlinePanels Jan 22, 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.

Looks great, thanks! Just one small comment on the UnderlinePanels.Tab story

Copy link
Contributor

@mperrotti mperrotti 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 great. Thank you!

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 temporarily deployed to storybook-preview-5527 January 22, 2025 21:52 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 Jan 23, 2025
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 Jan 23, 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 Jan 23, 2025
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 Jan 23, 2025
@ddoyle2017 ddoyle2017 added this pull request to the merge queue Jan 23, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 23, 2025
@ddoyle2017 ddoyle2017 added this pull request to the merge queue Jan 23, 2025
Merged via the queue into main with commit ccc3c99 Jan 23, 2025
42 checks passed
@ddoyle2017 ddoyle2017 deleted the ddoyle2017/update-underlinepanels branch January 23, 2025 17:04
@primer primer bot mentioned this pull request Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants