Skip to content

Trash the thread you are reading with t - #349

Open
badta5te wants to merge 2 commits into
basecamp:mainfrom
badta5te:trash-open-thread
Open

Trash the thread you are reading with t#349
badta5te wants to merge 2 commits into
basecamp:mainfrom
badta5te:trash-open-thread

Conversation

@badta5te

@badta5te badta5te commented Aug 27, 2026

Copy link
Copy Markdown

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.

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.

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/T to 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.

Review in cubic

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
Copilot AI balanced review requested due to automatic review settings August 27, 2026 19:31
@badta5te
badta5te requested a review from a team as a code owner August 27, 2026 19:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread internal/tui/mail.go
return nil
}
postingID := v.topicPostingID
cmd := v.doPostingAction("Thread moved to Trash", postingActionRemove, v.currentBoxID(), postingID, func() error {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in dabb874

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inability to delete opened email.

2 participants