Skip to content

perf/a11y: Optimize website Lighthouse Performance and Accessibility scores (#1294) - #1626

Open
pratapashanmukhi wants to merge 1 commit into
CodeGraphContext:mainfrom
pratapashanmukhi:optimize-performance-accessibility-1294
Open

perf/a11y: Optimize website Lighthouse Performance and Accessibility scores (#1294)#1626
pratapashanmukhi wants to merge 1 commit into
CodeGraphContext:mainfrom
pratapashanmukhi:optimize-performance-accessibility-1294

Conversation

@pratapashanmukhi

Copy link
Copy Markdown

Description

This PR resolves #1294 by optimizing the website's initial loading performance and resolving key accessibility violations reported by Lighthouse.


Key Optimizations

1. Performance (Lighthouse Score target: 90+)

  • Route-based Code Splitting: Converted static imports for all pages (Index, Explore, PRReviewerPage, Privacy, NotFound) to dynamic imports using React.lazy and Suspense. This keeps heavy dependencies out of the initial load.
  • Component-level Code Splitting: Lazy-loaded the main CodeGraphViewer component. This prevents heavy graph libraries (Three.js, force graphs, Sigma, Web Tree Sitter) from loading when visitors land on the homepage.
  • YouTube Video Facade: Replaced the immediate iframe loading of the YouTube video in DemoSection with a static thumbnail facade, loading the third-party iframe script only on-demand when clicked.

Resulting Bundle Size Reduction:

  • The initial entrypoint JavaScript bundle size dropped by 82.4%!
Chunk / Asset Before Optimization After Optimization Change
Initial JS Entrypoint 2,622.04 kB 460.24 kB -82.4% (148.89 kB gzip)
Main Page Included in Entrypoint 125.60 kB Split to async
CodeGraphViewer Component Included in Entrypoint 117.42 kB Split to async
Visualizer Core (Three/Sigma) Included in Entrypoint 1,437.10 kB Split to async

2. Accessibility (Lighthouse Score target: 95+)

  • Interactive Element ARIA Labels: Added missing aria-label tags to the GitHub remote repository links, theme toggle triggers, mobile navigation menu toggle buttons, and floating page scroll controls.
  • Form Labels & Inputs: Associated maximum nodes and edges sliders with their respective labels via matching id and htmlFor attributes, and added descriptive aria-label controls for the drag-and-drop file upload fields.
  • Heading Progression: Changed sub-headings from <h3> to <h2> on the Privacy page to satisfy sequentially-descending heading rules.
  • Single Page H1: Embedded a visually hidden <h1> element on the CodeGraphViewer full-screen page to ensure screen readers always register a main page title.

Verification Plan

  • Run npm run build to confirm compiling succeeds and chunk assets are generated properly.
  • Visually tested all page routing transitions and checked that the YouTube demo iframe plays properly on click.

Closes #1294

@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

@pratapashanmukhi is attempting to deploy a commit to the shashankss1205's projects Team on Vercel.

A member of the Team first needs to authorize it.

@pratapashanmukhi

Copy link
Copy Markdown
Author

Hi maintainers! 👋

Could you please review these optimizations and approve the workflow runs/deployments for this PR?

I have successfully built and tested the changes locally:

  • Performance: Reduced the initial page load JS entrypoint size by 82.4% (from 2.62MB to 460KB) via route-based and component-level code-splitting, along with a YouTube video facade.
  • Accessibility: Resolved Lighthouse issues including missing aria-label tags, incorrectly matched sliders, heading progression issues, and a missing main H1.

Thank you!

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

Labels

None yet

Projects

Status: Backlog tasks

Development

Successfully merging this pull request may close these issues.

Improve Lighthouse Performance (61) and Accessibility (81) scores

1 participant