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

[WIP] Improve programmatic state management of UnderlinePanels #5527

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

Conversation

ddoyle2017
Copy link

@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: 92700fc

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.25 KB (0%)
packages/react/dist/browser.umd.js 104.56 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
@primer-integration
Copy link

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

@primer-integration
Copy link

🟢 golden-jobs completed with status success.

@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: failing Changes in this PR cause breaking changes in gh/gh labels Jan 17, 2025
@ddoyle2017 ddoyle2017 marked this pull request as ready for review January 17, 2025 17:08
@ddoyle2017 ddoyle2017 requested a review from a team as a code owner January 17, 2025 17:08
@ddoyle2017 ddoyle2017 requested a review from mperrotti January 17, 2025 17:08
@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 17, 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 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 17, 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!

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.

3 participants