Make the accessibility scan read nested route folders

Aperta Adatta ai principianti
#30 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
92/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
react-native, typescript

Direzione di ricerca

Inizia da apps/mobile/src/a11y-scan.test.ts e aggiungi il test che si aspetta app/oauth/mcp.tsx nell’elenco dei file analizzati; esegui il comando indicato nell’issue per confermare che fallisce. Poi segui l’esempio di readdirSync ricorsivo in apps/mobile/src/icons.test.ts, mantieni i file .tsx e costruisci i percorsi attesi con join(). Esegui il test mirato e pnpm --filter @hermit/mobile test; il lavoro è terminato quando vengono analizzati i file richiesti e nessun controllo è privo di etichetta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

agent-friendly good first issue

Why

apps/mobile/src/a11y-scan.test.ts checks that every control on every screen has a role and a TalkBack label, but it only reads files directly inside src/app and src/components, so screens in subfolders such as src/app/oauth/ are never scanned. ROADMAP.md, Now: fewer rough edges in the everyday loop.

What to do

Today src/app/oauth/mcp.tsx and src/app/oauth/microsoft.tsx have no controls, so nothing is missed yet; the next control added in a subfolder would be. The list also names app-lock.tsx by hand.

  1. Test first: add a test that the list of scanned files includes app/oauth/mcp.tsx. Run it and watch it fail.
  2. Build the list with readdirSync(dir, { recursive: true }), as apps/mobile/src/icons.test.ts does, keeping .tsx files. Instead of naming app-lock.tsx by hand, include every .tsx file directly inside src.
  3. Run the whole file. The scan must still find no unlabelled control.

Done when

  • The scan reads every .tsx file under src/app and src/components at any depth, and every .tsx file directly inside src.
  • pnpm --filter @hermit/mobile test passes.

How to check

(cd apps/mobile && node --test --experimental-strip-types src/a11y-scan.test.ts)
pnpm --filter @hermit/mobile test

Keep in mind

  • Change only a11y-scan.test.ts, and a11y-scan.ts only if you must. If the wider scan finds a control without a label, fix it in its own pull request: that one changes a screen and needs screenshots.
  • readdirSync with recursive returns paths with the system's separator. Build expected paths with join(), so the test passes on Windows too.
Lingua principale
TypeScript
Stelle
11
Fork
0
Merge medio
10m
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DojoCodingLabs/hermit

Tutte le issue di DojoCodingLabs/hermit

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.