Skip to content

Add per-page metadata titles for client-rendered routes #23

@mikewheeleer

Description

@mikewheeleer

Improve document titles for client-component routes

Description

The root layout defines a title template (%s — AgentPay) in src/app/layout.tsx, and a few server pages (settings, docs, about, export, changelog metadata) export metadata. But the many "use client" pages — services, usage, agents, admin, stats, events, webhooks, api-keys, search — cannot export metadata, so they all share the default "AgentPay" title, hurting screen-reader orientation and tab identification. This issue gives each route a distinct title.

Requirements and context

  • Repository scope: Agentpay-Org/Agentpay-frontend only.
  • For each client page, add a colocated server layout.tsx (or split a small server wrapper) exporting metadata.title so the template produces e.g. "Services — AgentPay".
  • Keep the page components as client components; do not convert their interactive logic to server.
  • Ensure dynamic routes (/services/[serviceId], /agents/[agent]) get a sensible title via generateMetadata where feasible.

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b a11y/routing-24-page-titles
  • Implement changes
    • Write code in: add layout.tsx files under the relevant src/app/<route>/ folders.
    • Write comprehensive tests in: since metadata is build-time, add a small test asserting the exported metadata.title constants where extracted, e.g. src/app/services/layout.test.tsx.
    • Add documentation: list the per-route titles in README.md.
    • Validate titles render in npm run build output / browser tab.
  • Test and commit

Test and commit

  • Run npm run lint, npm run typecheck, npm test, and npm run build.
  • Cover edge cases: dynamic route titles and the template fallback for the home route.
  • Include the npm test output and a note of the resulting titles.

Example commit message

feat(routing): add distinct document titles for client-rendered pages

Guidelines

  • Minimum 95 percent test coverage for any extracted title module.
  • Clear, reviewer-focused documentation.
  • Timeframe: 96 hours.

Community & contribution rewards

  • 💬 Join the AgentPay community on Discord for questions, reviews, and faster merges: https://discord.gg/eXvRKkgcv
  • ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward.

Metadata

Metadata

Assignees

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions