Skip to content

feat(tui): clearer key model — esc never quits, ctrl+d quits, arrow-key scroll - #49

Merged
flarexium merged 1 commit into
mainfrom
feat/tui-key-bindings
Jun 15, 2026
Merged

feat(tui): clearer key model — esc never quits, ctrl+d quits, arrow-key scroll#49
flarexium merged 1 commit into
mainfrom
feat/tui-key-bindings

Conversation

@flarexium

@flarexium flarexium commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

What

Reorganises the conversational TUI key bindings around two clear rules.

Quit is only ctrl+c / ctrl+d

esc no longer quits anywhere — it cancels a running turn or steps back one level. On the select screen q/esc no longer quit either; quitting is exclusively ctrl+c or ctrl+d.

Single-branch esc reconnects

A single-branch ledger auto-starts into chat (existing behaviour) and has no selection menu to return to. Previously esc would land on a dead one-item screen (or, briefly, quit). Now esc from chat reconnects a fresh session — a conversation reset (new engine, cleared transcript and recall buffer) while the underlying ledger is untouched.

Scroll the transcript

  • / — line by line
  • pgup/pgdn — full page
  • home/end — jump to top/bottom

Only the arrows and home/end are routed to the viewport — not vim k/j, since those are typed characters in the chat input. home/end keep ctrl+a/ctrl+e as their input-cursor aliases, so nothing is lost when typing. ctrl+u/ctrl+d are dropped from scrolling (the latter now quits), leaving pgup/pgdn for paging.

Tests

  • TestModelCtrlDQuits — ctrl+d quits.
  • TestModelEscReconnectsWithSingleOption — esc reconnects, never quits.
  • TestModelEscReturnsToSelectWithMultipleOptions — multi-branch esc returns to select.
  • TestModelArrowKeysScrollTranscript — up/down/home/end scroll an overflowing transcript without starting a turn.

go build ./..., go vet, and go test ./cmd/ledger/... all pass. Footer hints and docs/tui-manual-test.md updated to match.

🤖 Generated with Claude Code

…ey scroll

Reorganise the TUI key bindings around two clear rules:

- Quit is only ctrl+c or ctrl+d, anywhere. esc no longer quits: it
  cancels a running turn or steps back one level. On the select screen
  q/esc no longer quit either.
- A single-branch ledger has no menu to return to, so esc from chat
  reconnects a fresh session instead of landing on a dead one-item
  screen.
- Arrow keys scroll the transcript: up/down line-by-line, pgup/pgdn for
  full pages, home/end to jump to top/bottom. Only the arrows and
  home/end are routed (not vim k/j), since k/j are typed text in the
  chat input; home/end keep ctrl+a/ctrl+e as input-cursor aliases.
  ctrl+u/ctrl+d are dropped from scrolling, leaving pgup/pgdn for paging.

Footer hints and docs/tui-manual-test.md updated to match.
@flarexium
flarexium force-pushed the feat/tui-key-bindings branch from 48e492c to a35ef40 Compare June 15, 2026 02:16

@jarvis-flarex jarvis-flarex left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@flarexium
flarexium merged commit e716af1 into main Jun 15, 2026
1 check passed
@flarexium
flarexium deleted the feat/tui-key-bindings branch June 15, 2026 02:19
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