Skip to content

perf: finish smooth navigation follow-up - #57

Merged
Programcode merged 15 commits into
mainfrom
t3code/smooth-performance-followup
Sep 22, 2026
Merged

Programcode merged 15 commits into
mainfrom
t3code/smooth-performance-followup

Conversation

@Programcode

@Programcode Programcode commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • cache subscription reads across route transitions while preserving fail-closed error recovery
  • right-size the displayed logo and make first-visit route assets available offline
  • prevent synthetic touch hover prefetches and extend the navigation measurement harness
  • align Nginx cache/security headers and add a production-build service-worker smoke test
  • record Tasks 11-15 audits, measurements, rejected experiments, and final evidence

Measured results

  • subscription reads across Generate -> Attack: 4 -> 2
  • displayed logo transfer: 279,765 B -> 4,274 B
  • accepted warm real-content transition max: 86.4 ms desktop, 78.3 ms Pixel 5
  • ordinary controlled Event Timing max: 160 ms
  • first-visit and warm CLS: 0 for every transition
  • warm route transitions: 0 route requests / 0 route bytes
  • critical route gzip growth: <= 0.76%
  • production offline smoke: visited route, intent-prefetched route, display logo all available; unvisited route shows recovery; API cache entries = 0

Full evidence and caveats: docs/performance/smooth-navigation-final/README.md.

Verification

  • npm run verify (Node 22): 1,148 unit tests, 10 collaboration tests, 201 Edge tests, build/boundary/service-worker checks, Chromium 215 passed / 2 expected skipped (one flaky retry independently passed 3/3 with retries disabled)
  • CI=1 PORT=18080 PLAYWRIGHT_BASE_URL=http://127.0.0.1:18080 npm run test:e2e:webkit: 107 passed / 2 capability skips
  • focused Chromium + WebKit loading-performance suite: 9 passed / 1 capability skip
  • real nginx:alpine response-header smoke for /, /app, /index.html, and /sw.js
  • independent exact-head review: no Critical or Important findings

Release boundary

This PR is ready for review but must not be merged or deployed without a new explicit instruction from Adam.

Summary by CodeRabbit

  • New Features

    • Improved offline support: the first visited route and its loaded assets can now work offline without a forced reload.
    • Added offline recovery behavior for unvisited routes and hover-prefetched pages.
    • Subscription information now refreshes more reliably and recovers from temporary loading failures.
    • Hover-based prefetching is limited to devices that support fine-pointer hover.
  • Improvements

    • Updated app logos to use the optimized favicon asset with consistent sizing.
    • Improved caching behavior for faster repeat navigation and asset loading.

Copilot AI lite review requested due to automatic review settings September 21, 2026 09:57
@vercel

vercel Bot commented Sep 21, 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 22, 2026 6:59pm 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 21, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

Preview blast radius → · Advanced feature

Warning

Review limit reached

Next included review available in 1 minute.

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: 96978641-c71c-4e37-82c5-5601b7553573

📥 Commits

Reviewing files that changed from the base of the PR and between bdbdead and e35abb9.

⛔ Files ignored due to path filters (5)
  • docs/performance/smooth-navigation-final/desktop-delayed-filmstrip.png is excluded by !**/*.png
  • docs/performance/smooth-navigation-final/desktop-delayed.webm is excluded by !**/*.webm
  • docs/performance/smooth-navigation-final/pixel-5-delayed-filmstrip.png is excluded by !**/*.png
  • docs/performance/smooth-navigation-final/pixel-5-delayed.webm is excluded by !**/*.webm
  • public/favicon-72.png is excluded by !**/*.png
📒 Files selected for processing (25)
  • docs/architecture.md
  • docs/performance/smooth-navigation-final/README.md
  • docs/performance/smooth-navigation-final/final-1.json
  • docs/performance/smooth-navigation-final/final-3.json
  • docs/performance/smooth-navigation-final/task-11-audit.json
  • docs/testing.md
  • e2e/loading-performance.spec.ts
  • e2e/navigation-performance.spec.ts
  • e2e/public-pages.spec.ts
  • e2e/sparring.spec.ts
  • nginx.conf
  • package.json
  • public/sw.js
  • scripts/measure-navigation-performance.mjs
  • scripts/test-service-worker-offline.mjs
  • src/components/landing/Footer.tsx
  • src/components/landing/Navbar.tsx
  • src/components/layout/AppLayout.tsx
  • src/hooks/use-route-prefetch.ts
  • src/hooks/use-subscription.ts
  • src/register-service-worker.ts
  • src/test/hooks/use-subscription.test.ts
  • src/test/register-service-worker.test.ts
  • src/test/use-route-prefetch.test.tsx
  • src/test/vercel-deployment-config.test.ts
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: a589d041-9aa6-448b-b27c-1edc0f384642

📥 Commits

Reviewing files that changed from the base of the PR and between c91378e and bdbdead.

⛔ Files ignored due to path filters (5)
  • docs/performance/smooth-navigation-final/desktop-delayed-filmstrip.png is excluded by !**/*.png
  • docs/performance/smooth-navigation-final/desktop-delayed.webm is excluded by !**/*.webm
  • docs/performance/smooth-navigation-final/pixel-5-delayed-filmstrip.png is excluded by !**/*.png
  • docs/performance/smooth-navigation-final/pixel-5-delayed.webm is excluded by !**/*.webm
  • public/favicon-72.png is excluded by !**/*.png
📒 Files selected for processing (25)
  • docs/architecture.md
  • docs/performance/smooth-navigation-final/README.md
  • docs/performance/smooth-navigation-final/final-1.json
  • docs/performance/smooth-navigation-final/final-3.json
  • docs/performance/smooth-navigation-final/task-11-audit.json
  • docs/testing.md
  • e2e/loading-performance.spec.ts
  • e2e/navigation-performance.spec.ts
  • e2e/public-pages.spec.ts
  • e2e/sparring.spec.ts
  • nginx.conf
  • package.json
  • public/sw.js
  • scripts/measure-navigation-performance.mjs
  • scripts/test-service-worker-offline.mjs
  • src/components/landing/Footer.tsx
  • src/components/landing/Navbar.tsx
  • src/components/layout/AppLayout.tsx
  • src/hooks/use-route-prefetch.ts
  • src/hooks/use-subscription.ts
  • src/register-service-worker.ts
  • src/test/hooks/use-subscription.test.ts
  • src/test/register-service-worker.test.ts
  • src/test/use-route-prefetch.test.tsx
  • src/test/vercel-deployment-config.test.ts
⚠️ Files not reviewed because their contents could not be fetched (2)
  • docs/performance/smooth-navigation-final/final-1.json
  • docs/performance/smooth-navigation-final/final-3.json

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The PR updates service-worker asset caching, React Query subscription state, navigation prefetching, logo assets, Nginx cache headers, performance measurement, offline smoke tests, and related documentation.

Changes

Offline navigation and performance

Layer / File(s) Summary
Subscription query caching
src/hooks/use-subscription.ts, src/test/hooks/use-subscription.test.ts, e2e/navigation-performance.spec.ts
useSubscription now uses React Query with cached subscription snapshots, error handling, refresh support, and a 60-second stale period. Tests cover provider setup, failures, refresh, remount recovery, and shared navigation reads.
Service-worker offline caching
public/sw.js, src/register-service-worker.ts, scripts/test-service-worker-offline.mjs, nginx.conf, package.json, docs/architecture.md, docs/testing.md, src/test/register-service-worker.test.ts, src/test/vercel-deployment-config.test.ts
The service worker caches visited asset chunks and the favicon. Registration reports loaded assets. Nginx applies URI-based cache policies. The production verification flow runs offline route and cache-isolation checks.
Navigation input and logo assets
src/hooks/use-route-prefetch.ts, src/test/use-route-prefetch.test.tsx, src/components/landing/*, src/components/layout/AppLayout.tsx, e2e/navigation-performance.spec.ts, e2e/public-pages.spec.ts, e2e/sparring.spec.ts
Hover prefetching now requires fine-pointer hover support. Application logos use /favicon-72.png with explicit dimensions. Tests cover coarse-pointer behavior and logo rendering.
Performance instrumentation and evidence
scripts/measure-navigation-performance.mjs, docs/performance/smooth-navigation-final/README.md, docs/performance/smooth-navigation-final/task-11-audit.json, e2e/loading-performance.spec.ts
The measurement harness adds event timing, main-thread, rendering, request-classification, and source-commit data. The performance report and audit artifact record navigation results, bundle data, and test limitations. The Jam recorder test skips WebKit runs without MediaRecorder.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant Registration
  participant ServiceWorker
  participant CacheStorage
  Browser->>Registration: load and observe /assets/ resources
  Registration->>ServiceWorker: send CACHE_VISITED_ASSETS
  ServiceWorker->>CacheStorage: cache accepted assets
  Browser->>CacheStorage: serve cached route and favicon offline
Loading

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.

…ance-followup

# Conflicts:
#	e2e/sparring.spec.ts
#	src/components/landing/Footer.tsx
#	src/components/landing/Navbar.tsx
#	src/components/layout/AppLayout.tsx
@Programcode

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 22, 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 ae57f46 into main Sep 22, 2026
7 checks passed
@Programcode
Programcode deleted the t3code/smooth-performance-followup branch September 22, 2026 19:20

This branch was successfully deployed

1 active deployment
Preview — e35abb9e Deployed Sep 22, 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