Skip to content

UN-3185: Fix squished route-loading spinner in the content area#2118

Merged
jaseemjaskp merged 1 commit into
mainfrom
UN-3185-loader-spinner-fix
Jun 26, 2026
Merged

UN-3185: Fix squished route-loading spinner in the content area#2118
jaseemjaskp merged 1 commit into
mainfrom
UN-3185-loader-spinner-fix

Conversation

@jaseemjaskp

Copy link
Copy Markdown
Contributor

What

Why

  • UN-3185: Defer heavy chunks on login route + cache fingerprinted assets #2114 added LazyOutlet (a content-scoped <Suspense> inside PageLayout/FullPageLayout). Its fallback is GenericLoader, whose root .center uses width/height: inherit (index.css). At the app-level Suspense that inherits the full viewport, but inside the flex content area it collapses to a narrow column, so the loader renders cramped and left-aligned instead of centered.

How

  • Wrap the content-area fallback in a full-width, flex-centered .lazyOutletFallback box and pin the loader (> .center) to width: 100%, so it renders centered at its natural size regardless of how inherit resolves in the parent context. The app-level loader in Router.jsx is untouched (it doesn't use this wrapper).

Can this PR break any existing features?

  • No. CSS-only change scoped to a new .lazyOutletFallback class used solely by LazyOutlet's Suspense fallback. No behavior, routing, or other component is affected.

Database Migrations

  • None.

Env Config

  • None.

Relevant Docs

  • None.

Related Issues or PRs

Dependencies Versions

  • None.

Notes on Testing

  • npm run build green. Verified in-browser against the loaded stylesheet that .lazyOutletFallback > .center resolves to the full fallback width (e.g. a 500px fallback yields a 500px .center) instead of tracking the inherit chain, and the loader is flex-centered.

Screenshots

Checklist

I have read and understood the Contribution Guidelines.

GenericLoader's .center uses width/height: inherit, which collapsed to a
narrow column when used as LazyOutlet's content-area Suspense fallback (the
loader text wrapped one word per line beside the sidebar). Wrap the fallback in
a full-width, flex-centered .lazyOutletFallback box and pin .center to width:100%
so it renders centered at its natural size. The top-level loader in Router.jsx
is unaffected (it doesn't use this wrapper).
@github-actions

Copy link
Copy Markdown
Contributor

Frontend Lint Report (Biome)

All checks passed! No linting or formatting issues found.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 66f3208d-afa1-47e6-a942-6dbbd6c43ddf

📥 Commits

Reviewing files that changed from the base of the PR and between b13e5bd and 842b066.

📒 Files selected for processing (2)
  • frontend/src/components/error/LazyOutlet/LazyOutlet.css
  • frontend/src/components/error/LazyOutlet/LazyOutlet.jsx

Summary by CodeRabbit

  • Bug Fixes
    • Improved the loading state for route changes so the fallback content is centered properly and no longer appears cramped in a narrow column.
    • Updated the loading indicator layout to fill the available width more reliably, making it display consistently in the main content area.

Walkthrough

LazyOutlet now wraps its suspense loader in a styled fallback container and adds CSS that centers the loading state and keeps the loader sized to the container width.

Changes

LazyOutlet fallback layout

Layer / File(s) Summary
Suspense fallback wrapper
frontend/src/components/error/LazyOutlet/LazyOutlet.jsx
LazyOutlet imports its stylesheet and renders GenericLoader inside a lazyOutletFallback wrapper in the Suspense fallback.
Fallback centering styles
frontend/src/components/error/LazyOutlet/LazyOutlet.css
.lazyOutletFallback uses flex centering, and .lazyOutletFallback > .center overrides the loader sizing inside that wrapper.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: fixing the squished route-loading spinner in the content area.
Description check ✅ Passed The description accurately explains the route-loading spinner fix and matches the implemented LazyOutlet CSS and fallback wrapper changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch UN-3185-loader-spinner-fix

Warning

Tools execution failed with the following error:

Failed to run tools: 14 UNAVAILABLE: read ECONNRESET


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This is a CSS-only follow-up fix to #2114. It resolves a layout regression where GenericLoader's .center element (defined globally as width/height: inherit) collapsed to a narrow column when rendered as a flex item inside the content area, causing the loading text to wrap one word per line.

  • Introduces a new .lazyOutletFallback flex wrapper (width: 100%; min-height: 60vh; align-items/justify-content: center) that pins the loader to the full content area width and centers it vertically.
  • Overrides .lazyOutletFallback > .center with width: 100%; height: auto to prevent the inherit-based sizing from resolving to the narrow flex item width.
  • No behavior, routing, or non-CSS code is changed; the app-level Router.jsx Suspense boundary is untouched.

Confidence Score: 5/5

Safe to merge — the change is a scoped CSS addition with no impact on routing, logic, or any component outside the Suspense fallback path.

Both changed files touch only the visual presentation of the route-loading fallback. The new .lazyOutletFallback class is used in exactly one place, the direct-child selector .lazyOutletFallback > .center correctly targets GenericLoader's root element, and the min-height: 60vh fallback is a reasonable approximation of content-area height. No logic, routing, or other component is affected.

No files require special attention.

Important Files Changed

Filename Overview
frontend/src/components/error/LazyOutlet/LazyOutlet.css New CSS file that introduces .lazyOutletFallback wrapper and overrides .center width/height to fix the squished spinner layout in the content area flex context.
frontend/src/components/error/LazyOutlet/LazyOutlet.jsx Imports the new CSS file and wraps the Suspense fallback's GenericLoader in the .lazyOutletFallback div; no logic changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["PageLayout / FullPageLayout\n(sidebar + content flex container)"] --> B["LazyOutlet"]
    B --> C["ErrorBoundary\n(resetKeys: pathname)"]
    C --> D["Suspense\nfallback: lazyOutletFallback wrapper"]
    D -- loading --> E["div.lazyOutletFallback\n(display:flex; width:100%; min-height:60vh)"]
    E --> F["GenericLoader\ndiv.center (width:100% pinned by CSS override)"]
    D -- resolved --> G["Outlet\n(lazy route chunk)"]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["PageLayout / FullPageLayout\n(sidebar + content flex container)"] --> B["LazyOutlet"]
    B --> C["ErrorBoundary\n(resetKeys: pathname)"]
    C --> D["Suspense\nfallback: lazyOutletFallback wrapper"]
    D -- loading --> E["div.lazyOutletFallback\n(display:flex; width:100%; min-height:60vh)"]
    E --> F["GenericLoader\ndiv.center (width:100% pinned by CSS override)"]
    D -- resolved --> G["Outlet\n(lazy route chunk)"]
Loading

Reviews (1): Last reviewed commit: "UN-3185: Fix squished route-loading spin..." | Re-trigger Greptile

@jaseemjaskp jaseemjaskp merged commit a1c8cde into main Jun 26, 2026
8 checks passed
@jaseemjaskp jaseemjaskp deleted the UN-3185-loader-spinner-fix branch June 26, 2026 12:43
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant