Skip to content

feat: announce the logical focus and states to Narrator - #149

Merged
nextestudios merged 1 commit into
mainfrom
feature/40-narrator
Sep 27, 2026
Merged

nextestudios merged 1 commit into
mainfrom
feature/40-narrator

Conversation

@nextestudios

Copy link
Copy Markdown
Owner

Summary

  • The XAML focus stays on the window root while the logical focus lives in AppController, so Narrator used to hear nothing when the controller moved the focus. Now:
    • AppController.DescribeFocus() (Application, testable) says where the focus is and what is focused. The context covers home, folder, archive, search results, recycle bin, menus, dialogs (title, lines, message), the on-screen keyboard, the controller wizard, the path bar and tabs. The item gets name, type, size, "N de M" and states in words: marcado, recortado, bloqueado: motivo, com senha, oculto, and indisponível: motivo for menu items and keys.
    • TakeAnnouncement() returns the full context only when it changes and just the item while moving inside it. Nothing is repeated.
    • MainWindow raises a UI Automation notification (ImportantMostRecent) for each announcement, mirrors it in the root's automation name (so Caps+Tab repeats it) and makes the status line a polite live region. Bottom-bar messages are read without moving the focus.
  • Existing per-element names (rows, tiles, breadcrumbs, tabs, keys, prompts) stay as they are. Type/size texts now come from one helper (EntryText) shared by rows and announcements.
  • The app uses no sound or vibration; every state is already text plus a shape, and now also speech.

Tests

  • CI: ScreenReaderJourneyTests walks home → folder → mark → cut → menu with a disabled item → back → exit dialog and asserts exactly what would be announced, including that an unchanged state announces nothing.
  • Manual (docs/TESTING.md, "Narrador (enhancement: screen reader (Narrator) support pass #40)"): real Narrator with a controller across list, grid, menus, dialogs, keyboard, path bar, tabs and bottom-bar messages. These can't run in CI.

Closes #40

🤖 Generated with Claude Code

- AppController.DescribeFocus/TakeAnnouncement build what a screen reader
  should say: the context when it changes (home, folder, archive, search,
  recycle bin, menu, dialog, on-screen keyboard, path bar, tabs) and then
  only the focused item, with type, size, position and states in words
  (marked, cut, blocked, password, unavailable with the reason).
- MainWindow raises a UI Automation notification for each new announcement,
  mirrors it in the root's name and makes the status line a polite live
  region.
- Row type and size texts come from one Application helper shared with the
  announcements.
- Journey test for the announcements; manual Narrator checks in TESTING.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nextestudios
nextestudios merged commit 054476e into main Sep 27, 2026
1 check passed
@nextestudios
nextestudios deleted the feature/40-narrator branch September 27, 2026 05:16
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.

enhancement: screen reader (Narrator) support pass

1 participant