Skip to content

Defer mobile navbar auth loading - #1110

Open
tannerlinsley wants to merge 1 commit into
mainfrom
agent/defer-mobile-navbar-auth
Open

Defer mobile navbar auth loading#1110
tannerlinsley wants to merge 1 commit into
mainfrom
agent/defer-mobile-navbar-auth

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Aug 4, 2026

Copy link
Copy Markdown
Member

Evidence

PR #1105 added MobileNavbarAuthControls inside the mobile menu. CollapsibleContent keeps its children mounted while closed, so the new lazy component started importing on every page render rather than when the menu opened.

The production client graph maps that dynamic path to 10 assets totaling 231,759 uncompressed bytes before cache reuse. Mounting the component also calls useCurrentUserQuery, so a closed mobile menu could start auth work that the existing desktop navbar intentionally defers until interaction.

Follow-up to #1105 and the implementation of #1090.

Change

Keep the existing signed-out link mounted while the mobile menu is closed. Mount MobileNavbarAuthControls only after mobileMenuOpen becomes true.

Authenticated mobile behavior is unchanged once the menu opens.

Impact

Avoids eager auth chunk loading and current-user query work for visitors who do not open the mobile menu.

Validation

  • pnpm test — 144 passed, 1 intentional skip; TypeScript and lint clean
  • pnpm build — passed
  • git diff --check — passed

Risk

Low. The closed menu still renders the same Sign In fallback, and opening the menu preserves the existing Suspense fallback while auth state loads.

Summary by CodeRabbit

  • Performance Improvements
    • Mobile authentication controls now load only when the mobile navigation menu is opened.
    • Added a consistent sign-in fallback while authentication controls are loading.

@tannerlinsley tannerlinsley added the source-audit Tracked by the automated source audit label Aug 4, 2026
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f75d71a2-ec3c-4d02-a6ba-c4c65b788037

📥 Commits

Reviewing files that changed from the base of the PR and between 9309d88 and 148105c.

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

📝 Walkthrough

Walkthrough

Navbar passes the mobile menu state to MobileNavigation. Mobile authentication controls load only when the menu is open. A shared sign-in fallback renders before and during lazy loading.

Changes

Mobile authentication loading

Layer / File(s) Summary
Conditional mobile authentication controls
src/components/Navbar.tsx
Navbar passes the menu-open state to MobileNavigation. MobileNavigation conditionally lazy-loads authentication controls and uses a shared sign-in fallback before and during suspense.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: ladybluenotes

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: deferring mobile navbar authentication loading to improve performance. It aligns precisely with the PR's primary objective and the file changes.
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/defer-mobile-navbar-auth

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.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tanstack-com 148105c Commit Preview URL

Branch Preview URL
Aug 04 2026, 02:13 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

source-audit Tracked by the automated source audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant