Skip to content

data-component adr part 6#7889

Draft
llastflowers wants to merge 9 commits into
mainfrom
llastflowers/6497/data-component-ADR-part-6
Draft

data-component adr part 6#7889
llastflowers wants to merge 9 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 owner May 27, 2026 20:42
@llastflowers llastflowers requested review from Copilot and joshblack May 27, 2026 20:42
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 27, 2026

🦋 Changeset detected

Latest commit: 40063a9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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-actions github-actions Bot 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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
File Description
packages/react/src/ProgressBar/ProgressBar.tsx Adds data-component to ProgressBar root and Item.
packages/react/src/ProgressBar/ProgressBar.test.tsx Tests for new data-component attributes.
packages/react/src/Portal/Portal.tsx Sets data-component on the imperatively created portal div.
packages/react/src/Portal/Portal.test.tsx Adds assertions for the portal data-component across cases.
packages/react/src/Popover/Popover.tsx Adds data-component to Popover and Popover.Content.
packages/react/src/Popover/Popover.test.tsx Tests for Popover data-component attributes.
packages/react/src/PageLayout/PageLayout.tsx Adds data-component to Root, Header, Content, Pane, Sidebar, Footer.
packages/react/src/PageLayout/PageLayout.test.tsx Tests for PageLayout data-component attributes.
packages/react/src/PageLayout/snapshots/PageLayout.test.tsx.snap Updated snapshots reflecting new attributes.
packages/react/src/PageHeader/PageHeader.tsx Adds/renames data-component across all PageHeader subcomponents to PageHeader.*.
packages/react/src/PageHeader/PageHeader.test.tsx Tests for PageHeader data-component attributes.
packages/react/src/PageHeader/PageHeader.module.css Updates :has([data-component='TitleArea']) selectors to use PageHeader.TitleArea (but leaves PH_* selectors).
packages/react/src/Pagehead/Pagehead.tsx Adds data-component to Pagehead.
packages/react/src/Pagehead/Pagehead.test.tsx Test for Pagehead data-component.
.changeset/pretty-coats-sell.md Minor 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"
Copy link
Copy Markdown
Member

@joshblack joshblack left a comment

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
Contributor Author

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
Contributor Author

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-actions Bot requested a deployment to storybook-preview-7889 May 27, 2026 20:47 Abandoned
@github-actions github-actions Bot 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This 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.

3 participants