Skip to content

data component adr part 7 - #7991

Merged
llastflowers merged 25 commits into
mainfrom
llastflowers/6497/data-component-ADR-part-7
Jun 23, 2026
Merged

data component adr part 7#7991
llastflowers merged 25 commits into
mainfrom
llastflowers/6497/data-component-ADR-part-7

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:

Radio
RadioGroup
RelativeTime
ScrollableRegion
SegmentedControl
Select
SideNav
SkeletonBox
SkeletonAvatar
SkeletonText
Spinner

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

CopilotAI review requested due to automatic review settings June 12, 2026 22:27
@llastflowers
llastflowers requested a review from a team as a code ownerJune 12, 2026 22:27
@changeset-bot

changeset-botBot commented Jun 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 34d2d8f

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 Jun 12, 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.

@github-actions
github-actionsBot requested a deployment to storybook-preview-7991 June 12, 2026 22:32 Abandoned

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

Pull request overview

This PR continues the “data component ADR” work by adding data-component attributes and corresponding unit tests across several @primer/react components, improving stable DOM identification for testing, analytics, and integrations.

Changes:

  • Add data-component attributes to component root elements (and select sub-elements) for: Radio/RadioGroup, RelativeTime, ScrollableRegion, SegmentedControl, Select, SideNav, SkeletonBox/SkeletonText/SkeletonAvatar, and Spinner.
  • Add/extend unit tests to validate data-component attributes are present and correctly named.
  • Update SkeletonBox to default data-component to "SkeletonBox" while still allowing an override via prop.
Show a summary per file
FileDescription
packages/react/src/Spinner/Spinner.tsxAdds data-component="Spinner" to the outer wrapper element.
packages/react/src/Spinner/Spinner.test.tsxAdds a test asserting the Spinner root has the expected data-component.
packages/react/src/SkeletonText/SkeletonText.tsxAdjusts data-component placement for single-line; introduces a wrapper data-component for multiline.
packages/react/src/SkeletonText/SkeletonText.test.tsxAdds tests asserting data-component behavior for single-line and multiline SkeletonText.
packages/react/src/SkeletonAvatar/SkeletonAvatar.test.tsxAdds a test asserting data-component="SkeletonAvatar".
packages/react/src/Skeleton/SkeletonBox.tsxDefaults data-component to "SkeletonBox" and applies it on render.
packages/react/src/Skeleton/tests/SkeletonBox.test.tsxAdds a test asserting data-component="SkeletonBox".
packages/react/src/SideNav.tsxAdds data-component markers to SideNav and SideNav.Link.
packages/react/src/Select/Select.tsxAdds data-component markers to Select, Option, OptGroup, and placeholder option.
packages/react/src/Select/Select.test.tsxAdds tests asserting data-component markers across Select and its sub-elements.
packages/react/src/SegmentedControl/SegmentedControlIconButton.tsxAdds data-component marker to icon button variant.
packages/react/src/SegmentedControl/SegmentedControlButton.tsxAdds data-component marker to button variant.
packages/react/src/SegmentedControl/SegmentedControl.tsxAdds data-component="SegmentedControl" to the root <ul>.
packages/react/src/SegmentedControl/SegmentedControl.test.tsxAdds tests asserting data-component on root/buttons/icon buttons.
packages/react/src/ScrollableRegion/ScrollableRegion.tsxAdds data-component="ScrollableRegion" to the wrapper element.
packages/react/src/ScrollableRegion/ScrollableRegion.test.tsxAdds a test asserting data-component="ScrollableRegion".
packages/react/src/RelativeTime/RelativeTime.tsxAdds data-component="RelativeTime" to the rendered custom element.
packages/react/src/RelativeTime/RelativeTime.test.tsxAdds a test asserting data-component="RelativeTime".
packages/react/src/RadioGroup/RadioGroup.tsxAdds data-component="RadioGroup" to the shared group component.
packages/react/src/RadioGroup/RadioGroup.test.tsxAdds a test asserting data-component markers for RadioGroup and related sub-parts.
packages/react/src/Radio/Radio.tsxAdds data-component="Radio" to the input element.
packages/react/src/Radio/Radio.test.tsxAdds a test asserting data-component="Radio".
packages/react/src/tests/SideNav.test.tsxAdds a test asserting data-component markers for SideNav and link.

Copilot's findings

Comments suppressed due to low confidence (1)

packages/react/src/RadioGroup/RadioGroup.tsx:53

  • data-component is currently placed before {...rest}, so passing a data-component prop (or spreading a props object that happens to include it) can override/remove the intended RadioGroup marker and also affects the derived .Label/.Caption/.Validation markers via parentName. Place data-component after the spread so the default is stable.
  • Files reviewed: 24/24 changed files
  • Comments generated: 5

Comment threadpackages/react/src/SegmentedControl/SegmentedControl.tsx
Comment threadpackages/react/src/SkeletonText/SkeletonText.tsx
Comment threadpackages/react/src/SkeletonText/SkeletonText.test.tsx
@primer

primerBot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

🤖 Lint issues have been automatically fixed and committed to this PR.

@github-actions
github-actionsBot requested a deployment to storybook-preview-7991 June 12, 2026 22:39 Abandoned
@github-actions
github-actionsBot requested a deployment to storybook-preview-7991 June 15, 2026 22:34 Abandoned
@github-actions
github-actionsBottemporarily deployed to storybook-preview-7991 June 16, 2026 15:46 Inactive
@llastflowersllastflowers 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 Jun 16, 2026
@llastflowersllastflowers removed the Canary Release Apply this label when you want CI to create a canary release of the current PR label Jun 17, 2026
@github-actions
github-actionsBot requested a deployment to storybook-preview-7991 June 17, 2026 21:31 Abandoned
@github-actions
github-actionsBottemporarily deployed to storybook-preview-7991 June 17, 2026 21:42 Inactive
@llastflowersllastflowers added the Canary Release Apply this label when you want CI to create a canary release of the current PR label Jun 18, 2026

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

Comment threadpackages/react/src/SegmentedControl/SegmentedControlButton.tsx Outdated
Comment threadpackages/react/src/SegmentedControl/SegmentedControlIconButton.tsx Outdated
@llastflowersllastflowers removed the Canary Release Apply this label when you want CI to create a canary release of the current PR label Jun 22, 2026
@github-actions
github-actionsBottemporarily deployed to storybook-preview-7991 June 22, 2026 22:54 Inactive
@github-actions
github-actionsBottemporarily deployed to storybook-preview-7991 June 22, 2026 23:05 Inactive
@llastflowersllastflowers added the Canary Release Apply this label when you want CI to create a canary release of the current PR label Jun 23, 2026
@primer-integration

Copy link
Copy Markdown

Integration test results from github/github-ui PR:

Passed CI  Passed
Passed VRT  Passed
Passed Projects  Passed

All checks passed!

@llastflowers
llastflowers added this pull request to the merge queueJun 23, 2026
Merged via the queue into main with commit b906268Jun 23, 2026
61 checks passed
@llastflowers
llastflowers deleted the llastflowers/6497/data-component-ADR-part-7 branch June 23, 2026 21:18
@primerprimerBot mentioned this pull request Jun 23, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

@llastflowers@joshblack@francinelucca