Make the accessibility scan read nested route folders

Open Beginner friendly
#30 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
92/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
react-native, typescript

Research direction

Start with apps/mobile/src/a11y-scan.test.ts and add the test that expects app/oauth/mcp.tsx in the scanned file list; run the command in the issue to confirm it fails. Then follow the recursive readdirSync example in apps/mobile/src/icons.test.ts, keeping .tsx files and building expected paths with join(). Run the focused test and pnpm --filter @hermit/mobile test; done means the required files are scanned and no control is unlabelled.

Written by the indexing model from the issue text.

Description

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.
Dominant language
TypeScript
Stars
11
Forks
0
Avg merge
10m
Merged PRs (30d)
6

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DojoCodingLabs/hermit

All issues in DojoCodingLabs/hermit

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.