Skip to content

Fix 1974: trap focus in Kanban modals - #1995

Merged
3 commits merged into
nesquena:masterfrom
franksong2702:franksong2702/issue-1974-kanban-modal-focus-trap
May 10, 2026
Merged

Fix 1974: trap focus in Kanban modals#1995
3 commits merged into
nesquena:masterfrom
franksong2702:franksong2702/issue-1974-kanban-modal-focus-trap

Conversation

@franksong2702

Copy link
Copy Markdown
Contributor

Why

Issue #1974 reports that Kanban's task/board modals do not trap keyboard focus, so Tab can move to underlying page controls while the modal is open.

What changed

  • Added a shared _trapModalFocus(modalEl) helper in static/panels.js.
  • Wired _trapModalFocus into:
    • openKanbanCreate()
    • openKanbanEdit()
    • openKanbanCreateBoard()
    • openKanbanRenameBoard()
  • Added per-modal cleanup handles so listeners are removed on close/reopen.
    • _kanbanTaskModalFocusCleanup
    • _kanbanBoardModalFocusCleanup
  • Extended static regression coverage in tests/test_kanban_ui_static.py:
    • helper existence
    • modal install/remove assertions for task modal open/close
    • modal install/remove assertions for board modal open/close

Verification

  • node --check static/panels.js
  • node --check static/ui.js
  • pytest -q tests/test_kanban_ui_static.py (39 passed)
  • pytest -q tests/test_kanban_ui_static.py tests/test_kanban_bridge.py::test_patch_status_running_is_rejected_to_protect_dispatcher_contract tests/test_kanban_bridge.py::test_patch_status_done_to_running_is_rejected (39 passed)

Risks

  • Focusability relies on querySelectorAll + computed styles; edge cases with dynamically injected / hidden controls should still default to the current focus trap behavior.
  • Scope is intentionally limited to focus trapping and listener cleanup, leaving broader modal/refactor work to follow-up issues.

@nesquena-hermes nesquena-hermes closed this pull request by merging all changes into nesquena:master in ad290cc May 10, 2026
pull Bot pushed a commit to JamesWilliam1977/hermes-webui that referenced this pull request May 10, 2026
SysAdminDoc pushed a commit to SysAdminDoc/hermes-webui that referenced this pull request Jun 26, 2026
bernyforce pushed a commit to bernyforce/hermes-webui that referenced this pull request Jul 29, 2026
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