Skip to content

fix(channels): keep consecutive tab closes in the closing pane - #1158

Merged
kalvinnchau merged 1 commit into
mainfrom
peon/tab-close-focus
Oct 15, 2026
Merged

kalvinnchau merged 1 commit into
mainfrom
peon/tab-close-focus

Conversation

@kalvinnchau

@kalvinnchau kalvinnchau commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Consecutive Cmd+W presses now close each remaining tab in the pane that holds them.

  • Side pane: closing a thread tab returns focus to its opener only once the pane empties, or when the opener is inside that same pane (a linked thread opened from another thread tab). Otherwise the workspace keeps focus on the newly selected tab, so the next native Close request reaches it.
  • Main pane: closing the addressed thread starts its channel history visit with the current selection kept (enterVisit(..., keep)), so a remaining main-pane thread stays selected and closable. Back still reopens the closed thread; ordinary channel navigation still shows the conversation.
  • Closing the last tab still returns focus to the opener, and a further Close is unhandled.

Tests

Browser cases added to tests/browser/navigation-thread-history.spec.mjs. Each one runs the native close-request.js script against the full app. They are browser cases because the behavior depends on layout-effect focus ordering between ChannelsPage and PanelWorkspace, plus real inert panes; no lower-level harness mounts ChannelsPage.

  • consecutive native Close requests close each side thread, then return focus to its opener
  • consecutive native Close requests close each main-pane thread, then return focus to its opener
  • closing a linked thread with native Close / the close button returns focus to its link in the side pane

Unit: useChannelTabState.test.tsx covers a new channel visit with and without keep.

Fail-then-pass (Chromium): the side and main cases fail on the base branch and pass with this change. The linked-thread cases guard opener restoration within a pane. The keep unit test fails on the base branch.

Validation:

  • the new cases pass in Chromium and WebKit
  • navigation-thread-history, channel-tabs, buzz-links, activity-navigation-focus, message-navigation, nested-replies and thread-unread pass in both engines
  • full vitest run and pnpm check pass

Deferred: guest webviews.

buzz-review-completed

closing a thread tab always returned focus to the thread opener, even
while other tabs remained. an opener in the main timeline moved focus
into the main workspace, so the next close request reached the
permanent conversation tab and did nothing.

the opener now takes focus only once the closing pane empties, or when
it sits in that same pane (a linked thread opened from another tab).
closing the addressed thread starts its channel visit with the current
selection kept, so a remaining main-pane thread stays selected instead
of the conversation.

Co-authored-by: Kalvin C <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
@kalvinnchau
kalvinnchau requested a review from a team as a code owner October 15, 2026 02:00

@salman1993 salman1993 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.

🤖 Reviewed by Salman’s AI agent. 9/10 for minimalness, elegance, and correctness; no blocking findings.

The change keeps channel navigation and opener restoration with their existing owners, while PanelWorkspace continues to own selection and focus recovery. The remaining-tab and last-tab paths are consistent with the stated behavior, and the four added browser cases justify their layer through real focus ordering, native Close dispatch, and inert panes.

Verified at 8be5117:

  • 54 focused Vitest tests passed across useChannelTabState, useConversationTabs, and PanelWorkspace.
  • All 30 navigation-thread-history browser cases passed across Chromium and WebKit, including both consecutive-close regressions, linked-thread focus restoration, Escape, and history navigation.
  • Diff whitespace checks passed; hosted CI required, flake checks, and DCO are green.

Limits: browser tests execute the production Close script but do not exercise native guest webviews or packaged desktop dispatch. Manual theme/text-size acceptance was not repeated; this PR changes no visual recipes or styles.

@baxen baxen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@kalvinnchau
kalvinnchau merged commit 9c2f539 into main Oct 15, 2026
37 checks passed
@kalvinnchau
kalvinnchau deleted the peon/tab-close-focus branch October 15, 2026 02:56
johnmatthewtennant added a commit that referenced this pull request Oct 15, 2026
* origin/main:
  fix(navigation): share one abort reason so Settings → Back stops leaking DOM on V8 (#1161)
  Unify sidebar resizing and polish Solo navigation (#1132)
  Organize Builderlab agent identity and runtime settings (#1153)
  fix(channels): keep consecutive tab closes in the closing pane (#1158)
  feat(goose): add the goose agent type (#1125)
  feat: edit the last message with Cmd+Up (#1042)
  fix(channels): make Enter press the prominent lifecycle button (#1152)
  feat(me): drag chats between projects and Chats (#1112)
  fix(search): find open channels past the first 500 in Command-K (#1128)
  Stop in-flight request mocks from failing finished browser tests (#987)
  fix(channels): resolve template agents from ready inventory (#922)
  [buzz-app] Fit uploaded videos to the relay's 4K envelope and name video rejections (#1129)
  feat(github): reveal the PR comment a link points at (#947)
  fix(messages): stop WebKit freeze from muted composer video previews (#1143)

Signed-off-by: John Tennant <[email protected]>

# Conflicts:
#	docs/sessions/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants