Skip to content

data-component adr part 5#7867

Open
llastflowers wants to merge 12 commits into
mainfrom
llastflowers/6497/data-component-ADR-part-5
Open

data-component adr part 5#7867
llastflowers wants to merge 12 commits into
mainfrom
llastflowers/6497/data-component-ADR-part-5

Conversation

@llastflowers
Copy link
Copy Markdown
Contributor

Relates to https://github.com/github/primer/issues/6497

Changelog

New

Add data-component attributes and associated tests for ActionMenu, AnchoredOverlay, Autocomplete, and NavList

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

@llastflowers llastflowers requested a review from a team as a code owner May 22, 2026 00:41
@llastflowers llastflowers requested review from Copilot and joshblack and removed request for Copilot May 22, 2026 00:41
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 22, 2026

🦋 Changeset detected

Latest commit: 06c2480

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

@llastflowers llastflowers changed the title Llastflowers/6497/data component adr part 5 data-component adr part 5 May 22, 2026
@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 May 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

To publish a canary release for integration testing, apply the Canary Release label to this PR.

Copilot AI review requested due to automatic review settings May 22, 2026 00:42
@github-actions github-actions Bot requested a deployment to storybook-preview-7867 May 22, 2026 00:46 Abandoned
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds data-component attributes to additional @primer/react components to support the ongoing “data-component” ADR work, along with targeted unit tests and a changeset for a minor release.

Changes:

  • Add data-component attributes for NavList (root + SubNav), Autocomplete (Input + Overlay), AnchoredOverlay (responsive close button container), and ActionMenu (Button + Overlay + attempted Anchor tagging).
  • Add/extend unit tests to assert the new attributes are present under expected render conditions.
  • Add a changeset for @primer/react minor release.
Show a summary per file
File Description
packages/react/src/NavList/NavList.tsx Adds data-component attributes to NavList root and NavList.SubNav.
packages/react/src/NavList/NavList.test.tsx Adds a test asserting NavList/SubNav are tagged.
packages/react/src/Autocomplete/AutocompleteOverlay.tsx Tags the rendered overlay with data-component="Autocomplete.Overlay".
packages/react/src/Autocomplete/AutocompleteInput.tsx Tags the input with data-component="Autocomplete.Input".
packages/react/src/Autocomplete/Autocomplete.test.tsx Adds a test asserting overlay is tagged when menu is shown.
packages/react/src/AnchoredOverlay/AnchoredOverlay.tsx Tags the responsive close button container.
packages/react/src/AnchoredOverlay/AnchoredOverlay.test.tsx Adds a test asserting the close button container is tagged.
packages/react/src/ActionMenu/ActionMenu.tsx Tags ActionMenu.Button and ActionMenu.Overlay; adds conditional tagging logic for ActionMenu.Anchor.
packages/react/src/ActionMenu/ActionMenu.test.tsx Adds a test asserting ActionMenu parts are tagged after opening.
.changeset/quick-ants-lead.md Records a minor-release changeset for the new attributes/tests.

Copilot's findings

  • Files reviewed: 10/10 changed files
  • Comments generated: 3

Comment thread packages/react/src/ActionMenu/ActionMenu.tsx Outdated
Comment thread packages/react/src/NavList/NavList.test.tsx
Comment thread packages/react/src/AnchoredOverlay/AnchoredOverlay.test.tsx Outdated
@llastflowers llastflowers added the Canary Release Apply this label when you want CI to create a canary release of the current PR label May 22, 2026
@github-actions github-actions Bot temporarily deployed to storybook-preview-7867 May 22, 2026 18:07 Inactive
@llastflowers llastflowers added Canary Release Apply this label when you want CI to create a canary release of the current PR and removed Canary Release Apply this label when you want CI to create a canary release of the current PR labels May 28, 2026
@primer-integration
Copy link
Copy Markdown

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

<div
ref={containerRef}
className={styles.ActionMenuContainer}
data-component="ActionMenu.Overlay"
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.

I kind of feel like this should be on the AnchoredOverlay instead (override)

Comment on lines 242 to 248
{React.cloneElement(child, {
...anchorProps,
ref: anchorRef,
className: clsx(anchorProps.className, child.props.className),
onClick: onButtonClick,
onKeyDown: onButtonKeyDown,
})}
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.

I think this should be data-component="ActionMenu.Anchor"

<div className={classes.ResponsiveCloseButtonContainer}>
<div
className={classes.ResponsiveCloseButtonContainer}
data-component="AnchoredOverlay.CloseButtonContainer"
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.

I'd rename to data-component="AnchoredOverlay.CloseButton" and put it on the IconButton instead

Comment on lines 359 to 367
renderAnchor({
ref: anchorRef,
id: anchorId,
'aria-haspopup': 'true',
'aria-expanded': open,
tabIndex: 0,
onClick: onAnchorClick,
onKeyDown: onAnchorKeyDown,
...(shouldRenderAsPopover ? {popoverTarget: popoverId} : {}),
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.

I'd add data-component="AnchoredOverlay.Anchor"

Comment on lines 370 to 371
<Overlay
returnFocusRef={anchorRef}
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.

data-component="AnchoredOverlay"

Comment on lines +69 to +70
expect(container.querySelector('[data-component="Autocomplete.Overlay"]')).toBeInTheDocument()
})
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.

missing: Autocomplete.Input, Autocomplete.Menu

describe('NavList', () => {
implementsClassName(NavList)

it('renders data-component attributes for NavList and NavList.SubNav', () => {
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.

missing: data-component tests for NavItems

@primer-integration
Copy link
Copy Markdown

Integration test results from github/github-ui:

Passed  CI   Passed
Passed  VRT   Passed
Passed  Projects   Passed

All checks passed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Canary Release Apply this label when you want CI to create a canary release of the current PR 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