Skip to content

feat: enhance accessibility and styling across the application with s… - #100

Merged
devaraj3 merged 1 commit into
mainfrom
perf/code-split-viewer-and-a11y-fixes
Aug 7, 2026
Merged

feat: enhance accessibility and styling across the application with s…#100
devaraj3 merged 1 commit into
mainfrom
perf/code-split-viewer-and-a11y-fixes

Conversation

@devaraj3

@devaraj3 devaraj3 commented Aug 7, 2026

Copy link
Copy Markdown
Owner

What changed

1. Code-split the CAD viewer away from non-viewer routes (main fix)

  • App (the full CAD viewer engine — Three.js, OpenCascade WASM wiring) was statically imported in main.tsx, the shared entry point for every route. Even though /viewer wraps it in <ClientOnly>, that only prevents server-rendering — the browser was still downloading and parsing the entire viewer bundle on the landing page and guide pages, which never use it at all.
  • Fixed via React.lazy(() => import("./ui/App")) + <Suspense>, so it's now a separate chunk only fetched when someone actually navigates to /viewer
  • Confirmed via build output: one monolithic 1,625 KB bundle → 372 KB shared chunk + 1,250 KB viewer-only chunk, verified via network capture that / and /guides/split-step-assembly no longer fetch the viewer chunk or its WASM worker at all

2. Fixed insufficient button contrast

  • Flagged by PageSpeed's accessibility audit: white text on #3b82f6 measured 3.68:1, failing WCAG AA (needs 4.5:1)
  • Changed idle state to #2563eb (5.17:1, passes), #1d4ed8 on hover — applied to both the landing page CTA and the viewer header's Upload button

3. Added <main> landmark

  • Missing on Landing and the guide page (the viewer already had one) — added for screen-reader navigation

4. Fixed llms.txt link formatting

  • The Guides and Live app entries weren't using proper markdown link syntax, which PageSpeed's Agentic Browsing check flagged as "does not appear to contain any links" — converted to [text](url) format

Why

  • Google's PageSpeed Insights flagged a 5,110ms Total Blocking Time on the landing page — meaning the page looked ready at 0.9s but was actually unresponsive to input for 5+ seconds while the (unused, on that page) viewer bundle parsed in the background. This is both a real visitor-facing UX problem and a genuine Core Web Vitals ranking factor
  • The other three fixes were concrete, specific issues from the same report, not speculative changes

Validation

  • Build output confirms separate chunks; network capture confirms non-viewer routes don't fetch the viewer bundle
  • /viewer loaded and fully tested: file upload, orbit, Measure, Wireframe toggle, view-cube (FRONT face confirmed) all functional after lazy-loading
  • Full regression matrix (STEP single/assembly, IGES, STL, OBJ) — zero console errors
  • typecheck and lint clean
  • Contrast ratio verified numerically (5.17:1, passes AA) — not just visually judged
  • Live PageSpeed Insights re-run on the deployed site, to get a real, comparable Total Blocking Time number (local Lighthouse numbers use different hardware/scaling than PSI's cloud runner, so they're directionally correct but not the same absolute figure)

Notes

  • The wireframe density sliders remain intentionally hidden (SHOW_WIREFRAME_DENSITY_CONTROLS = false) — unrelated pre-existing state, not touched by this work

@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
cad-viewer Ready Ready Preview Aug 7, 2026 6:57am

@devaraj3
devaraj3 merged commit ed720cf into main Aug 7, 2026
6 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.

1 participant