data-component adr part 4#7838
Conversation
🦋 Changeset detectedLatest commit: e0b74cf 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 |
|
Add data-component attributes and associated tests for Hidden, InlineMessage, KeybindingHint, Label, and LabelGroup
There was a problem hiding this comment.
Pull request overview
Adds stable data-component attributes for several @primer/react components as part of the ADR-driven stable selector rollout, with unit tests covering the new selectors.
Changes:
- Adds
data-componentto Hidden, InlineMessage, KeybindingHint, Label, and LabelGroup roots. - Adds tests asserting those selectors are rendered.
- Updates LabelGroup’s two render paths to include the selector.
Show a summary per file
| File | Description |
|---|---|
packages/react/src/Hidden/Hidden.tsx |
Adds data-component="Hidden" to the root div. |
packages/react/src/Hidden/Hidden.test.tsx |
Tests Hidden selector rendering. |
packages/react/src/InlineMessage/InlineMessage.tsx |
Adds data-component="InlineMessage" to the root div. |
packages/react/src/InlineMessage/InlineMessage.test.tsx |
Tests InlineMessage selector rendering. |
packages/react/src/KeybindingHint/KeybindingHint.tsx |
Adds data-component="KeybindingHint" to the rendered kbd wrapper. |
packages/react/src/KeybindingHint/KeybindingHint.test.tsx |
Tests KeybindingHint selector rendering. |
packages/react/src/Label/Label.tsx |
Adds data-component="Label" to the polymorphic root. |
packages/react/src/Label/Label.test.tsx |
Tests Label selector rendering. |
packages/react/src/LabelGroup/LabelGroup.tsx |
Adds data-component="LabelGroup" to both LabelGroup root render paths. |
packages/react/src/LabelGroup/LabelGroup.test.tsx |
Tests LabelGroup selector rendering for the default path. |
Copilot's findings
- Files reviewed: 11/11 changed files
- Comments generated: 2
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/20755 |
Relates to https://github.com/github/primer/issues/6497
Changelog
New
Add data-component attributes and associated tests for Hidden, InlineMessage, KeybindingHint, Label, and LabelGroup
Rollout strategy
Testing & Reviewing
Merge checklist