Skip to content

feat: add --accessible flag for screen reader friendly TUI output#20

Merged
digitarald merged 3 commits into
mainfrom
feat/accessible-mode
Mar 2, 2026
Merged

feat: add --accessible flag for screen reader friendly TUI output#20
digitarald merged 3 commits into
mainfrom
feat/accessible-mode

Conversation

@digitarald

@digitarald digitarald commented Feb 27, 2026

Copy link
Copy Markdown
Collaborator

Adds a global --accessible CLI flag that replaces Unicode symbols with screen-reader-friendly text across all TUI components. Also responds to Ink's INK_SCREEN_READER env var.

Changes

  • CLI plumbing: New --accessible global option merged via withGlobalOpts(), following existing --json/--quiet pattern
  • Ink integration: Passes isScreenReaderEnabled to Ink's render(); components use useIsScreenReaderEnabled() hook (no prop-drilling)
  • UI accessible mode: Replaces Unicode symbols (✓✗◉○❯→●▶▍) with text (OK, FAIL, [x], [ ], >, -, etc.), removes borders, simplifies banner to plain "AGENTRC"
  • Eval results: Accessible format uses Verdict: PASS/FAIL/UNKNOWN id (score:N tokens) instead of redundant symbol+id lines
  • Repo status labels: HAS_INSTRUCTIONS/NEEDS_INSTRUCTIONS replace terse / in batch repo lists
  • Tests: 2 new test cases for --accessible merging + updated existing expectations (all 473 pass)

Files changed

File Summary
src/cli.ts --accessible global option, withGlobalOpts() merge
src/commands/tui.tsx Pass isScreenReaderEnabled to render, skip animation
src/commands/batch.tsx Pass isScreenReaderEnabled to both GitHub/Azure paths
src/commands/batchReadiness.tsx Pass isScreenReaderEnabled to render
src/ui/AnimatedBanner.tsx Plain "AGENTRC" text when accessible
src/ui/tui.tsx Status icons, borders, eval results, model/area pickers
src/ui/BatchTui.tsx Selection/result symbols, borders
src/ui/BatchTuiAzure.tsx Selection/processing/result symbols, borders
src/ui/BatchReadinessTui.tsx Selection indicators, complete marker
src/services/__tests__/cli.test.ts 2 new tests + updated expectations

Addresses review feedback from #16.

Copilot AI review requested due to automatic review settings February 27, 2026 22:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a global --accessible CLI flag to enable screen-reader-friendly output in the Ink-based TUIs, using Ink’s isScreenReaderEnabled/useIsScreenReaderEnabled() to avoid prop-drilling and replacing many Unicode UI glyphs with plain text.

Changes:

  • Adds --accessible as a global CLI option and merges it into command options via withGlobalOpts().
  • Passes isScreenReaderEnabled into Ink render() for TUI commands and updates TUI components to use useIsScreenReaderEnabled().
  • Updates multiple TUIs/banners to remove borders and replace Unicode icons/arrows/selection glyphs with accessible text equivalents.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/cli.ts Adds --accessible global flag and merges it into per-command options in withGlobalOpts().
src/services/tests/cli.test.ts Updates withGlobalOpts expectations and adds coverage for accessible merging/defaulting.
src/commands/tui.tsx Passes isScreenReaderEnabled into Ink render and disables animation when accessible.
src/commands/batch.tsx Passes isScreenReaderEnabled into Ink render for both GitHub and Azure batch TUIs.
src/commands/batchReadiness.tsx Passes isScreenReaderEnabled into Ink render for batch readiness TUI.
src/ui/tui.tsx Uses screen-reader mode to swap status glyphs, borders, cursors, and eval result formatting.
src/ui/BatchTui.tsx Replaces selection markers and status icons with accessible equivalents; removes borders in accessible mode.
src/ui/BatchTuiAzure.tsx Same accessibility substitutions as GitHub batch TUI, including instruction status labels.
src/ui/BatchReadinessTui.tsx Swaps selection markers and completion icon for accessible-friendly text.
src/ui/AnimatedBanner.tsx Disables animation and renders a simplified “AGENTRC” banner when screen-reader mode is enabled.
Comments suppressed due to low confidence (2)

src/ui/tui.tsx:1143

  • The accessible eval summary string includes formatTokens(r), which currently returns a string containing the Unicode bullet ("tokens w/: ... • w/o: ..."). This means accessible mode still emits Unicode symbols and shorthand like w/:/w/o:. Consider making formatTokens produce a fully text-based format when accessible is enabled (e.g., "tokens with: X; without: Y").
                  {accessible
                    ? `Verdict: ${r.verdict === "pass" ? "PASS" : r.verdict === "fail" ? "FAIL" : "UNKNOWN"} ${r.id} (score:${r.score} ${formatTokens(r)})`
                    : `${r.verdict === "pass" ? "✓" : r.verdict === "fail" ? "✗" : "?"} `}

src/ui/BatchReadinessTui.tsx:320

  • Same whitespace/newline issue as the org selection list: the bracketed selection marker is split across lines inside a <Text>, which can introduce literal whitespace/newlines in terminal rendering. Consider keeping [...] contiguous (e.g., > [x] repo vs > [ ] repo) to ensure stable layout.
                <Text key={actualIndex}>
                  {actualIndex === cursorIndex ? ">" : " "} [
                  {selectedRepoIndices.has(actualIndex) ? (accessible ? "x" : "●") : " "}]{" "}
                  {repo.fullName}
                </Text>

Comment thread src/ui/tui.tsx
Comment thread src/ui/BatchReadinessTui.tsx
@digitarald digitarald marked this pull request as ready for review February 28, 2026 01:09
Copilot AI review requested due to automatic review settings February 28, 2026 01:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.

Comments suppressed due to low confidence (1)

src/commands/batch.tsx:99

  • Same as above: passing { isScreenReaderEnabled: Boolean(options.accessible) } forces screen reader mode off by default and can override INK_SCREEN_READER. Consider omitting the option when --accessible is false/undefined, or computing it from both the CLI flag and env var.
    const { waitUntilExit } = render(<BatchTui token={token} outputPath={options.output} />, {
      isScreenReaderEnabled: Boolean(options.accessible)
    });

Comment thread src/commands/tui.tsx Outdated
Comment thread src/commands/batchReadiness.tsx Outdated
Comment thread src/commands/batch.tsx
Comment thread src/ui/tui.tsx
Comment thread src/ui/tui.tsx Outdated
Comment thread src/ui/BatchTui.tsx Outdated
Comment thread src/ui/BatchTuiAzure.tsx Outdated
- Only pass isScreenReaderEnabled when --accessible is set, preserving
  Ink's INK_SCREEN_READER env var detection
- Fix AnimatedBanner stuck intro state when accessible mode enabled via
  env var by initializing status to idle and calling onComplete unconditionally
- Replace underscore labels (HAS_INSTRUCTIONS) with spaced text
  (Has Instructions) for screen reader clarity
- Make Divider component use ASCII characters in accessible mode
@digitarald digitarald merged commit 6a3c3b4 into main Mar 2, 2026
9 checks passed
@digitarald digitarald deleted the feat/accessible-mode branch March 2, 2026 19:26
github-actions Bot pushed a commit that referenced this pull request Mar 2, 2026
Add --accessible to Global Options in README.md and update
.github/copilot-instructions.md to reflect the new global flag
introduced in #20.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants