Return to the Imbox once The Screener is empty - #530
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Clearing can close with decisions in flight, and Imbox navigation incorrectly relies on its display name.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Returns users to the Imbox after they empty The Screener.
Changes:
- Adds automatic closing after final decisions or clearing.
- Preserves Escape/
qbehavior and moves clearing feedback to a toast. - Adds tests and 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 | Description |
|---|---|
internal/tui/tui.go |
Routes Screener closure to mail or Imbox. |
internal/tui/screener.go |
Detects an emptied queue and requests closure. |
internal/tui/screener_test.go |
Tests closure, pagination, mutations, and navigation. |
docs/tui.md |
Documents automatic return to the Imbox. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| v.pendingCount = 0 | ||
| v.notice = "The Screener is clearing. Everyone waiting will be asked about again on their next email." | ||
| return nil, true | ||
| return tea.Batch(notify("The Screener is clearing. Everyone waiting will be asked about again on their next email."), v.closeToImbox()), true |
Comment on lines
+1096
to
+1098
| if toImbox { | ||
| cmd = tea.Batch(cmd, m.mailView.switchBox(boxForShortcut("1", m.mailView.boxes))) | ||
| } |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mptied it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dhh
force-pushed
the
tui-screener-closes-when-empty
branch
from
September 29, 2026 20:19
992c3cb to
ab120b8
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Checking in each handler missed the orders the messages can land in: a decision racing a clear, a page below, or a live re-read that is the first to say the queue is empty. One check after every update covers them all. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Screening the last sender used to leave the reader on an empty Screener ("Nobody is waiting to be screened") until they pressed Escape. The web app goes back to the Imbox once the Screener is empty, and the TUI now does too.
Updatenow wrapsupdateand asks that question after every message. Review kept finding orders in which the messages land that a per-handler check missed: a decision racing a clear, a page below coming back empty, or a live re-read being the first to say the queue is empty. Asking once after each update covers all of them.screenerClosedMsggets atoImboxflag, andcloseScreenerswitches to the Imbox found by its kind (mailView.imboxIndex, whichimboxSourcenow shares), so a renamed Imbox still works. Escape andqstill go back to wherever The Screener was opened from.docs/tui.mdgets a sentence. Tests cover the last decision closing, a queue with more pages or a decision in flight staying open, an empty page or a live re-read after the last decision closing it, a clear waiting on a decision in flight (successful or failed), a failed clear being shown as it closes, and the model landing on the Imbox, renamed or not, while Escape returns to The Feed.🤖 Generated with Claude Code