[PR #8147] fix(tui): prevent question tool keybindings when dialog is open #12638

Closed
opened 2026-02-16 18:17:32 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8147

State: closed
Merged: Yes


What does this PR do?

Fixes the keyboard binding conflict where the Question tool's H/L navigation keys interfere with typing in the command palette.

When the Question tool is active and the user opens the command palette (Ctrl+P), pressing h or l would navigate the question tabs instead of typing in the command palette's search input.

This change adds a guard at the start of the useKeyboard handler to skip event processing when a dialog is open, following the established pattern used in dialog-command.tsx (lines 48 and 103).

Fixes #8118

How did you verify your code works?

  • Verified the fix follows the exact pattern established in dialog-command.tsx
  • The change uses the already-imported and instantiated dialog context from useDialog()
  • Minimal change: adds only 3 lines to check dialog.stack.length > 0 before processing

🤖 Generated with Claude Code

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8147 **State:** closed **Merged:** Yes --- ### What does this PR do? Fixes the keyboard binding conflict where the Question tool's H/L navigation keys interfere with typing in the command palette. When the Question tool is active and the user opens the command palette (Ctrl+P), pressing `h` or `l` would navigate the question tabs instead of typing in the command palette's search input. This change adds a guard at the start of the `useKeyboard` handler to skip event processing when a dialog is open, following the established pattern used in `dialog-command.tsx` (lines 48 and 103). Fixes #8118 ### How did you verify your code works? - Verified the fix follows the exact pattern established in `dialog-command.tsx` - The change uses the already-imported and instantiated `dialog` context from `useDialog()` - Minimal change: adds only 3 lines to check `dialog.stack.length > 0` before processing --- 🤖 Generated with [Claude Code](https://claude.com/claude-code)
yindo added the pull-request label 2026-02-16 18:17:32 -05:00
yindo closed this issue 2026-02-16 18:17:32 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12638