Skip to content

perf: fix startup and route loading - #49

Merged
Programcode merged 1 commit into
mainfrom
t3code/fix-startup-navigation-performance
Sep 19, 2026
Merged

Programcode merged 1 commit into
mainfrom
t3code/fix-startup-navigation-performance

Conversation

@Programcode

Copy link
Copy Markdown
Owner

Summary

  • start React and critical CSS immediately; defer Jam and telemetry until load/idle without gating rendering
  • replace the visible SEO directory with the existing branded boot shell while preserving crawl-only copy in noscript
  • keep the protected shell mounted across sibling routes, move Suspense to page content, and use router navigation for landing CTAs
  • remove the idle all-route preload stampede, lazy-load feature exports/telemetry, and enforce emitted module boundaries for PDF, DOCX, charts, ReactFlow, and Admin code
  • stop service-worker controller-change reloads while retaining visited-resource runtime caching and offline shell support

Measured result

Controlled production-build measurements and desktop/mobile filmstrips/videos are in docs/performance/startup-navigation-2026-09-19/README.md.

  • first real app paint: 769 ms → 464 ms desktop; 1,042 ms → 393 ms mobile
  • after-idle startup: 103 → 34 requests; 1,113,865 → 711,360 transferred bytes; 3,665,094 → 2,035,497 decoded bytes
  • critical landing JavaScript gzip: 803,351 → 403,438 bytes
  • throttled cold paint: 8,381 ms → 4,904 ms
  • indefinitely stalled Jam: 3,582 ms → 373 ms desktop; 3,530 ms → 485 ms mobile
  • warm Generate → Attack: 421 ms → 157 ms desktop; 1,314 ms → 1,067 ms mobile, with the shell continuously visible

Verification

  • npm ci
  • npm run docs:check
  • npm run lint
  • npm run typecheck
  • npm test -- --coverage — 1,054 passed; 90.30% statements, 83.00% branches, 92.30% functions, 94.36% lines
  • npm run test:edge — 185 passed
  • npm run build — passed, including emitted Rollup module-graph boundary check and dist/index.html inspection
  • CI=1 PORT=18085 PLAYWRIGHT_BASE_URL=http://127.0.0.1:18085 npm run test:e2e — 179 passed, 1 expected desktop-only test skipped on mobile
  • mobile onboarding navigation stress check — 5/5 passed with retries disabled
  • independent code/spec reviews completed; all actionable findings addressed

No production or staging deployment was performed. Please leave this PR open for Adam to merge.

Copilot AI lite review requested due to automatic review settings September 19, 2026 20:13
@vercel

vercel Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
debate-navigator Ready Ready Preview Sep 19, 2026 8:14pm UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 45 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 4fc88dca-6a85-41ca-bb73-fd19a99e3796

📥 Commits

Reviewing files that changed from the base of the PR and between 9689594 and 34e024b.

⛔ Files ignored due to path filters (8)
  • docs/performance/startup-navigation-2026-09-19/after-desktop-filmstrip.png is excluded by !**/*.png
  • docs/performance/startup-navigation-2026-09-19/after-desktop.webm is excluded by !**/*.webm
  • docs/performance/startup-navigation-2026-09-19/after-mobile-filmstrip.png is excluded by !**/*.png
  • docs/performance/startup-navigation-2026-09-19/after-mobile.webm is excluded by !**/*.webm
  • docs/performance/startup-navigation-2026-09-19/before-desktop-filmstrip.png is excluded by !**/*.png
  • docs/performance/startup-navigation-2026-09-19/before-desktop.webm is excluded by !**/*.webm
  • docs/performance/startup-navigation-2026-09-19/before-mobile-filmstrip.png is excluded by !**/*.png
  • docs/performance/startup-navigation-2026-09-19/before-mobile.webm is excluded by !**/*.webm
📒 Files selected for processing (41)
  • README.md
  • docs/architecture.md
  • docs/performance/startup-navigation-2026-09-19/README.md
  • docs/testing.md
  • e2e/animation-polish.spec.ts
  • e2e/helpers/auth.ts
  • e2e/home-navigation.spec.ts
  • e2e/loading-performance.spec.ts
  • e2e/login.spec.ts
  • e2e/startup-shell.spec.ts
  • index.html
  • package.json
  • plans/README.md
  • plans/startup-navigation-performance.md
  • public/sw.js
  • public/theme-init.js
  • scripts/check-build-boundaries.mjs
  • src/App.tsx
  • src/bootstrap.ts
  • src/components/WebTelemetry.tsx
  • src/components/features/attack/AttackResults.tsx
  • src/components/features/brainstorm/BrainstormResults.tsx
  • src/components/features/factoids/FactoidsResults.tsx
  • src/components/features/generate/GenerateResults.tsx
  • src/components/landing/FinalCTA.tsx
  • src/components/landing/Hero.tsx
  • src/components/landing/Navbar.tsx
  • src/components/landing/Pricing.tsx
  • src/jam-loader.ts
  • src/lib/motion-policy.ts
  • src/lib/observability.ts
  • src/main.tsx
  • src/offline-route-preload.ts
  • src/pages/SparringPage.tsx
  • src/register-service-worker.ts
  • src/test/jam-loader.test.ts
  • src/test/motion-policy.test.ts
  • src/test/observability.test.ts
  • src/test/register-service-worker.test.ts
  • src/test/vercel-deployment-config.test.ts
  • vite.config.ts

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing.

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

@Programcode

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Programcode
Programcode merged commit cc93caf into main Sep 19, 2026
7 checks passed

This branch was successfully deployed

1 active deployment
Preview — 34e024b7 Deployed Sep 19, 2026 by vercel[bot]
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.

2 participants