Make the accessibility scan read nested route folders

Offen Anfängerfreundlich
#30 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
92/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
react-native, typescript

Rechercherichtung

Beginne mit apps/mobile/src/a11y-scan.test.ts und füge den Test hinzu, der app/oauth/mcp.tsx in der Liste der gescannten Dateien erwartet; führe den Befehl aus dem Issue aus, um zu bestätigen, dass er fehlschlägt. Folge dann dem Beispiel mit rekursivem readdirSync in apps/mobile/src/icons.test.ts, behalte .tsx-Dateien bei und erstelle die erwarteten Pfade mit join(). Führe den gezielten Test und pnpm --filter @hermit/mobile test aus; fertig ist die Arbeit, wenn die erforderlichen Dateien gescannt werden und kein Steuerelement unbeschriftet ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.
Vorherrschende Sprache
TypeScript
Sterne
11
Forks
0
Ø Merge
10 Min.
Gemergte PRs (30 T.)
6

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus DojoCodingLabs/hermit

Alle Issues in DojoCodingLabs/hermit

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.