Skip to content

[Bug]: Closing the right panel with a click leaves focus on the toggle instead of the chat input #46188

Description

@armanarutiunov

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. In a thread, type /side hi in the prompt field and press Enter. The side chat opens in the right panel with its input focused.
  2. Type a few characters in the side chat's input.
  3. Click the right panel toggle in the top-right corner to close the panel.
  4. Type a few characters.

Expected behavior

Focus moves to the main chat's prompt field, so typing goes there. This already happens when you close the panel with the shortcut (⌥⌘B).

Actual behavior

Focus stays on the right panel toggle. Typing does nothing until you click the prompt field.

The mouse press moves focus onto the toggle before the panel closes. PreviewPanelShell only restores focus when focus is still inside the panel at close time, so a click close never restores it.

Related: #32538 (the shortcut case, fixed in #32569).

Impact

Minor bug or occasional failure

Version or commit

main at e1f3ff4, also T3 Code (Nightly)

Environment

macOS, desktop app. The same focus behavior happens on web.

Logs or stack traces

pointerdown button[Toggle right panel] active=div[Message hi]{inPanel}
focusout div[Message hi]{inPanel} rel=button[Toggle right panel]
focusin button[Toggle right panel] rel=div[Message hi]{inPanel}
click button[Toggle right panel] active=button[Toggle right panel]
keydown s active=button[Toggle right panel]
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions