feat: prune a conversation from the TUI with Ctrl+R#17
Merged
Conversation
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.
a92d0dc to
b52f798
Compare
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.
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 ofmain, so the Ctrl+R binding never reachedmain(which is why Ctrl+R did nothing in a build from main). This replays it onto currentmain(which has #14'spruneFile+ #15's responsive layout).Feature
Prune "<topic>"? 75MB -> 53MB, saves 21MB (keeps dialogue). [y/N]pruneFile(dropstoolUseResult+file-history-snapshot, integrity-checked atomic replace) and refreshes the SIZE column. The conversation stays in the list, just smaller.--helpkeybindings 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-prunebranches (where #16 wrongly merged) can be deleted.