Skip to content

fix(perf): CWV quick wins - charset, font-display swap, defer GTM, landmark main - #12

Merged
ChloeQuijano merged 7 commits into
mainfrom
claude/clever-swanson-322484
Dec 2, 2026
Merged

ChloeQuijano merged 7 commits into
mainfrom
claude/clever-swanson-322484

Conversation

@soohyunkoo

Copy link
Copy Markdown
Collaborator

Summary

Code-only changes to lift PageSpeed scores on cloudbrowserbenchmark.com (baseline: mobile 48/100, desktop 60/100).

  • website/src/app/layout.tsx: Move <meta charSet> first in <head> (HTML spec / Best Practices fix); add display: 'swap' to DM Sans and Fraunces (unblocks FCP/LCP render); move GTM loader and gtag init to <Script strategy="afterInteractive"> to defer JS execution and reduce Total Blocking Time.
  • website/src/components/Dashboard.tsx: Top-level <div> → <main> (adds the missing page landmark, fixes accessibility score).
  • website/src/app/about/page.tsx: <div> wrapper → <main> (landmark fix); update page title, meta description, and Open Graph tags to use benchmark-specific copy; update H1 to match.

Test plan

  • cd website && npm run build passes with no type errors
  • PageSpeed Insights mobile and desktop scores improve (re-run after deploy)
  • No theme flash on page load (themeInit still runs synchronously)
  • GTM/GA4 events fire in the Network tab after page load

🤖 Generated with Claude Code

SOOHYUN KOO and others added 2 commits December 1, 2026 14:38
…a11y

- Add <meta charSet="utf-8"> as first element in <head> (must be in first 1024 bytes)
- Add display: 'swap' to DM_Sans and Fraunces font configs (reduces FCP/LCP blocking)
- Move GTM and gtag scripts to <Script strategy="afterInteractive"> (reduces TBT)
- Keep themeInit as sync inline script (must run before first paint to avoid flash)
- Change Dashboard.tsx top-level <div> to <main> (accessibility landmark)
- Change about/page.tsx both return paths <div> to <main> (accessibility landmark)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ranch

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@netlify

netlify Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for browser-benchmark ready!

Name Link
🔨 Latest commit 5fe775d
🔍 Latest deploy log https://app.netlify.com/projects/browser-benchmark/deploys/6b1034019ece3a33b5327560
😎 Deploy Preview https://deploy-preview-12--browser-benchmark.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

SOOHYUN KOO and others added 2 commits December 2, 2026 13:09
… with PR #14

Dashboard.tsx: take main's on-demand loading refactor (useViewSummary, initial prop,
rowsReady) and apply the <div> → <main> CWV landmark change on the outer wrapper.

about/page.tsx: keep CWV's SEO metadata (title, description, openGraph) and <main>
landmark while updating MethodologySection to use the explicit MethodologySummary
props format introduced in PR #14.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lify build

page.tsx now uses buildBenchmarkVersions/defaultView from the new versions.ts
module, matching the Dashboard props interface (regions: string[]) introduced
in PR #14.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SOOHYUN KOO and others added 2 commits December 2, 2026 13:21
Dashboard.tsx (taken from main) imports DEFAULT_REGION, summaryDataPath, and
SummaryWithoutRows from @/lib/summary-data, which was added in PR #14 but was
missing from this branch.

aggregate.ts also needed syncing to main: adds ProviderRowStats interface,
hasFullStealth field on Summary, providerRowStats field on Summary, and updates
hasFullStealthCoverage to use the narrower Pick<Summary, hasFullStealth> param.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…in (PR #14)

Dashboard.tsx (from main) passes rowsReady to ResultsTable and FailureExplorer,
and disabled to CopyPageButton — props that the old CWV versions of these
components did not declare. Also syncs MethodologySection to use the narrower
MethodologySummary type (matching the about/page.tsx fix already committed).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ChloeQuijano
ChloeQuijano previously approved these changes Dec 2, 2026
@ChloeQuijano
ChloeQuijano marked this pull request as ready for review December 2, 2026 15:05
Resolve about/page.tsx conflict by keeping the <main> landmark closing tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Xrazik1

Xrazik1 commented Dec 2, 2026

Copy link
Copy Markdown

Tested at 5fe775d7, against main at d33a0dbc. No findings.

Ran locally.

What I ran

  • Repo checks: on Node 26.13.0 in a Linux container, npm ci, then lint, typecheck, the test suite (518 of 518 pass) and the static site build, on both main and this head. All pass on both.
  • The built site in headless Chromium: I served both static builds and loaded the home page and /about/ at 1280×900.
    • Each page has exactly one <main>, and no console errors or page errors.
    • The Google Tag Manager script is injected after hydration, and window.dataLayer is populated, so tracking still runs with the scripts moved to next/script with afterInteractive. In the HTML, the GTM script now loads through a preload link rather than a blocking tag in the head.
    • /about/ now carries its own title, description, canonical URL and Open Graph tags. The home page's metadata is unchanged from main.
    • Both fonts are emitted with font-display: swap, the same as on main, where it is already the next/font default.
  • CI: every check passes at this head.

Not covered

  • Lighthouse scores. I checked that the scripts are deferred, not how much the blocking time changes on a real device.
  • Whether the GTM container's tags fire in production. Locally I can see that the container script loads, not what it does with the data.

Security

  • 1 of 16 attack classes applies: web client surfaces, because the change moves a third-party script and an inline script.
    • The GTM URL and container ID are the same as on main, and the inline gtag setup is the same constant, now passed as children of next/script. No user input reaches either.
    • No new dependencies.
  • /security-review on this PR found nothing.

@Xrazik1 Xrazik1 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.

No findings at 5fe775d7; see the test report.

@ChloeQuijano
ChloeQuijano merged commit c9259fc into main Dec 2, 2026
9 checks passed
@ChloeQuijano
ChloeQuijano deleted the claude/clever-swanson-322484 branch December 2, 2026 15:57
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.

3 participants