-
Notifications
You must be signed in to change notification settings - Fork 194
Description
Bug Description
When creating a new session and a text input field is focused (Name, Path, or Custom command), pressing s, w, m, or y toggles checkboxes (sandbox, worktree, multi-repo, YOLO) instead of typing those letters into the text field.
Steps to Reproduce
- Open Agent Deck TUI
- Create a new session (Enter on a group)
- Focus the "Name" field or navigate to the "Custom" command input
- Try to type a word containing the letter
s(e.g., "openspec") - Instead of typing
s, the "Run in Docker sandbox" checkbox toggles
Expected Behavior
When a text input field has focus, all letter keys should type into the input. Shortcut keys (s, w, m, y) should only toggle checkboxes when no text input is actively focused.
Root Cause
In internal/ui/newdialog.go, the Update method's key handler matches single-letter shortcuts and returns early before the text input .Update(msg) calls at the bottom of the method. The shortcut cases check cur == focusCommand but don't verify whether a text input within that target is actually receiving input (i.e., commandCursor == 0).
For focusName and focusPath, the shortcuts fire unconditionally.
Suggested Fix
Add a helper to detect when a text input is focused, and skip single-letter shortcuts in that state:
func (d *NewDialog) isTextInputFocused() bool {
cur := d.currentTarget()
switch cur {
case focusName, focusPath, focusBranch:
return true
case focusCommand:
return d.commandCursor == 0
default:
return false
}
}Then guard the single-letter shortcut cases so they only fire when !d.isTextInputFocused().
Environment
- agent-deck: latest (installed via Nix)
- OS: macOS (Darwin)
- Terminal: Ghostty