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
    • Updated logo/brand area loading layout so the logo region preserves alignment and spacing during content loading, improving visual consistency and reducing layout shifts in the navigation bar.

@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 86cca2e

@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: 831f8376-1efd-4cd9-8b6a-59fb7f275b21

📥 Commits

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

📒 Files selected for processing (1)
  • src/components/Navbar.tsx
✅ Files skipped from review due to trivial changes (1)
  • src/components/Navbar.tsx

📝 Walkthrough

Walkthrough

The React Suspense fallback in the Navbar was changed to wrap LogoSection inside a <div> with Tailwind classes flex items-center group flex-shrink-0 instead of rendering LogoSection directly.

Changes

Cohort / File(s) Summary
Navbar Suspense Fallback Structure
src/components/Navbar.tsx
Updated the React.Suspense fallback to render LogoSection inside a wrapper <div> with flex, items-center, group, and flex-shrink-0 Tailwind classes; props passed to LogoSection unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 I wrapped the logo in tidy Tailwind thread,
A little div to keep alignment fed,
Flex and group and shrink—so neat,
The navbar's fallback hops on beat. 🥕

🚥 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 loaded wrapper styling, which addresses the layout shift issue mentioned in the PR objectives.

✏️ 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.

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.
@franklinjavier franklinjavier force-pushed the franklinjavier/navbar-fallback branch from 37d72ac to 86cca2e Compare April 15, 2026 22:17
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