feat(tui): prompt queue, history recall, reconnect retry, jump-to-latest - #19
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements 4 of the top-5 UI/UX gaps from the bodek review (all except the thinking-indicator, excluded by request).
Changes
feat(tui): queue prompts sent mid-turn and drain on turn end▸ N queued), auto-send on done/error;eschands queued prompts back to the input; submit while disconnected keeps the draft with an explanatory noticefeat(tui): recall submitted prompts with arrow keys↑/↓walk an in-memory ring of 100 prompts (consecutive dups collapsed); stashes/restores the in-progress draft; falls back to transcript scroll when emptyfeat(tui): manual reconnect retry and draft-safe disconnectsrto redial (empty input only — never hijacks a draft); successful redial flushes the queue; give-up notice says how to retryfeat(tui): new-output indicator and jump-to-latest key↓ new outputwhile busy off-bottom;G/Endjump to latest (empty input only)Verification
go fmt/go vetclean,golangci-lint0 issuesgo test -race -count=1 ./...— all packages greeninternal/tui/promptflow_test.go;TestSubmitGuardsdeliberately updated for the new disconnected-submit behaviour (draft kept + notice instead of silent nil)/helpcard syncedNotes