Skip to content

data-component adr part 3 - #7819

Merged
llastflowers merged 8 commits into
mainfrom
llastflowers/6497/data-component-ADR-part-3
May 12, 2026
Merged

data-component adr part 3#7819
llastflowers merged 8 commits into
mainfrom
llastflowers/6497/data-component-ADR-part-3

Conversation

@llastflowers

@llastflowersllastflowers commented May 7, 2026

Copy link
Copy Markdown
Contributor

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

Changelog

New

Add data-component attributes and associated tests for Details, Flash, FormControl (+ update InputValidation to forward from FormControl.Validation), Header, and Heading.

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 May 7, 2026 19:34
@llastflowers
llastflowers requested a review from a team as a code ownerMay 7, 2026 19:34
@changeset-bot

changeset-botBot commented May 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f20de1d

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 May 7, 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.

@llastflowersllastflowers added the Canary Release Apply this label when you want CI to create a canary release of the current PR label May 7, 2026

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

Adds stable data-component attributes (per ADR rollout) to several Primer React components and introduces unit tests to verify those attributes are rendered.

Changes:

  • Add data-component markers to Details, Flash, FormControl (and related slots), Header, and Heading.
  • Extend internal InputValidation to accept/pass through a data-component value for FormControl.Validation.
  • Add/extend unit tests asserting data-component attributes for the updated components.
Show a summary per file
FileDescription
packages/react/src/internal/components/InputValidation.tsxAdds optional data-component prop and applies it to the rendered Text.
packages/react/src/Heading/Heading.tsxAdds data-component="Heading" to the root element.
packages/react/src/Heading/tests/Heading.test.tsxAdds a test asserting Heading renders the data-component attribute.
packages/react/src/Header/Header.tsxAdds data-component to Header, Header.Item, and Header.Link.
packages/react/src/Header/Header.test.tsxAdds tests asserting data-component attributes for Header and subcomponents.
packages/react/src/FormControl/FormControlLeadingVisual.tsxAdds data-component="FormControl.LeadingVisual".
packages/react/src/FormControl/FormControlLabel.tsxAdds data-component="FormControl.Label" to the label render.
packages/react/src/FormControl/FormControlCaption.tsxAdds data-component="FormControl.Caption".
packages/react/src/FormControl/FormControl.tsxAdds data-component="FormControl" to the layout wrapper elements.
packages/react/src/FormControl/_FormControlValidation.tsxPasses data-component="FormControl.Validation" into InputValidation.
packages/react/src/FormControl/tests/FormControl.test.tsxAdds tests for FormControl/slot data-component attributes (one test currently has a lint-breaking unused variable).
packages/react/src/Flash/Flash.tsxAdds data-component="Flash" to the root element.
packages/react/src/Flash/tests/Flash.test.tsxAdds a test asserting Flash renders the data-component attribute.
packages/react/src/Details/Details.tsxAdds data-component to Details root and Details.Summary.
packages/react/src/Details/tests/Details.test.tsxAdds tests asserting Details and Details.Summary render data-component attributes.

Copilot's findings

  • Files reviewed: 16/16 changed files
  • Comments generated: 1

@github-actions
github-actionsBot requested a deployment to storybook-preview-7819 May 7, 2026 19:41 Abandoned
@primer

primerBot commented May 7, 2026

Copy link
Copy Markdown
Contributor

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

@llastflowers
llastflowers marked this pull request as draft May 8, 2026 16:13
@primer-integration

Copy link
Copy Markdown

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

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

@llastflowers
llastflowers deleted the llastflowers/6497/data-component-ADR-part-3 branch May 11, 2026 21:02
@llastflowers
llastflowers restored the llastflowers/6497/data-component-ADR-part-3 branch May 11, 2026 22:12
@github-actions
github-actionsBottemporarily deployed to storybook-preview-7819 May 11, 2026 22:23 Inactive
@llastflowers
llastflowers added this pull request to the merge queueMay 12, 2026
Merged via the queue into main with commit 8ed6149May 12, 2026
104 checks passed
@llastflowers
llastflowers deleted the llastflowers/6497/data-component-ADR-part-3 branch May 12, 2026 16:34
@primerprimerBot mentioned this pull request May 12, 2026
@joshblackjoshblack mentioned this pull request May 14, 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