Skip to content

perf(seo,perf,a11y): mobile Lighthouse remediation — static routing, defer Sentry, async fonts, tap targets#82

Merged
KxlSys merged 2 commits into
mainfrom
claude/awesome-babbage-SmpXc
May 29, 2026
Merged

perf(seo,perf,a11y): mobile Lighthouse remediation — static routing, defer Sentry, async fonts, tap targets#82
KxlSys merged 2 commits into
mainfrom
claude/awesome-babbage-SmpXc

Conversation

@KxlSys
Copy link
Copy Markdown
Owner

@KxlSys KxlSys commented May 29, 2026

Context

Acts on the mobile Lighthouse audit (Perf 93, A11y 95, Best Practices 100, SEO 92 — Moto G Power / slow 4G, Lighthouse 13.3.0). Adds the audit as a repo doc and implements the highest-impact fixes. No application behavior is changed — only routing config, monitoring load timing, font loading strategy, and tap-target sizing.

Audit captured in AUDIT_BISOMAPTECH_MOBILE.md.

Changes

P0 — SEO blocker: static-file routing

  • Root cause: the SPA rewrite "/(.*)" → /index.html meant any missing static file fell through to index.html. robots.txt referenced /sitemap.xml, but no sitemap.xml existed, so /sitemap.xml returned HTML instead of a valid sitemap.
  • public/sitemap.xml added, listing the public pages (/, /talents, /lieux, /contributeurs, /matching, /a-propos).
  • vercel.json rewrite tightened with a negative-lookahead so files ending in known static extensions (.txt, .xml, .ico, images, .js, .css, fonts, …) are served as files. SPA routes — including paths containing dots like /contributeurs/john.doe — still resolve to index.html.
  • robots.txt keeps Allow: / + the sitemap reference, and adds Disallow for private/auth routes (/login, /onboarding, /auth/, /profil/edit, /admin, /messages).

P1 — Reduce unused JavaScript (~127 KiB)

  • Sentry was initialized synchronously in main.tsx, putting the full SDK on the critical path. It now loads via a dynamic import on requestIdleCallback (with a setTimeout fallback). Monitoring stays enabled (same DSN/config); it's just initialized off the critical path.
  • Build confirms sentry-*.js (~474 KiB / 157 KiB gzip) is no longer in the initial modulepreload graph.
  • Routes and Leaflet map components were already code-split via React.lazy (verified); Leaflet stays isolated to the lazy map chunk.

P1 — Render-blocking resources / fonts

  • Google Fonts now load non-blocking: preload + <link media="print" onload="this.media='all'"> swap + <noscript> fallback. display=swap and the system-font fallback are retained, so text paints immediately.

P2 — Mobile tap targets

  • Enlarged sub-44px touch targets on the mobile surface to ≥44px: top-bar login button (was h-7/28px), user-menu trigger (was h-8 w-8/32px), logo link, and the three home-page CTAs. The mobile header is sticky at a fixed h-12 (48px), so 44px controls fit without layout shifts.

Verification

  • npm run build (tsc + vite) ✅
  • npm test17/17 passing
  • Built dist/index.html checked: fonts non-blocking, Sentry absent from modulepreload, robots.txt + sitemap.xml emitted.

Notes / follow-ups (not changed here)

  • Domain mismatch worth aligning later: index.html canonical/OG use https://BisoMapTech.app while robots.txt/sitemap.xml (and the audited URL) use https://bisomaptech.vercel.app. Left as-is to avoid changing the intended production canonical without confirmation.

https://claude.ai/code/session_01GeeGao9xae3Pv31pyzK2sL


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Added XML sitemap to improve search engine indexing.
  • Bug Fixes

    • Optimized Google Fonts loading to non-blocking for faster performance.
    • Deferred error monitoring initialization to prevent rendering delays.
    • Fixed static asset routing for proper file serving.
    • Enlarged mobile UI touch targets for improved usability.
  • Chores

    • Updated robot crawling rules for private routes.
  • Documentation

    • Added mobile Lighthouse audit report with remediation details.

Review Change Stack

…ts, larger tap targets

SEO (P0): add public/sitemap.xml and tighten the vercel.json SPA rewrite with a negative-lookahead so static files (robots.txt, sitemap.xml, assets) are served as files instead of falling through to index.html; add Disallow rules for private routes in robots.txt.

Performance (P1): initialize Sentry off the critical rendering path via an idle-time dynamic import, moving ~157 KiB gzip out of the initial load without disabling monitoring. Load Google Fonts non-blocking (preload + media=print/onload swap + noscript fallback) while keeping the system-font fallback and display=swap.

Accessibility (P2): enlarge mobile tap targets to >=44px (top-bar login button, user-menu trigger, logo link, home-page CTAs). No application behavior changes.

Docs: add AUDIT_BISOMAPTECH_MOBILE.md documenting the mobile Lighthouse audit and remediation plan.

https://claude.ai/code/session_01GeeGao9xae3Pv31pyzK2sL
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

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

Project Deployment Actions Updated (UTC)
bisomaptech Ready Ready Preview, Comment May 29, 2026 2:22am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Warning

Review limit reached

@KxlSys, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 55 minutes and 4 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e4ec7a9d-0ca6-4c1d-b966-425396b2aa30

📥 Commits

Reviewing files that changed from the base of the PR and between cc72218 and 1bfacf3.

📒 Files selected for processing (1)
  • index.html
📝 Walkthrough

Walkthrough

This PR implements improvements identified in a mobile Lighthouse audit. It fixes SPA routing to preserve static assets, adds SEO configuration via sitemap and robot rules, defers Sentry initialization to avoid blocking initial render, loads Google Fonts non-blockingly, and enlarges touch targets for mobile UI controls.

Changes

Mobile Lighthouse Audit Remediations

Layer / File(s) Summary
SPA Routing and SEO Configuration
vercel.json, public/robots.txt, public/sitemap.xml
Vercel rewrite rules now exclude static assets from being funneled to index.html. robots.txt adds disallow directives for private routes (/login, /onboarding, /auth/, /profil/edit, /admin, /messages). sitemap.xml is populated with six public page entries and uniform lastmod metadata.
Performance Optimizations
src/main.tsx, index.html
Sentry initialization is deferred to browser idle via requestIdleCallback fallback setTimeout, using dynamic import to avoid blocking first render. Google Fonts loading switches from a single blocking stylesheet to a preload + media="print" swap pattern with noscript fallback, keeping display=swap for font visibility.
Mobile Touch Target Sizing
src/components/layout/navbar.tsx, src/pages/home-page.tsx
Navbar logo links and mobile user menu/login buttons are resized to fixed height h-11 (44px) and include updated text sizing and styling. Home page primary action buttons ("Talents", "Lieux", "Matching") are updated with fixed height h-11 to meet mobile tap target thresholds.
Mobile Audit Report
AUDIT_BISOMAPTECH_MOBILE.md
Comprehensive mobile Lighthouse audit report documents observed scores and the specific implemented remediations across SPA routing, SEO, performance, and mobile accessibility, with scope notes and reference to a separate desktop audit.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Our app now hops with faster grace,
Fonts load without the blocking race,
Touch targets grow, SEO shines bright,
Sentry defers till time is right!
Mobile Lighthouse beams with cheer—
Performance blooms this quarter here! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main changes: Lighthouse audit remediations addressing SEO (static routing), performance (defer Sentry, async fonts), and accessibility (tap targets) on mobile.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/awesome-babbage-SmpXc

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.

@KxlSys KxlSys marked this pull request as ready for review May 29, 2026 02:19
@KxlSys KxlSys enabled auto-merge (squash) May 29, 2026 02:19
@KxlSys KxlSys disabled auto-merge May 29, 2026 02:21
@KxlSys KxlSys merged commit bcd8a66 into main May 29, 2026
6 of 8 checks passed
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