Skip to content

Return to the list after sending a reply or forward from a thread - #525

Merged
dhh merged 1 commit into
mainfrom
tui-return-to-list-after-reply
Sep 29, 2026
Merged

dhh merged 1 commit into
mainfrom
tui-return-to-list-after-reply

Conversation

@dhh

@dhh dhh commented Sep 29, 2026

Copy link
Copy Markdown
Member

Sending a reply or forward from inside a thread used to close the form and leave the reader in the thread. HEY's web app sends you back to the box instead, which is where the next thing to deal with is.

  • The change: a successful send from a thread now closes the thread too, returning the reader to the list they opened it from: the Imbox, a search, a bundle or Previously Seen. The confirmation toast still shows.
  • How: reply and forward forms remember the thread they were written from (composeForm.topicID, set from the context message). The composeSentMsg handler exits the thread only if that thread is still the one open, so a thread left or switched while the send was in flight is left alone.
  • Failed sends: the reader stays in the thread with the form open, as before, so nothing is lost.
  • New messages already start from the list, so nothing changes for them.

TestForwardCompletionIsSaidFromInsideAThread asserted that the thread stayed on screen; it's now TestForwardFromAThreadReturnsToTheList. New tests cover a reply returning to the list and a failed reply staying in the thread. docs/tui.md gets one line.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings September 29, 2026 19:20
@dhh
dhh requested a review from a team as a code owner September 29, 2026 19:20

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.

Copilot review overview

🟡 Changes recommended

The topic-mismatch safeguard needs regression coverage to ensure a different open thread is never closed.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Returns users to their originating mail list after successfully replying to or forwarding a thread.

Changes:

  • Tracks the originating thread on compose forms.
  • Closes matching threads after successful sends.
  • Updates tests and TUI documentation.

[!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.

File Description
internal/​tui/​mail.go Exits the originating thread after successful sends.
internal/​tui/​compose.go Records the reply or forward’s thread ID.
internal/​tui/​compose_test.go Tests successful and failed thread sends.
docs/​tui.md Documents the updated navigation behavior.

💡 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
// A reply or a forward finishes with the thread it was written from, the way
// the web app sends you back to the box: the reader lands on the list they
// opened the thread from — the Imbox, a search, a bundle — ready for the next.
if v.inThread && form.topicID != 0 && form.topicID == v.topicID {
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dhh
dhh force-pushed the tui-return-to-list-after-reply branch from f577a59 to 0fc5ed6 Compare September 29, 2026 19:58
@dhh
dhh merged commit d294d9e into main Sep 29, 2026
25 checks passed
@dhh
dhh deleted the tui-return-to-list-after-reply branch September 29, 2026 20:00
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.

2 participants