Skip to content

fix(tui): let focused text fields receive standard editing keys (#158) - #160

Merged
aksOps merged 2 commits into
mainfrom
fix/editing-keys
Aug 20, 2026
Merged

fix(tui): let focused text fields receive standard editing keys (#158)#160
aksOps merged 2 commits into
mainfrom
fix/editing-keys

Conversation

@aksOps

@aksOps aksOps commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Closes #158. Part of #136.

Scope, as corrected mid-flight

The user corrected the ticket: the convention here is Home/End for line start/end - "no need to add extra keybinding". So this PR adds no readline aliases. It only makes sure the keys bubbles text fields already bind by default actually reach the focused field, and removes the kb-level bindings that shadowed them. Ctrl+A-as-select-all is a separate open question and is untouched here.

Root cause

The root key routing was already clean - internal/tui/model.go forwards every key to the open overlay (only ctrl+c stays global). The swallowing was inside two panes, where a stepper control claimed keys that belong to whatever field currently has focus:

  • Card editor due picker (internal/tui/cardeditor/model.go) bound alt+left / alt+right to date -1/+1. Those are textinputs WordBackward / WordForward, so word motion was dead in the due field. The stepper keeps [ and ], which nothing in the default keymap wants.
  • Issue import input stage (internal/tui/issueimport/model.go) handled left / right / h / l before dispatching to the reference input, for every focus. With the reference field focused, cursor motion was dead and the letters h and l could not be typed at all - owner/repo names containing either were unenterable.

Both are the same class: a pane shortcut that collides with a focused field now yields to the field.

Frozen v1.0.1 bindings made focus-conditional

  • left / right / h / l in the issue import overlay: still step the source and count controls, but only while those controls hold focus, never while the reference input does.
  • alt+left / alt+right in the card editor: no longer step the due date at all. [ / ] remain the date stepper, so the keyboard path to adjust a date is intact.

Surfaces audited and found already correct

Board filter input, kill-reason prompt, settings AI and integration-row inputs, ADR split paste/file-path/row-title inputs, card detail comment and link inputs. All forward unconsumed keys straight to the focused field. They now carry regression tests so they stay that way.

Verification

  • go build ./... clean
  • go vet ./... clean
  • go test -race ./internal/tui/... 672 pass
  • sh scripts/check-go-coverage.sh 96.9% total (gate 96.4%); no package below its floor

Both fixes were caught by a red test first: the due field stepped the date on alt+left, and the import reference field stayed empty after typing hl.

aksOps added 2 commits August 20, 2026 08:14
Two panes bound keys that the focused bubbles text field already owns, so
the field never saw them:

- The card editor due-date stepper claimed alt+left and alt+right, which
  are the word motions textinput binds by default. The stepper keeps [
  and ]; the alt+arrows now reach the input.
- The issue import source and count steppers claimed left/right/h/l for
  every focus, so the reference input could not take a cursor motion or
  the letters h and l. The steppers now run only for their own focus.

Regression tests per field class assert Home and End move the cursor in
the card editor fields, the board filter input, the kill-reason prompt,
the settings inputs, the ADR split inputs, the issue import reference,
and the card detail comment and link inputs.
@sonarqubecloud

Copy link
Copy Markdown

@aksOps
aksOps merged commit 744f945 into main Aug 20, 2026
9 checks passed
@aksOps
aksOps deleted the fix/editing-keys branch August 20, 2026 08:21
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.

Text fields swallow standard editing keys (Ctrl+A et al.)

1 participant