Skip to content

data-component adr part 6 - #7889

Merged
llastflowers merged 16 commits into
mainfrom
llastflowers/6497/data-component-ADR-part-6
Jun 9, 2026
Merged

data-component adr part 6#7889
llastflowers merged 16 commits into
mainfrom
llastflowers/6497/data-component-ADR-part-6

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 PageHeader, PageLayout, Pagehead, Popover, Portal, and ProgressBar

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 ownerMay 27, 2026 20:42
@changeset-bot

changeset-botBot commented May 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 59bcd12

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

Add data-component attributes and associated tests for PageHeader, PageLayout, Pagehead, Popover, Portal, and ProgressBar

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

Part 6 of the data-component ADR work: adds data-component attributes to PageHeader, PageLayout, Pagehead, Popover, Portal, and ProgressBar (plus subcomponents), with accompanying tests. Also normalizes PageHeader subcomponent data-component values from PH_* / bare TitleArea to the dotted PageHeader.* convention.

Changes:

  • Adds data-component to root + subcomponent elements across six components and their tests.
  • Renames PageHeader subcomponent data-component values (PH_*, TitleArea) to PageHeader.* and updates the :has() selectors in PageHeader.module.css that referenced TitleArea.
  • Adds a minor changeset.
Show a summary per file
FileDescription
packages/react/src/ProgressBar/ProgressBar.tsxAdds data-component to ProgressBar root and Item.
packages/react/src/ProgressBar/ProgressBar.test.tsxTests for new data-component attributes.
packages/react/src/Portal/Portal.tsxSets data-component on the imperatively created portal div.
packages/react/src/Portal/Portal.test.tsxAdds assertions for the portal data-component across cases.
packages/react/src/Popover/Popover.tsxAdds data-component to Popover and Popover.Content.
packages/react/src/Popover/Popover.test.tsxTests for Popover data-component attributes.
packages/react/src/PageLayout/PageLayout.tsxAdds data-component to Root, Header, Content, Pane, Sidebar, Footer.
packages/react/src/PageLayout/PageLayout.test.tsxTests for PageLayout data-component attributes.
packages/react/src/PageLayout/snapshots/PageLayout.test.tsx.snapUpdated snapshots reflecting new attributes.
packages/react/src/PageHeader/PageHeader.tsxAdds/renames data-component across all PageHeader subcomponents to PageHeader.*.
packages/react/src/PageHeader/PageHeader.test.tsxTests for PageHeader data-component attributes.
packages/react/src/PageHeader/PageHeader.module.cssUpdates :has([data-component='TitleArea']) selectors to use PageHeader.TitleArea (but leaves PH_* selectors).
packages/react/src/Pagehead/Pagehead.tsxAdds data-component to Pagehead.
packages/react/src/Pagehead/Pagehead.test.tsxTest for Pagehead data-component.
.changeset/pretty-coats-sell.mdMinor changeset describing the feature.

Copilot's findings

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

aria-labelledby={BaseComponent === 'nav' ? ariaLabelledBy : undefined}
className={clsx(classes.Navigation, className)}
data-component="PH_Navigation"
data-component="PageHeader.Navigation"

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

Just wanted to leave a comment real quick, some of the data-component values that exist already might have usage (specifically thinking of the PH_* ones so just wanted to double-check on the release plan for those before approving 👀

const Actions = ({children, className, hidden = false}: ActionsProps) => {
return (
<div className={clsx(classes.Actions, className)} data-component="PH_Actions" {...getHiddenDataAttributes(hidden)}>
<div

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 some of these may be used (like PH_Actions) based on: https://github.com/search?q=repo%3Agithub%2Fgithub-ui+PH_&type=code so we might need to be more careful for them

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Yeah, I was thinking about this and was planning to check the dotcom usages as well! I think we should definitely update the attribute names in primer/react to keep things consistent, so we need to update them in dotcom too. Since there are only 3 files that reference the old attributes, this seems like an easy enough migration effort.

I suppose we would just need to make sure that we have a migration PR in the same github-ui deployment group as the primer/react version upgrade that involves this PR, since the changes need to happen in both places at the same time to avoid breaking anything 🤔 Coordinating with RC on this (possibly asking them to queue both PRs to make sure they're deployed together) seems like the way to do it safely. What do you think? 👀

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.

Totally agreed, makes sense to me 👍

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

jk, @francinelucca correctly pointed out that this needs to be part of a major update. I'll revert everything related to the PH_ stuff in this PR and separate it out!

@github-actions
github-actionsBot requested a deployment to storybook-preview-7889 May 27, 2026 20:47 Abandoned
@github-actions
github-actionsBot requested a deployment to storybook-preview-7889 May 27, 2026 20:59 Abandoned
@llastflowers
llastflowers marked this pull request as draft May 27, 2026 23:00
@github-actions
github-actionsBottemporarily deployed to storybook-preview-7889 June 2, 2026 21:14 Inactive
@llastflowersllastflowers added the Canary Release Apply this label when you want CI to create a canary release of the current PR label Jun 2, 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.

let's make sure all the data-component attrs that need to be replaced next major are tracked in https://github.com/github/primer/issues/6501 🙏🏽

Comment threadpackages/react/src/PageLayout/PageLayout.tsx
@github-actions
github-actionsBot requested a deployment to storybook-preview-7889 June 8, 2026 19:21 Abandoned
@github-actions
github-actionsBottemporarily deployed to storybook-preview-7889 June 8, 2026 19:32 Inactive
@primer-integration

primer-integrationBot commented Jun 8, 2026

Copy link
Copy Markdown

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

Will report CI results once ready.

@llastflowersllastflowers added the integration-tests: skipped manually Changes in this PR do not require an integration test label Jun 9, 2026
@llastflowers

Copy link
Copy Markdown
ContributorAuthor

integration tests passing; not reporting to this PR https://github.com/github/github-ui/pull/22691

@llastflowers
llastflowers added this pull request to the merge queueJun 9, 2026
Merged via the queue into main with commit 3af5edcJun 9, 2026
61 checks passed
@llastflowers
llastflowers deleted the llastflowers/6497/data-component-ADR-part-6 branch June 9, 2026 17:32
@primerprimerBot mentioned this pull request Jun 9, 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/tdmpakpmintegration-tests: skipped manuallyChanges in this PR do not require an integration test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@llastflowers@joshblack@francinelucca