Skip to content

A late New chat tab takes the selection from a tab opened meanwhile #497

Open

Description

@SSFSKIM

What happens

The "New chat in " button on a project row creates the session first, a round trip to main through session.create, and opens the new chat's tab, selected, only when that call returns. A tab the person opens in the meantime (the library, an artifact, another session) is selected first, and then loses the selection to the late chat tab. On a loaded machine the round trip can take about a second, which is long enough for a second click.

Found while fixing a hosted e2e flake (PR #495, e2e/support/sidebar.ts newChatIn). Its red snapshot showed tabs Artifacts, then New chat selected, with the composer focused. Under a busy loop per core, master's helper returned before its tab in 18 of 22 calls (run 42155530599). The e2e helper now waits for the tab; the product still steals the selection.

Expected

A late New chat tab opens without taking the selection from a tab the person opened after pressing +, the way a browser opens a new tab in the background once focus has moved. If nothing else was opened in between, it opens selected as today.

Where

The renderer path behind the project row's New chat button, where the new session's tab is opened after session.create resolves. The fix is a check at that point: was the selected tab changed since the click? If so, add the tab unselected.

Proof

A renderer test (happy-dom) that holds session.create's answer, selects another tab, then releases it, and asserts that the other tab stays selected and the chat tab is added. The newChatIn e2e helper keeps working unchanged.

Deferred UX work (the owner, earlier: register UX items as tickets to pick up when UX work resumes).

Activity

  1. added
    bug
    status:ready-for-implementer
    priority:P3
    on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:P3status:ready-for-implementer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions