Guarantee and test focus behavior for every TUI modal #17

Open
opened 2026-09-08 09:17:22 +00:00 by phg · 0 comments
Owner

Context

Accessibility audit from #10 found that only Help has an integration test for focus restoration, and ConfigModal has no explicit initial focus target. Other modal focus and restoration behavior depends on framework defaults or has only unit-level checks.

Acceptance criteria

  • Every ModalScreen explicitly sets an appropriate initial focus target; destructive and unsaved-change confirmations initially focus Cancel.
  • Dismissing every application modal through Cancel or Escape restores focus to its opener, including Config, Add Host Entry, Delete Host Entry, Save Changes, Advanced Filtering, and Restore Pre-edit Backup.
  • The focusable order in Add Host Entry and Configuration follows visual reading order and skips hidden or disabled controls.
  • Textual pilot tests exercise these behaviors using the public TUI workflow, without mocking focus internals.
  • mise run check passes.
Context Accessibility audit from #10 found that only Help has an integration test for focus restoration, and ConfigModal has no explicit initial focus target. Other modal focus and restoration behavior depends on framework defaults or has only unit-level checks. Acceptance criteria - Every ModalScreen explicitly sets an appropriate initial focus target; destructive and unsaved-change confirmations initially focus Cancel. - Dismissing every application modal through Cancel or Escape restores focus to its opener, including Config, Add Host Entry, Delete Host Entry, Save Changes, Advanced Filtering, and Restore Pre-edit Backup. - The focusable order in Add Host Entry and Configuration follows visual reading order and skips hidden or disabled controls. - Textual pilot tests exercise these behaviors using the public TUI workflow, without mocking focus internals. - `mise run check` passes.
phg added the
Kind/Enhancement
Kind/Testing
Priority
Medium
labels 2026-09-08 09:17:22 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: phg/hosts#17
No description provided.