Skip to content

Improve programmatic state management of UnderlinePanels - #5527

Merged
ddoyle2017 merged 20 commits into
mainfrom
ddoyle2017/update-underlinepanels
Jan 23, 2025
Merged

Improve programmatic state management of UnderlinePanels#5527
ddoyle2017 merged 20 commits into
mainfrom
ddoyle2017/update-underlinepanels

Conversation

@ddoyle2017

@ddoyle2017ddoyle2017 commented Jan 10, 2025

Copy link
Copy Markdown
Contributor

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

@changeset-bot

changeset-botBot commented Jan 10, 2025

Copy link
Copy Markdown

🦋 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
NameType
@primer/reactMinor

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

github-actionsBot commented Jan 10, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js104.53 KB (0%)
packages/react/dist/browser.umd.js104.91 KB (0%)

Comment threadpackages/react/src/experimental/UnderlinePanels/UnderlinePanels.tsx Outdated
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5527 January 14, 2025 16:21 Inactive
@github-actionsgithub-actionsBot 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-actionsBottemporarily deployed to storybook-preview-5527 January 14, 2025 20:32 Inactive
@ddoyle2017ddoyle2017 self-assigned this Jan 14, 2025
@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 Jan 21, 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-actions
github-actionsBottemporarily deployed to storybook-preview-5527 January 21, 2025 19:25 Inactive
@ddoyle2017ddoyle2017 changed the title [WIP] Improve programmatic state management of UnderlinePanelsImprove programmatic state management of UnderlinePanelsJan 22, 2025

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

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

@mperrottimperrotti left a comment

Copy link
Copy Markdown
Contributor

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!

@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-actions
github-actionsBottemporarily deployed to storybook-preview-5527 January 22, 2025 21:52 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 Jan 23, 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 Jan 23, 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 Jan 23, 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 Jan 23, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5527 January 23, 2025 15:44 Inactive
@ddoyle2017
ddoyle2017 added this pull request to the merge queueJan 23, 2025
@github-merge-queue
github-merge-queueBot 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 queueJan 23, 2025
Merged via the queue into main with commit ccc3c99Jan 23, 2025
@ddoyle2017
ddoyle2017 deleted the ddoyle2017/update-underlinepanels branch January 23, 2025 17:04
@primerprimerBot mentioned this pull request Jan 23, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-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/tdmpakpm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@ddoyle2017@mperrotti@cmbrose@francinelucca