Skip to content

fix: add per-page metadata to dashboard, download, and community pages#11

Open
bokiko wants to merge 4 commits intomainfrom
auto/improve-2026-03-20-bugfix
Open

fix: add per-page metadata to dashboard, download, and community pages#11
bokiko wants to merge 4 commits intomainfrom
auto/improve-2026-03-20-bugfix

Conversation

@bokiko
Copy link
Owner

@bokiko bokiko commented Mar 20, 2026

Problem

All three main pages (/dashboard, /download, /community) had "use client" at the top level. In Next.js App Router, client components cannot export metadata — so every page fell back to the generic layout title/description. The template: "%s | PingDiff" in layout.tsx was dead code for these routes.

Concrete impact:

  • Sharing any page on Discord, Twitter, or iMessage showed the homepage title and description
  • Browser tab always read "PingDiff - Test Your Game Server Connection" regardless of which page you were on
  • Search engines indexed all three pages with duplicate meta descriptions

Fix

Split each page into two files following the standard App Router pattern:

File Role
page.tsx Server component — exports metadata, renders the client component
*Client.tsx Client component — all interactive state (useState, useEffect, etc.)

No logic was changed; this is a pure structural refactor.

Result

Route Title Description
/dashboard Dashboard | PingDiff View your ping test results, packet loss trends...
/download Download | PingDiff Download PingDiff for Windows — free, open source...
/community Community | PingDiff Share connection tips, compare ping results...

Each page also gets its own og:title and og:description for correct social previews.

Verification

  • npm run build — passes with no errors
  • eslint — no lint errors introduced

bokiko added 4 commits March 20, 2026 00:12
…links

Comprehensive accessibility pass covering the dashboard, navbar, and
secondary pages. Zero new dependencies, no feature regressions.

Changes by file:

web/src/app/dashboard/page.tsx
- Add <a href="#main-content"> skip link (keyboard users can bypass nav)
- Add id="main-content" to <main> anchor target
- Wrap stats card grid in role="region" aria-label for screen readers
- Add aria-label to each stat card with full readable description
- Mark decorative icons with aria-hidden="true"
- Add role="img" + aria-label to both chart containers describing data
- Add aria-label to <table> with visible result count
- Add scope="col" to all <th> elements (required for table semantics)
- Wrap result timestamps in <time dateTime={...}> for machine readability
- Add aria-label to ping and packet-loss <td> cells (color is not the
  only indicator of quality — text label now read aloud by screen readers)

web/src/components/Navbar.tsx
- Add aria-label="Main navigation" to <nav> (landmark is now named)
- Add aria-haspopup="true" to mobile menu toggle button
- Add role="menu" + aria-label to mobile menu container
- Improve mobile toggle aria-label wording to be more descriptive

web/src/app/community/page.tsx
web/src/app/download/page.tsx
- Add skip-to-content link and id="main-content" (these pages were
  missing both, making keyboard-only navigation significantly harder)
All three pages used 'use client' at the top level, which prevents
Next.js from exporting the metadata object. As a result, every page
shared the same generic homepage title and description — the
layout.tsx template ('%s | PingDiff') was dead code for these routes.

Fix: split each page into a thin server wrapper (exports metadata)
and a client component (holds all interactive state). This is the
standard App Router pattern for mixing metadata with client-side state.

Each page now has a distinct <title> and <meta description>:
  /dashboard  → 'Dashboard | PingDiff'
  /download   → 'Download | PingDiff'
  /community  → 'Community | PingDiff'

Also adds per-page og:title and og:description so social shares
(Twitter, Discord, iMessage) show accurate previews instead of the
generic homepage copy.

Build verified clean (no TypeScript or ESLint errors).
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