Trash the thread you are reading with t - #349
Open
badta5te wants to merge 2 commits into
Open
Conversation
The trash key only worked on a list, so a thread you had opened could not be trashed without leaving it first, and the help bar in a thread never offered the key at all. t and T now trash the open thread and return to the list it came from. The posting is the one the thread was opened from rather than the list's selection: a thread opened out of search results or a bundle leaves the box list's cursor on a different email. A topic opened by its id carries no posting, and HEY trashes postings, so the key says so instead. Closes basecamp#339
Contributor
There was a problem hiding this comment.
Pull request overview
Adds t/T support for trashing an open mail thread and returning to its originating list.
Changes:
- Tracks the posting used to open a thread.
- Adds thread-view trash handling and help.
- Tests list, search, direct-ID, and Previously Seen behavior.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
internal/tui/mail.go |
Adds open-thread trash behavior and posting tracking. |
internal/tui/mail_test.go |
Tests trash actions and help visibility. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| return nil | ||
| } | ||
| postingID := v.topicPostingID | ||
| cmd := v.doPostingAction("Thread moved to Trash", postingActionRemove, v.currentBoxID(), postingID, func() error { |
A thread trashed from inside itself only left the box list and the Previously Seen screen: postingActionDoneMsg lands on postingList, so a thread opened out of search results or a bundle stayed listed there and could be reopened or trashed again.
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.
The trash key only worked on a list, so a thread you had opened could not be trashed without first leaving it, and the help bar in a thread never offered the key at all. The web app trashes from an open thread.
tandTnow trash the open thread and return to the list it came from. The posting is the one the thread was opened from rather than the list's selection: a thread opened out of search results or a bundle leaves the box list's cursor on a different email. A topic opened by its id carries no posting, and HEY trashes postings, so the key says so instead.A completed removal also drops the row from the search results or the bundle the thread was opened from. Those lists were navigate-only until this key — no action could reach a row in them — so nothing had left them stale before; without it the thread would go to the Trash while its row stayed listed, ready to be reopened or trashed again.
Fixes #339
Summary by cubic
Adds
t/Tto trash the thread you're reading, returning to the list it came from instead of forcing you to leave it first. The key uses the posting the thread was opened from (not the list's cursor), and the thread help bar now offers it; threads opened by id carry no posting, so the key declines with a notice. Trashing also removes the thread's row from search results or bundle views it was opened from.Fixes #339.
Written for commit dabb874. Summary will update on new commits.