Skip to content

feat: phase 12 — InputWidget, HistoryStore, readline-like input + ses…#11

Merged
macaris64 merged 1 commit intomainfrom
phase-12-input-history
Apr 19, 2026
Merged

feat: phase 12 — InputWidget, HistoryStore, readline-like input + ses…#11
macaris64 merged 1 commit intomainfrom
phase-12-input-history

Conversation

@macaris64
Copy link
Copy Markdown
Owner

…sion history

Adds full readline-like command input and persistent session history to the TUI, completing the Phase 12 M4 milestone deliverables.

New modules:

  • logicshell-tui/src/input.rs — InputWidget: cursor tracking, insert/delete, Home/End, Ctrl-A/E/K (kill-to-end), render_with_cursor()
  • logicshell-tui/src/history.rs — HistoryStore: VecDeque ring-buffer (1 000- entry cap), Up/Down navigation, consecutive-duplicate dedup, XDG persistence

App wiring (app.rs):

  • Replaced input: String with input_widget: InputWidget + history: HistoryStore
  • Added key handlers: Left/Right, Home/End, Delete, Ctrl-A/E/K, Up/Down arrows
  • Enter pushes to history, saves to disk, resets navigation
  • App::with_history() constructor for test injection

Other changes:

  • ui.rs: prompt uses input_widget.render_with_cursor(), phase banner → 12
  • phase11_integration.rs: updated to use input_widget API
  • phase12_integration.rs: 53 new integration tests
  • examples/phase12.rs: runnable interactive demo

Coverage: 94.26% (821/871 lines). 173 new tests, all CI checks pass.

…sion history

Adds full readline-like command input and persistent session history to
the TUI, completing the Phase 12 M4 milestone deliverables.

New modules:
- `logicshell-tui/src/input.rs` — InputWidget: cursor tracking, insert/delete,
  Home/End, Ctrl-A/E/K (kill-to-end), render_with_cursor()
- `logicshell-tui/src/history.rs` — HistoryStore: VecDeque ring-buffer (1 000-
  entry cap), Up/Down navigation, consecutive-duplicate dedup, XDG persistence

App wiring (app.rs):
- Replaced `input: String` with `input_widget: InputWidget` + `history: HistoryStore`
- Added key handlers: Left/Right, Home/End, Delete, Ctrl-A/E/K, Up/Down arrows
- Enter pushes to history, saves to disk, resets navigation
- `App::with_history()` constructor for test injection

Other changes:
- ui.rs: prompt uses `input_widget.render_with_cursor()`, phase banner → 12
- phase11_integration.rs: updated to use `input_widget` API
- phase12_integration.rs: 53 new integration tests
- examples/phase12.rs: runnable interactive demo

Coverage: 94.26% (821/871 lines). 173 new tests, all CI checks pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@macaris64 macaris64 merged commit 2d52f0c into main Apr 19, 2026
4 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