CodeForPhilly / CodeForPhilly/codeforphilly-ng

Render breadcrumbs from the shell via route handles (useMatches) so skip-to-main clears them

未关闭
#166 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
TypeScript
星标
1
派生
1
平均合并
5 天 3 小时
30 天内合并 PR
9

描述

## Context

PR #157 wired `Breadcrumbs.tsx` into the six screens that `specs/behaviors/app-shell.md` names. Each screen renders `` itself as a fragment sibling above its content container, because that was the minimal change that made the spec's trail table true.

## Problem

`app-shell.md` describes the breadcrumb row as part of the *shell* ("an optional row below the header ... a screen opts in by declaring a `breadcrumbs` trail"), and the shell's skip link targets ``. With the crumbs rendered inside each screen, "skip to main content" lands on the breadcrumb nav rather than past it, and every screen repeats the same import + placement.

## Proposal

Render breadcrumbs once from `AppShell`, sourced from route `handle`s via `useMatches()` (React Router v7). Each opted-in route declares its trail on its `handle` (with loader/query data supplying the dynamic segment), and the six per-screen `` calls go away. The row then sits between the header and ``, so the skip link clears it.

Scope: `apps/web/src/components/AppShell.tsx`, the router config, and the six screens (`ProjectDetail`, `ProjectEdit`, `PersonDetail`, `TagDetail`, `Account`, plus the create variant). Tests in `ProjectDetail.test.tsx` / `PersonDetail.test.tsx` assert the trails and should keep passing.

Deferred from `plans/a11y-mechanical.md` (PR #157).

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start with apps/web/src/components/AppShell.tsx and the router config, then inspect the six named screens and the route-trail behavior in ProjectDetail.test.tsx and PersonDetail.test.tsx. Verify that opted-in route handles provide the expected trails, the per-screen Breadcrumbs calls are removed, the row sits before , and the skip link bypasses it while the tests continue to pass.

由索引模型根据 Issue 内容生成。

评估

技术栈
react, typescript
领域
accessibility, frontend
Issue 类型
重构
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
54/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。