CodeForPhilly / CodeForPhilly/codeforphilly-ng

MarkdownEditor toolbar: use Radix Toolbar from radix-ui instead of the hand-rolled roving tabindex

Ouverte Adaptée aux débutants
#169 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
enhancement
Langage dominant
TypeScript
Étoiles
1
Forks
1
Merge moyen
5 j 3 h
PR mergées (30 j)
9

Description

## Context

PR #157 gave `MarkdownEditor`'s formatting buttons `role="toolbar"`, real names, and a hand-rolled roving tabindex (`activeButton` state + a keydown handler for Arrow/Home/End).

## Problem

The roving tabindex is ~30 lines of bespoke focus management that duplicates what Radix's `Toolbar` primitive already does (roving focus, orientation, `Home`/`End`, RTL, and correct `tabIndex` bookkeeping). `radix-ui` is already a dependency of `apps/web` (`radix-ui@^1.4.3`) and exports `Toolbar`, so no new package is needed.

## Proposal

Replace the `

` + `handleToolbarKeyDown` + `toolbarRefs`/`activeButton` with `Toolbar.Root` / `Toolbar.Button` from `radix-ui`, keeping the `aria-label="Formatting"` and per-button names. `apps/web/tests/MarkdownEditor.test.tsx` already covers the single-tab-stop and Arrow/Home/End behaviour and should pass unchanged.

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Start with the MarkdownEditor implementation and compare its toolbar markup, activeButton state, toolbarRefs, and keydown handler with the Radix Toolbar API. Run apps/web/tests/MarkdownEditor.test.tsx; done means the hand-rolled focus management is replaced while the existing single-tab-stop and Arrow/Home/End behavior still passes.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
react, typescript
Domaine
accessibility, frontend
Type d'issue
Refactorisation
Difficulté
2/5
Temps estimé
1-3 heures
Activité
Active
Clarté
Clairement spécifiée
Accessibilité débutants
82/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.