Skip to content

Let a box's number leave a thread opened from that box - #526

Merged
dhh merged 1 commit into
mainfrom
tui-box-numbers-leave-thread
Sep 29, 2026
Merged

dhh merged 1 commit into
mainfrom
tui-box-numbers-leave-thread

Conversation

@dhh

@dhh dhh commented Sep 29, 2026

Copy link
Copy Markdown
Member

Pressing 1 inside a thread opened from the Imbox did nothing, and so did 2 inside a thread opened from The Feed. switchBox treated the box already under the thread as "already there" and answered with nothing. The model then passed the key on to the thread, which swallowed it.

  • The change: a box's number always lands on that box's list. When that box is the one already under a thread, a search, a bundle or Previously Seen, the key closes whatever is open and shows the list that is already loaded, without re-reading it. Switching to a different box works as before.
  • An in-flight read of that box's list is not cancelled, so pressing 1 while the Imbox is still loading doesn't throw that load away.
  • Refactor: switching boxes and opening Previously Seen repeated the same "put away the thread, search, bundle and seen screen" steps. switchBox now shares them through closeOverlays.
  • Unchanged: pressing the current box's number on its plain list is still a no-op (TestMailViewBoxShortcutNoOp).

New tests open a thread through the model and press 1 and 2, and check that 1 over a search in the Imbox returns to its list.

🤖 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

Bundle and in-flight request paths remain untested, and the stated cleanup refactor is incomplete.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Updates mail box shortcuts so selecting the current box closes an open thread or overlay and returns to its loaded list.

Changes:

  • Adds shared overlay cleanup during box switching.
  • Preserves active postings reads.
  • Adds thread and search shortcut tests.

[!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 Updates box switching and overlay cleanup.
internal/​tui/​tui_test.go Tests thread and search shortcut 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
Comment on lines +1803 to 1805
v.closeOverlays()
if v.requests.kind != mailRequestPostings {
v.requests.cancel()
Comment thread internal/tui/mail.go
Comment on lines +1818 to +1820
// closeOverlays puts away everything a box's list can have open over it — a thread, a
// search, a bundle, the Previously Seen screen — leaving the list itself.
func (v *mailView) closeOverlays() {
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dhh
dhh force-pushed the tui-box-numbers-leave-thread branch from b77d4f9 to 205e35f Compare September 29, 2026 20:02
@dhh
dhh merged commit 2cc222c into main Sep 29, 2026
25 checks passed
@dhh
dhh deleted the tui-box-numbers-leave-thread branch September 29, 2026 20:04
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