Skip to content

add data-component attributes for Avatar, AvatarStack, Banner, & BaseStyles#7734

Open
llastflowers wants to merge 15 commits intomainfrom
llastflowers/6497/AvatarStack
Open

add data-component attributes for Avatar, AvatarStack, Banner, & BaseStyles#7734
llastflowers wants to merge 15 commits intomainfrom
llastflowers/6497/AvatarStack

Conversation

@llastflowers
Copy link
Copy Markdown
Contributor

@llastflowers llastflowers commented Apr 7, 2026

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

Changelog

New

Add data-component attributes and associated for Avatar, AvatarStack, Banner, & BaseStyles

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

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 7, 2026

🦋 Changeset detected

Latest commit: 0d4323c

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 Patch

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 Apr 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

⚠️ 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.

@llastflowers llastflowers changed the title Add data-component for AvatarStack feat(AvatarStack): add data-component attributes for better accessibility Apr 7, 2026
@github-actions github-actions bot temporarily deployed to storybook-preview-7734 April 7, 2026 22:25 Inactive
Comment on lines +44 to +45
const root = container.querySelector('[data-component="AvatarStack"]')
expect(root).toHaveAttribute('data-align-right', '')
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.

already being useful! 😛

@github-actions github-actions bot temporarily deployed to storybook-preview-7734 April 9, 2026 19:29 Inactive
@llastflowers llastflowers changed the title feat(AvatarStack): add data-component attributes for better accessibility add data-component attributes for Avatar, AvatarStack, Banner, & BaseStyles Apr 9, 2026
@github-actions github-actions bot temporarily deployed to storybook-preview-7734 April 9, 2026 19:40 Inactive
@llastflowers llastflowers marked this pull request as ready for review April 10, 2026 16:17
Comment thread packages/react/src/Banner/Banner.tsx Outdated
Comment thread packages/react/src/Banner/Banner.tsx Outdated
Comment on lines +286 to +292
<Button
data-component="Banner.SecondaryAction"
ref={forwardedRef}
className={clsx('BannerPrimaryAction', className)}
variant="invisible"
{...rest}
>
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.

not relevant to this PR but why is this class=BannerPrimaryAction? 😳

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.

Good point! I looked into it and it seems like it's been this way since the inception of Banner.tsx 😅 Probably just a copy/paste error by the looks of it! But another thing aside from that—it seems like this might actually be a legacy thing that isn't even in use?? Unless I'm just not understanding how its used 🤔 I'd be curious to know what 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.

my guess would be if you want a stable class to select 'cause after ours are computed they get a random value added to them, but this definitely feels like an error 🤔 , either way let's keep it outside the scope of this PR

Copy link
Copy Markdown
Member

@francinelucca francinelucca left a comment

Choose a reason for hiding this comment

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

I think after #7734 (comment) we're good to go here 👍🏽

@primer primer deleted a comment from primer-integration bot Apr 10, 2026
@github-actions github-actions bot requested a deployment to storybook-preview-7734 April 10, 2026 22:35 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-7734 April 10, 2026 22:46 Inactive
@llastflowers llastflowers added the Canary Release Apply this label when you want CI to create a canary release of the current PR label Apr 10, 2026
Copy link
Copy Markdown
Member

@francinelucca francinelucca left a comment

Choose a reason for hiding this comment

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

Add data-component attributes for Avatar, AvatarStack, Banner, and BaseStyles.
@llastflowers llastflowers added integration-tests: skipped manually Changes in this PR do not require an integration test Canary Release Apply this label when you want CI to create a canary release of the current PR and removed integration-tests: skipped manually Changes in this PR do not require an integration test Canary Release Apply this label when you want CI to create a canary release of the current PR labels Apr 18, 2026
@primer-integration
Copy link
Copy Markdown

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

@primer-integration
Copy link
Copy Markdown

Integration test results from github/github-ui:

Failed  CI   Failed
Failed  VRT   Failed
Passed  Projects   Passed

CI check runs linting, type checking, and unit tests. Check the workflow logs for specific failures.

VRT check ensures that when visual differences are detected, the PR cannot proceed until someone acknowledges the changes by adding the "visual difference acknowledged" label.

Need help? If you believe this failure is unrelated to your changes, please reach out to the Primer team for assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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