Skip to content

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

Merged
brtkwr merged 1 commit into
feat/prune-clifrom
feat/tui-prune
Jun 22, 2026
Merged

feat: prune a conversation from the TUI with Ctrl+R#16
brtkwr merged 1 commit into
feat/prune-clifrom
feat/tui-prune

Conversation

@brtkwr

@brtkwr brtkwr commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

What

The TUI half of the prune feature: a per-conversation prune action, mirroring the Ctrl+D delete flow.

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

This is the clean way to prune (and then resume-test) a single low-risk conversation, vs the batch ccs prune CLI.

Stacked on #14

Based on feat/prune-cli (#14) since it reuses pruneFile. Targets that branch so the diff is just the TUI action; it'll retarget to main once #14 merges (and I'll rebase over the responsive-width changes from #15).

Tests

  • TestPruneConversationShrinksAndUpdatesSize - prunes a temp conversation, asserts the file shrinks, the snapshot is gone, the message is kept, and the displayed size (in both items and filtered) updates.
  • TestCtrlREntersAndCancelsPruneConfirm - Ctrl+R enters confirm mode, Esc cancels.
  • go test -cover = 64.1%.

Note

Pruning runs synchronously on confirm (like Ctrl+D delete), so a multi-GB file briefly blocks the UI. Acceptable for a confirmed one-off; async with a spinner is a possible later polish.

Adds a per-conversation prune action mirroring the Ctrl+D delete flow:
Ctrl+R on the selected row opens a confirm prompt showing its size, and
on confirm prunes that one file in place (dropping toolUseResult +
file-history-snapshot via the shared pruneFile) and refreshes the SIZE
column. The conversation stays in the list, just smaller.

This is the TUI half of the prune feature; the `ccs prune` CLI is the
batch half.
@brtkwr brtkwr merged commit 6b2d869 into feat/prune-cli Jun 22, 2026
brtkwr added a commit that referenced this pull request Jun 22, 2026
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.
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