Skip to content

feat: prune a conversation from the TUI with Ctrl+R#17

Merged
brtkwr merged 1 commit into
mainfrom
feat/tui-prune-to-main
Jun 22, 2026
Merged

feat: prune a conversation from the TUI with Ctrl+R#17
brtkwr merged 1 commit into
mainfrom
feat/tui-prune-to-main

Conversation

@brtkwr

@brtkwr brtkwr commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

What

Lands the TUI prune action on main. The original PR (#16) was stacked on the CLI-prune branch (#14) and got merged into that branch instead of main, so the Ctrl+R binding never reached main (which is why Ctrl+R did nothing in a build from main). This replays it onto current main (which has #14's pruneFile + #15's responsive layout).

Feature

  • Ctrl+R on the selected conversation measures the projected saving, then opens a confirm prompt showing it:
    Prune "<topic>"? 75MB -> 53MB, saves 21MB (keeps dialogue). [y/N]
  • On confirm, prunes that one file in place via the shared pruneFile (drops toolUseResult + file-history-snapshot, integrity-checked atomic replace) and refreshes the SIZE column. The conversation stays in the list, just smaller.
  • Mirrors the Ctrl+D delete flow. Help line and --help keybindings updated.

Tests

  • TestPruneConversationShrinksAndUpdatesSize - file shrinks, snapshot gone, message kept, displayed size updated.
  • TestCtrlREntersAndCancelsPruneConfirm - Ctrl+R enters confirm and measures a positive saving; Esc cancels.
  • go test -cover = 64.3%.

Note

Ctrl+R reads the file once to preview the saving, and again on confirm to prune - a multi-GB file briefly blocks the UI (same as Ctrl+D delete). Acceptable for a manual action.

Follow-up

The orphaned feat/prune-cli / feat/tui-prune branches (where #16 wrongly merged) can be deleted.

Adds a per-conversation prune action mirroring the Ctrl+D delete flow.
Ctrl+R on the selected row measures the projected saving and opens a
confirm prompt - "Prune "<topic>"? 75MB -> 53MB, saves 21MB (keeps
dialogue). [y/N]" - and on confirm prunes that one file in place via the
shared pruneFile (drops toolUseResult + file-history-snapshot,
integrity-checked atomic replace) and refreshes the SIZE column. The
conversation stays in the list, just smaller.

Lands on main directly: the original #16 was stacked on the CLI-prune
branch and merged into that branch instead of main, so the Ctrl+R
binding never reached main.
@brtkwr brtkwr force-pushed the feat/tui-prune-to-main branch from a92d0dc to b52f798 Compare June 22, 2026 23:22
@brtkwr brtkwr merged commit 8e3f3c2 into main Jun 22, 2026
1 check 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