Skip to content

fix(ui): remove hardcoded margin-right from Spinner component#1676

Open
MartinS-git wants to merge 4 commits intomainfrom
spinner-margin-remove
Open

fix(ui): remove hardcoded margin-right from Spinner component#1676
MartinS-git wants to merge 4 commits intomainfrom
spinner-margin-remove

Conversation

@MartinS-git
Copy link
Copy Markdown
Contributor

@MartinS-git MartinS-git commented May 7, 2026

Summary

The Spinner component previously included a hardcoded jn:mr-3 margin-right in its base styles. This caused layout issues when Spinner is used inside components like Button that manage their own spacing — the hardcoded margin would interfere with the Button's icon spacing logic.

  • Remove jn:mr-3 from spinnerBaseStyles in Spinner.component.tsx
  • Add explicit mr-3 at usage sites where Spinner is followed by sibling content, to preserve existing visual layout
  • Remove mr-3 from standalone Spinners used as Suspense fallbacks (no sibling content — extra margin can offset centering)

Affected files

packages/ui-components

  • Spinner/Spinner.component.tsx — margin removed from base styles

apps/doop

  • shared/HintLoading.tsxclassName="mr-3" added to Spinner (precedes text)

apps/greenhouse

  • shared/HintLoading.tsxclassName="mr-3" added to Spinner (precedes text)
  • core-apps/org-admin/components/shared/HintLoading.tsxclassName="mr-3" added to Spinner (precedes text)
  • components/Auth.tsxclassName="mr-3" added to Spinner (precedes "Signing on..." text)

apps/heureka

  • components/Services/AllServicesIssuesCount.tsx — standalone Suspense fallback, mr-3 not added
  • components/Vulnerabilities/AllVulnerabilitiesCount.tsx — standalone Suspense fallback, mr-3 not added
  • components/Service/index.tsx — standalone Suspense fallback, only mt-4 retained
  • routes/services/$service/images/$image.tsx — standalone Suspense fallback, only mt-4 retained
  • routes/services/$service/images/$image/versions/$version.tsx — standalone Suspense fallback, only mt-4 retained

Notes

  • Inside packages/ui-components, Button.component.tsx already uses iconClasses(size) which returns jn:mr-2 — no change needed there
  • Apps using Juno as a built library do not use the jn: prefix — plain mr-3 is used

Copilot AI review requested due to automatic review settings May 7, 2026 06:57
@MartinS-git MartinS-git requested review from a team and franzheidl as code owners May 7, 2026 06:57
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 7, 2026

🦋 Changeset detected

Latest commit: ad634e3

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

This PR includes changesets to release 9 packages
Name Type
@cloudoperators/juno-ui-components Patch
@cloudoperators/juno-app-carbon Patch
@cloudoperators/juno-app-doop Patch
@cloudoperators/juno-app-example Patch
@cloudoperators/juno-app-greenhouse Patch
@cloudoperators/juno-app-heureka Patch
@cloudoperators/juno-app-supernova Patch
@cloudoperators/juno-app-template Patch
@cloudoperators/juno-messages-provider 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
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

PR Preview Action v1.8.1

🚀 View preview at
https://cloudoperators.github.io/juno/pr-preview/pr-1676/

Built to branch gh-pages at 2026-05-08 10:48 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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>
@MartinS-git MartinS-git force-pushed the spinner-margin-remove branch from 21c0c99 to baddd74 Compare May 7, 2026 06:59
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

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-3 class from spinnerBaseStyles in the UI-components Spinner.
  • Add explicit mr-3 spacing to various Spinner usages 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.

Comment thread apps/heureka/src/routes/services/$service/images/$image.tsx Outdated
Comment thread apps/heureka/src/routes/services/$service/images/$image/versions/$version.tsx Outdated
Comment thread apps/heureka/src/components/Service/index.tsx Outdated
Comment thread apps/heureka/src/components/Services/AllServicesIssuesCount.tsx Outdated
Comment thread apps/heureka/src/components/Vulnerabilities/AllVulnerabilitiesCount.tsx Outdated
Comment thread .changeset/remove-spinner-hardcoded-margin.md Outdated
Comment thread packages/ui-components/src/components/Spinner/Spinner.component.tsx
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: MartinS-git <info@eyepic.de>
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants