Skip to content

fix: match navbar Suspense fallback to loaded wrapper#790

Open
franklinjavier wants to merge 1 commit intoTanStack:mainfrom
franklinjavier:franklinjavier/navbar-fallback
Open

fix: match navbar Suspense fallback to loaded wrapper#790
franklinjavier wants to merge 1 commit intoTanStack:mainfrom
franklinjavier:franklinjavier/navbar-fallback

Conversation

@franklinjavier
Copy link
Copy Markdown

@franklinjavier franklinjavier commented Mar 26, 2026

Summary

  • Wrap the Suspense fallback LogoSection in a <div> with the same flex items-center group flex-shrink-0 classes that LazyBrandContextMenu uses
  • Without this, the fallback has no wrapper while the loaded state does, causing a layout shift when the lazy component resolves

Test plan

  • Navbar logo should not shift when BrandContextMenu loads

Summary by CodeRabbit

  • Style
    • Improved navigation bar logo section layout styling for better visual consistency during content loading states.

The fallback rendered LogoSection without a wrapper div, but the
loaded state wrapped it in a div with flex/shrink classes. This
mismatch caused a layout shift when BrandContextMenu loaded.
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 26, 2026

👷 Deploy request for tanstack pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 37d72ac

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b4f85800-fb2c-4062-a051-c94598963386

📥 Commits

Reviewing files that changed from the base of the PR and between e71479b and 37d72ac.

📒 Files selected for processing (1)
  • src/components/Navbar.tsx

📝 Walkthrough

Walkthrough

A React Suspense fallback in the Navbar component was refactored to wrap the LogoSection component in a styled <div> element with Tailwind utility classes (flex, group, flex-shrink-0) instead of rendering it directly.

Changes

Cohort / File(s) Summary
Navbar Suspense Fallback Structure
src/components/Navbar.tsx
Modified the React Suspense fallback to wrap LogoSection in a styled <div> container with flex, group, and flex-shrink-0 Tailwind classes for improved layout consistency.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A wrapper so neat, with Tailwind's flair,
The LogoSection now floats in styled air,
Flex, group, shrink-zero—a CSS delight,
The navbar's fallback is looking just right! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: wrapping the Suspense fallback to match the styling of the loaded state, which prevents layout shifts in the navbar.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

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