CodeForPhilly / CodeForPhilly/codeforphilly-ng
ExternalLink component for the 16 hand-rolled "(opens in new tab)" links
- Ngôn ngữ chính
- TypeScript
- Star
- 1
- Fork
- 1
- Merge trung bình
- 5 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 9
Mô tả
## Context
PR #157 added a new-tab cue to every `target="_blank"` link in `apps/web`: ` (opens in new tab)` where the link has visible text, or appended to the `aria-label` where it does not. That is 16 copies across 9 files (`AppFooter`, `AppHeader`, `ProjectCard`, `ActivityCard`, `LoginPlaceholder`, `Account`, `PersonDetail`, `ProjectDetail`, `Volunteer`).
## Problem
The cue text, the `rel="noopener noreferrer"`, and the `target` are re-typed at every site. A future link will forget one of them, and changing the wording (or adding a visual icon) means touching 16 places.
## Proposal
An `ExternalLink` component in `apps/web/src/components/` that takes `href` + children, sets `target`/`rel`, and appends the sr-only cue (or merges it into a supplied `aria-label`). Migrate the 16 sites; the existing accessible-name assertions in the test suite (regex matchers on `/\(opens in new tab\)$/`) cover the migration.
Deferred from `plans/a11y-mechanical.md` (PR #157).
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Start in apps/web/src/components/ and inspect the 16 target links across AppFooter, AppHeader, ProjectCard, ActivityCard, LoginPlaceholder, Account, PersonDetail, ProjectDetail, and Volunteer. Run the existing accessible-name tests, then confirm every site uses the shared component and the assertions still match the new-tab cue, target, and rel behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- typescript
- Lĩnh vực
- accessibility, frontend
- Loại issue
- Tái cấu trúc
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 74/100