Skip to content

feat(tui): prompt queue, history recall, reconnect retry, jump-to-latest - #19

Merged
jkyberneees merged 4 commits into
mainfrom
feat/prompt-queue-history-reconnect
Jul 29, 2026
Merged

feat(tui): prompt queue, history recall, reconnect retry, jump-to-latest#19
jkyberneees merged 4 commits into
mainfrom
feat/prompt-queue-history-reconnect

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Implements 4 of the top-5 UI/UX gaps from the bodek review (all except the thinking-indicator, excluded by request).

Changes

Commit Gap Fix
feat(tui): queue prompts sent mid-turn and drain on turn end ⏎ mid-run was a silent no-op Prompts queue (footer shows ▸ N queued), auto-send on done/error; esc hands queued prompts back to the input; submit while disconnected keeps the draft with an explanatory notice
feat(tui): recall submitted prompts with arrow keys No prompt history / walk an in-memory ring of 100 prompts (consecutive dups collapsed); stashes/restores the in-progress draft; falls back to transcript scroll when empty
feat(tui): manual reconnect retry and draft-safe disconnects Disconnect dead-ended at "press ^C to quit" Footer offers r to redial (empty input only — never hijacks a draft); successful redial flushes the queue; give-up notice says how to retry
feat(tui): new-output indicator and jump-to-latest key Scrolled-up mid-run: no signal, no jump key Footer flags ↓ new output while busy off-bottom; G/End jump to latest (empty input only)

Verification

  • go fmt / go vet clean, golangci-lint 0 issues
  • go test -race -count=1 ./... — all packages green
  • Coverage 97.8% (baseline 97.6%)
  • 11 new regression tests in internal/tui/promptflow_test.go; TestSubmitGuards deliberately updated for the new disconnected-submit behaviour (draft kept + notice instead of silent nil)
  • README key bindings and the /help card synced

Notes

  • History is session-scoped in-memory; persistence can follow if wanted.
  • Queue drains on done, error, send-failure, and successful reconnect — never into a cancelled session.

Pressing enter while a turn runs used to be a silent no-op. Prompts are
now queued (footer shows the count) and auto-sent on done/error; esc
hands queued prompts back to the input instead of firing them into a
cancelled session. A submit while disconnected keeps the draft and
explains why nothing was sent.
Up on an empty input (or while already walking) steps back through the
session's prompt history; down steps forward and restores the stashed
draft past the newest entry. History is an in-memory ring of 100 with
consecutive duplicates collapsed. With no history to recall, up/down
keep their transcript-scroll behaviour.
The terminal disconnected state used to dead-end at 'press ^C to quit'
while typed input was silently swallowed. The footer now offers r to
redial (empty input only, so drafts are never hijacked), a successful
redial flushes queued prompts, and the give-up notice says how to
retry.
Scrolled-up scrollback during a run used to give only a muted scroll
percent. The footer now flags new output while busy and advertises G
(also End) to jump to the latest — bound only with an empty input so
typing a capital G or using End for cursor movement is never hijacked.
@jkyberneees
jkyberneees merged commit d0984fd into main Jul 29, 2026
5 checks passed
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.

1 participant