Skip to content

[Bug]: Cmd+W does not close the browser tab when the page has focus #39338

Closed

Description

@Ernest0-Production

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 the desktop app, open a thread and open a browser (preview) tab in the right panel.
  2. Load any page and click inside the page so keyboard focus is in the guest webview.
  3. Press Cmd+W (Ctrl+W on Windows/Linux), the default rightPanel.close binding.

Expected behavior

The browser tab closes, the same as when focus is on the panel chrome (tab strip, URL bar).

Actual behavior

Nothing happens. The tab stays open and the window does not close either.

A focused guest page has setIgnoreMenuShortcuts(true) and receives its own keydowns, so app keybindings only reach the renderer through the forwarded-shortcut list. PREVIEW_FORWARDED_COMMANDS in apps/web/src/components/ReopenClosedViewShortcut.tsx forwards rightPanel.toggle and rightPanel.toggleMaximized, and ChatView handles those two as desktop menu actions, but rightPanel.close is missing from both, so apps/desktop/src/preview/Manager.ts never matches Cmd+W and the key is dropped.

Related but different: #4147 (the original Cmd+W closes right-panel tab feature) and #32111 (right-panel shortcuts while a side chat has focus).

Impact

Minor bug or occasional failure

Version or commit

main @ 55e379b

Environment

macOS, desktop app, local environment.

Workaround

Click the tab strip or URL bar first, then press Cmd+W, or use the tab's close button.

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