ticket: close composer input history

This commit is contained in:
Keisuke Hirata 2026-05-29 18:20:22 +09:00
parent d98f2ff7df
commit d9d36cabf4
No known key found for this signature in database
4 changed files with 0 additions and 100 deletions

View File

@ -1,57 +0,0 @@
---
id: 20260529-084551-tui-composer-input-history-recall
slug: tui-composer-input-history-recall
title: Recall composer input history from cursor boundary
status: open
kind: feature
priority: P2
labels: [tui, composer, input-history]
created_at: 2026-05-29T08:45:51Z
updated_at: 2026-05-29T08:45:51Z
assignee: null
legacy_ticket: null
---
## Background
The TUI currently has manual rewind (`Ctrl+R` / `:rewind`) and queued-input restoration (`Alt+Q`), but it does not have a non-destructive composer input history like shell/readline history. Users should be able to recall previously submitted inputs into the composer without rewinding the Pod/session history.
Add local TUI composer history based on sent inputs. This is an editing convenience only: recalling history must not mutate Pod history, send protocol messages, or create hidden context.
## Requirements
- Record submitted composer inputs in a local input history.
- Record only non-blank user submissions that are accepted for sending or queued for later sending.
- Preserve typed segments (`Segment` atoms such as file refs, knowledge refs, workflow invocations, paste/file chips) rather than flattening to plain text.
- Avoid consecutive duplicate entries when the same input is submitted repeatedly.
- Keep history bounded to a modest fixed size.
- Add composer recall navigation.
- When the composer cursor is at the start of the buffer, `Up` recalls the previous input history entry instead of moving within the composer.
- When browsing history, `Up` continues to older entries and `Down` moves back toward newer entries.
- When the browse cursor returns past the newest entry, restore the draft that was present before history browsing began.
- If the cursor is not at the start of the composer, preserve the existing multiline cursor-up behavior.
- If the cursor is at the end of the composer while browsing history, `Down` should move toward newer history; outside history browsing it should preserve the existing multiline cursor-down behavior.
- Preserve drafts safely.
- Starting history browsing with a non-empty draft must save that draft and restore it when the user navigates back past the newest history entry or cancels/edits out of history browsing.
- Editing a recalled entry should leave history-browse mode and edit the recalled content as a normal draft.
- Submitting a recalled entry should submit normally and append/update history using the same rules.
- Keep the feature local to the TUI client.
- Do not add Pod protocol methods/events.
- Do not persist input history across TUI restarts in this ticket unless it falls out naturally from existing snapshot/history data. Session-log user messages remain the authoritative durable record.
- Multi-Pod dashboard/direct-send behavior can share the same history if simple, but per-Pod history is acceptable if it fits the existing app structure better; document the chosen behavior in tests or code comments.
- Maintain existing controls.
- `Ctrl+R` / `:rewind` remains destructive rewind picker behavior.
- `Alt+Q` remains queued-input restoration.
- Page/turn scroll keys continue to operate on conversation history.
## Acceptance criteria
- After sending several messages, pressing `Up` at the start of an empty composer recalls the most recent submitted input, with typed segments preserved.
- Repeated `Up`/`Down` walks older/newer history entries and restores the pre-browse draft after the newest entry.
- `Up` inside a multiline composer when the cursor is not at the start still moves the cursor within the composer.
- Editing a recalled entry exits history-browse mode and does not mutate stored history until submission.
- Consecutive duplicate submissions do not create duplicate adjacent history entries.
- History recall does not call Pod methods and does not alter visible transcript/history until the recalled input is submitted.
- Tests cover empty composer recall, non-empty draft restoration, multiline cursor-boundary behavior, typed segment preservation, duplicate suppression, and submission from recalled history.
- `cargo fmt --check`
- Focused TUI tests/checks pass.

View File

@ -1,36 +0,0 @@
---
id: 20260529-084551-tui-composer-input-history-recall-review
slug: tui-composer-input-history-recall
title: Review for composer input history recall
status: reviewed
kind: review
created_at: 2026-05-29T08:45:51Z
updated_at: 2026-05-29T09:18:00Z
reviewer: insomnia-system
---
## Review summary
Reviewed implementation branch `work/tui-composer-input-history-recall` in worktree `/home/hare/Projects/insomnia/.worktree/tui-composer-input-history-recall`.
The implementation adds local-only typed composer input history, bounded to 100 entries, records non-blank sent/queued inputs, suppresses adjacent duplicates, supports cursor-boundary `Up` recall and browsing with `Up`/`Down`, restores pre-browse drafts, and exits browse mode on edit. It does not add Pod protocol changes or mutate transcript/history until a recalled input is submitted normally.
One blocking issue was found and fixed: pressing `Up` at the buffer start with an empty input history cleared a non-empty draft because browsing captured the draft with `submit_segments()` before confirming that history existed. The amendment avoids mutating the composer when no recall entry exists and adds a regression test.
## Validation
Reviewer ran:
- `cargo fmt --check`
- `cargo test -p tui input_history`
- `cargo test -p tui recalled`
- `cargo test -p tui multiline`
- `cargo test -p tui empty_composer`
- `cargo test -p tui up_at_start_with_empty_history_preserves_draft_without_browsing -- --nocapture`
- `git diff --check develop...HEAD`
All passed. The only compiler warning observed was the pre-existing `llm-worker` `end_scope` dead-code warning.
## Judgment
Approved after amendment.

View File

@ -1,7 +0,0 @@
<!-- event: create author: tickets.sh at: 2026-05-29T08:45:51Z -->
## Created
Created by tickets.sh create.
---