data-component adr part 5#7867
Conversation
🦋 Changeset detectedLatest commit: fd4e024 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
There was a problem hiding this comment.
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-componentattributes 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/reactminor 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
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
Testing & Reviewing
Merge checklist