Skip to content

Conversation

@mperrotti
Copy link
Contributor

@mperrotti mperrotti commented Dec 16, 2024

Closes https://github.com/github/primer/issues/4501

Screenshot 2024-12-18 at 4 06 40 PM

Changelog

New

  • corrects padding on <Button> where there is only an icon and a counter label to closer align with <IconButton> sizing

Changed

Nothing

Removed

Nothing

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

Confirm that this change doesn't cause any regressions with existing IconButton behavior.

Merge checklist

@mperrotti mperrotti requested a review from a team as a code owner December 16, 2024 21:13
@changeset-bot
Copy link

changeset-bot bot commented Dec 16, 2024

🦋 Changeset detected

Latest commit: dbfbadb

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
Copy link
Contributor

Uh oh! @mperrotti, the image you shared is missing helpful alt text. Check your pull request body.

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

🤖 Beep boop! This comment was added automatically by github/accessibility-alt-text-bot.

@github-actions
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@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 Dec 16, 2024
@mperrotti mperrotti added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Dec 16, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Dec 16, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 104.65 KB (+0.11% 🔺)
packages/react/dist/browser.umd.js 104.99 KB (+0.02% 🔺)

@primer primer bot requested a review from a team as a code owner December 16, 2024 21:24
@primer primer bot requested a review from tbenning December 16, 2024 21:24
@github-actions github-actions bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Dec 16, 2024
@primer primer bot temporarily deployed to github-pages December 16, 2024 21:26 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-5448 December 16, 2024 21:26 Inactive
Copy link
Contributor

@langermank langermank left a comment

Choose a reason for hiding this comment

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

Discussed on Slack and summarizing my thoughts here!

I would suggest putting this logic in Button to avoid adding a wrapper span inside IconButton. In order to utilize Button's layout wrapper .ButtonContent we're adding it to IconButton which feels like its adding unnecessary complexity given that this already exists in Button 😄

I would suggest...

  • Add a data-attribute to ButtonBase when count is true data-has-count for example
  • Add a CSS selector &:where([data-has-count]) and check if .Label is not there (not has?)
  • Remove padding if has count is true, .Label is not present. You could also check that a leading visual is present but I'm not sure that's necessary

If this doesn't work out I would feel better about that span being conditional in IconButton!

@primer primer bot temporarily deployed to github-pages December 18, 2024 21:20 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-5448 December 18, 2024 21:20 Inactive
export const TrailingCounterWithNoText = () => {
return <Button leadingVisual={CommentIcon} count={3} />
}
export const TrailingCounterWithNoText = () => <Button leadingVisual={CommentIcon} count={3} />
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add an aria-label or a Tooltip to this example?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm I'm torn on this. I'd prefer not to encourage tooltips, but it's common to use them for icon-only buttons.

Maybe add a second example in the same story?

@langermank langermank dismissed their stale review December 18, 2024 21:40

Feedback addressed

@langermank
Copy link
Contributor

You'll need to remove the snapshots that were added, and if you want add a new VRT test for the feature story 👍

@mperrotti mperrotti requested a review from langermank December 18, 2024 22:27
@mperrotti mperrotti added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Dec 18, 2024
@github-actions github-actions bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Dec 18, 2024
@langermank langermank added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Dec 19, 2024
Copy link
Contributor

@langermank langermank left a comment

Choose a reason for hiding this comment

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

🚀

@github-actions github-actions bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Dec 19, 2024
@mperrotti mperrotti enabled auto-merge December 19, 2024 18:36
@mperrotti mperrotti added this pull request to the merge queue Dec 19, 2024
Merged via the queue into main with commit 00600f7 Dec 19, 2024
42 checks passed
@mperrotti mperrotti deleted the mp/iconbutton-count branch December 19, 2024 18:51
@primer primer bot mentioned this pull request Dec 19, 2024
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