fix(ui): remove hardcoded margin-right from Spinner component#1676
Open
MartinS-git wants to merge 4 commits intomainfrom
Open
fix(ui): remove hardcoded margin-right from Spinner component#1676MartinS-git wants to merge 4 commits intomainfrom
MartinS-git wants to merge 4 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: ad634e3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
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 |
Contributor
|
The Spinner previously applied a hardcoded `jn:mr-3` margin-right in its base styles, which conflicted with usage inside Button (and similar components) that manage their own spacing. The margin has been removed from the Spinner component itself. All usage sites where Spinner is followed by sibling content have been updated to add the spacing explicitly: - apps/doop: HintLoading.tsx - apps/greenhouse: HintLoading.tsx (shared + org-admin) - apps/heureka: AllServicesIssuesCount, AllVulnerabilitiesCount, Service/index, and two image route files Signed-off-by: MartinS-git <info@eyepic.de>
21c0c99 to
baddd74
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the hardcoded right margin from the shared Spinner component to avoid interfering with parent components’ spacing logic (notably Button), and updates several call sites to add spacing explicitly where needed.
Changes:
- Remove the
jn:mr-3class fromspinnerBaseStylesin the UI-componentsSpinner. - Add explicit
mr-3spacing to variousSpinnerusages in app code to preserve prior layouts. - Add a changeset entry documenting the patch release for
@cloudoperators/juno-ui-components.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ui-components/src/components/Spinner/Spinner.component.tsx | Removes the hardcoded margin-right from the base spinner styles. |
| apps/heureka/src/routes/services/$service/images/$image/versions/$version.tsx | Adds mr-3 to the Spinner used as a Suspense fallback. |
| apps/heureka/src/routes/services/$service/images/$image.tsx | Adds mr-3 to the Spinner used as a Suspense fallback. |
| apps/heureka/src/components/Vulnerabilities/AllVulnerabilitiesCount.tsx | Adds mr-3 to the Spinner used as a Suspense fallback. |
| apps/heureka/src/components/Services/AllServicesIssuesCount.tsx | Adds mr-3 to the Spinner used as a Suspense fallback. |
| apps/heureka/src/components/Service/index.tsx | Adds mr-3 to the Spinner used as a Suspense fallback. |
| apps/greenhouse/src/components/shared/HintLoading.tsx | Adds mr-3 to Spinner before text to preserve spacing. |
| apps/greenhouse/src/components/core-apps/org-admin/components/shared/HintLoading.tsx | Adds mr-3 to Spinner before text to preserve spacing. |
| apps/doop/src/components/shared/HintLoading.tsx | Adds mr-3 to Spinner before text to preserve spacing. |
| .changeset/remove-spinner-hardcoded-margin.md | Documents the Spinner margin-right removal as a patch. |
63 tasks
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: MartinS-git <info@eyepic.de>
cf3b1bd to
9c767f7
Compare
Standalone Spinner components used as Suspense fallbacks do not have sibling content, so adding mr-3 is unnecessary and can offset centering. Signed-off-by: MartinS-git <info@eyepic.de>
Signed-off-by: MartinS-git <info@eyepic.de>
edda
approved these changes
May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
Spinnercomponent previously included a hardcodedjn:mr-3margin-right in its base styles. This caused layout issues when Spinner is used inside components likeButtonthat manage their own spacing — the hardcoded margin would interfere with the Button's icon spacing logic.jn:mr-3fromspinnerBaseStylesinSpinner.component.tsxmr-3at usage sites where Spinner is followed by sibling content, to preserve existing visual layoutmr-3from standalone Spinners used as Suspense fallbacks (no sibling content — extra margin can offset centering)Affected files
packages/ui-componentsSpinner/Spinner.component.tsx— margin removed from base stylesapps/doopshared/HintLoading.tsx—className="mr-3"added to Spinner (precedes text)apps/greenhouseshared/HintLoading.tsx—className="mr-3"added to Spinner (precedes text)core-apps/org-admin/components/shared/HintLoading.tsx—className="mr-3"added to Spinner (precedes text)components/Auth.tsx—className="mr-3"added to Spinner (precedes "Signing on..." text)apps/heurekacomponents/Services/AllServicesIssuesCount.tsx— standalone Suspense fallback,mr-3not addedcomponents/Vulnerabilities/AllVulnerabilitiesCount.tsx— standalone Suspense fallback,mr-3not addedcomponents/Service/index.tsx— standalone Suspense fallback, onlymt-4retainedroutes/services/$service/images/$image.tsx— standalone Suspense fallback, onlymt-4retainedroutes/services/$service/images/$image/versions/$version.tsx— standalone Suspense fallback, onlymt-4retainedNotes
packages/ui-components,Button.component.tsxalready usesiconClasses(size)which returnsjn:mr-2— no change needed therejn:prefix — plainmr-3is used