fix(dashboard): prevent layout shift when loading spinner mounts in Models view - #626
Conversation
…odels view The Models loading pill was position: sticky in the flow, so mounting it pushed the table down by its own height and unmounting pulled it back. Make it a position: fixed overlay like .flash-region: centered in the content area via left: var(--sidebar-width) + right: 0 + auto margins, click-transparent, and stacked below flash toasts (z 110 vs 120). Sidebar offsets mirror .flash-region: 60px on mobile (max-width: 768px) and on the collapsed desktop sidebar via a plain .sidebar.sidebar-collapsed ~ .content selector (page-globals.css is plain CSS, so Svelte's :global(...) would be invalid there). The pill renders LoadingState's scoped .loading-state, whose min-height wins any global override by specificity, so LoadingState exposes --loading-state-min-height and the pill sets it to 0 for the compact height. Rebuild the embedded dist assets.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe loading state now accepts a minimum-height override through a CSS custom property. The models loading state uses a fixed, click-through overlay with responsive positioning for sidebar layouts. ChangesLoading state overlay
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@web/dashboard/src/styles/page-globals.css`:
- Line 258: Insert an empty line immediately before the padding declaration at
the indicated CSS rule to satisfy Stylelint’s declaration-empty-line-before
requirement, without changing the declaration or surrounding styles.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 5e4c6db2-376d-4cd7-ac59-762ad489a02e
⛔ Files ignored due to path filters (4)
internal/admin/dashboard/static/dist/assets/index-B-Rv4AUL.jsis excluded by!**/dist/**internal/admin/dashboard/static/dist/assets/index-DStc32IL.cssis excluded by!**/dist/**internal/admin/dashboard/static/dist/assets/index-Dv37Tmj5.cssis excluded by!**/dist/**internal/admin/dashboard/static/dist/index.htmlis excluded by!**/dist/**
📒 Files selected for processing (2)
web/dashboard/src/lib/components/molecules/LoadingState.svelteweb/dashboard/src/styles/page-globals.css
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Confidence Score: 5/5Safe to merge based on the reviewed loading-state behavior. The final defect set is empty. Browser measurements confirmed the loading pill uses fixed positioning, honors the desktop and mobile sidebar offsets, does not intercept pointer input, and contributes no layout height. Files Needing Attention: No files need follow-up changes.
What T-Rex did
Reviews (1): Last reviewed commit: "fix(dashboard): prevent layout shift whe..." | Re-trigger Greptile |
Description
The Models view's loading pill was
position: sticky, so it pushed thetable down by roughly its own height when it mounted and pulled it back
when it unmounted. Switching to
position: fixedremoves it from layoutflow; offsets mirror the flash-region pattern (
z-index: 110vs flashtoasts'
120, sidebar width 240 px / 60 px when collapsed) so the pillsits centered above the table without intercepting clicks. Verified
manually against a fresh local deployment stack (gateway + Postgres +
Valkey + Qdrant): the dashboard loads, the Models view renders the fixed
pill, and no layout shift occurs.
Before:
After
AI Generated
Drafted and reviewed with AI assistance. Review covered the rendering
path (
ModelsPage/LoadingState), stacking and positioning mathagainst the flash-region precedent, the mobile and collapsed-sidebar
breakpoints, and source/dist consistency. Two issues found during
review were fixed before opening: an invalid Svelte
:global(...)selector in the plain global stylesheet (dropped by browsers, making
the collapsed-sidebar override a no-op) and a scoped
min-heightthatout-specified the pill's compact-height override (now routed through a
--loading-state-min-heightcustom property). The embedded dashboardbundle was rebuilt and is byte-identical to a fresh build of the
sources.
Generated with creating-pull-requests Skill
Summary by CodeRabbit