Skip to content

fix(Button): correct loading alignment #6095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 22, 2025

Conversation

francinelucca
Copy link
Member

@francinelucca francinelucca commented May 21, 2025

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

Changelog

Changed

  • Add display flex to LoadingSpinner class in button

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

@francinelucca francinelucca requested a review from a team as a code owner May 21, 2025 04:48
Copy link

changeset-bot bot commented May 21, 2025

🦋 Changeset detected

Latest commit: b8796ca

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 staff Author is a staff member label May 21, 2025
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 May 21, 2025
Copy link
Contributor

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

This PR fixes the alignment of the loading spinner inside the Button component by making the spinner container a flexbox.

  • Added display: flex to the .LoadingSpinner class.
Comments suppressed due to low confidence (2)

packages/react/src/Button/ButtonBase.module.css:246

  • [nitpick] Verify that this class name matches the JSX import (e.g., styles.loadingSpinner). If the component expects camelCase, consider renaming to loadingSpinner to avoid mismatches.
.LoadingSpinner{

packages/react/src/Button/ButtonBase.module.css:246

  • Consider adding a visual regression or Storybook test for the button with a loading spinner to catch any future alignment regressions.
.LoadingSpinner{

Copy link
Contributor

github-actions bot commented May 21, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 94.42 KB (0%)
packages/react/dist/browser.umd.js 94.48 KB (0%)

@github-actions github-actions bot requested a deployment to storybook-preview-6095 May 21, 2025 04:52 Abandoned
@primer-integration
Copy link

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

@github-actions github-actions bot requested a deployment to storybook-preview-6095 May 21, 2025 04:56 Abandoned
@github-actions github-actions bot requested a deployment to storybook-preview-6095 May 21, 2025 05:02 Abandoned
@primer-integration
Copy link

🟢 golden-jobs completed with status success.

@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels May 21, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-6095 May 21, 2025 05:16 Inactive
Copy link
Contributor

@hectahertz hectahertz left a comment

Choose a reason for hiding this comment

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

Pre approving, have a look at the copilot suggestions!

@francinelucca francinelucca added this pull request to the merge queue May 21, 2025
@francinelucca francinelucca removed this pull request from the merge queue due to a manual request May 21, 2025
@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 21, 2025
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actions github-actions bot temporarily deployed to storybook-preview-6095 May 21, 2025 18:39 Inactive
@francinelucca francinelucca requested a review from Copilot May 21, 2025 20:04
Copy link
Contributor

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

This PR fixes the alignment of the loading spinner within the Button component by making its container a flexbox. It updates the CSS module, refreshes a test snapshot to reflect new class hashes, and adds a changeset for a patch release.

  • Added .LoadingSpinner styles to center the spinner in buttons
  • Updated an AnchoredOverlay snapshot due to updated CSS module class names
  • Created a changeset entry for the patch release

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/react/src/Button/ButtonBase.module.css Added .LoadingSpinner flex alignment rules
packages/react/src/AnchoredOverlay/snapshots/AnchoredOverlay.test.tsx.snap Updated class hashes in snapshot
.changeset/light-pants-listen.md Added patch changeset for fix(Button): correct loading alignment
Comments suppressed due to low confidence (1)

packages/react/src/Button/ButtonBase.module.css:247

  • Consider adding a unit or visual regression test that renders a Button with isLoading enabled and asserts the spinner is centered, ensuring this new alignment is covered by automated tests.
display: flex;

@github-actions github-actions bot removed the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label May 22, 2025
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. 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 May 22, 2025
@github-actions github-actions bot added integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels May 22, 2025
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actions github-actions bot requested a deployment to storybook-preview-6095 May 22, 2025 02:58 Abandoned
@github-actions github-actions bot added integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels May 22, 2025
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actions github-actions bot requested a deployment to storybook-preview-6095 May 22, 2025 03:05 Abandoned
@francinelucca francinelucca added this pull request to the merge queue May 22, 2025
Merged via the queue into main with commit 3beba5b May 22, 2025
35 of 36 checks passed
@francinelucca francinelucca deleted the fix/loading-button-allignment branch May 22, 2025 03:43
@primer primer bot mentioned this pull request May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants