TUI: trash every selected thread with t - #416
Open
bulters wants to merge 1 commit into
Open
Conversation
Space selects threads, but only Ctrl+B acted on the selection; t and every other filing key took the row under the cursor. Trashing a handful of threads meant a keypress per row. With a selection, t now trashes every selected thread in one request, the way the web app's toolbar acts on a selection. The done message carries every posting the action took, so the list, the Previously Seen screen and the overlaid search and bundle lists drop each row as they already do for one. Removing a row also takes it out of the selection, so a failed request leaves the selection standing for another try and a successful one clears it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LZgWZQHxm7KdZNLNjxCtQG
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The behavior is coherent and tested; the only finding is a non-blocking comment typo.
Pull request overview
Adds bulk trash support for selected TUI threads while preserving single-row behavior.
Changes:
- Sends selected posting IDs in one trash request.
- Removes successful results from lists and selections.
- Adds success/failure tests and updates TUI documentation.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
File summaries
| File | Description |
|---|---|
internal/tui/mail.go |
Implements bulk trash and multi-posting completion handling. |
internal/tui/mail_test.go |
Tests successful and failed bulk trash operations. |
internal/tui/content.go |
Prunes removed rows from selections. |
docs/tui.md |
Documents selection-aware trash behavior. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| boxID int64 | ||
| sourceKind mail.Kind | ||
| postingID int64 | ||
| postingIDs []int64 // every posting a bulk action took, empty for a single row's |
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
Space already selects threads in the TUI, but only Ctrl+B (bulk reply) acted on the selection.
tand the other filing keys took the row under the cursor, so trashing a handful of threads meant one keypress per row.With a selection,
tnow trashes every selected thread in a singlePOST /postings/trash(the SDK'sMoveToTrashis already variadic), the way the web app's toolbar acts on a selection. Without a selection it behaves exactly as before.How
postingActionDoneMsggainspostingIDs, every posting a bulk action took. The box list, the Previously Seen screen and the overlaid search/bundle lists iterate it, falling back to the singlepostingIDfor every existing action.contentList.removeAtnow drops the removed row from the selection. A successful bulk trash therefore clears the selection by itself, and a failed request leaves it standing for another try.docs/tui.mdnotes thattacts on the selection when there is one.Related: #330 asks for the same over seen/unseen. This only wires
t, since that was the itch; the samepostingIDspath would carry the other keys.Tests
TestMailViewTrashesSelectedThreadsInOneRequest: two selected rows, one request with[100, 101], both rows gone, selection empty, toast reads "2 threads moved to Trash".TestMailViewTrashFailureKeepsSelection: a 500 leaves both rows and the selection in place.make checkpasses.🤖 Generated with Claude Code
https://claude.ai/code/session_01LZgWZQHxm7KdZNLNjxCtQG
Summary by cubic
Fixes the TUI so
ttrashes every selected thread in one request when there is a selection, instead of only the row under the cursor; without a selection it behaves exactly as before.docs/tui.mdnotes the new behavior.tis wired; the same path can carry the other filing keys later.Written for commit dcd5a45. Summary will update on new commits.