Before submitting#
Area#
apps/desktop
Steps to reproduce#
- Open the built-in browser panel and load any page.
- Click inside the page so it has keyboard focus.
- Press
Cmd+B (sidebar.toggle), Cmd+Option+B (rightPanel.toggle), or a key bound to rightPanel.toggleMaximized in keybindings.json.
- Click the chat area and press the same keys.
Expected behavior#
App-level layout shortcuts work no matter which pane has focus. Pressing Cmd+B while reading a page in the browser panel should collapse the sidebar.
Actual behavior#
While the page has focus, none of these shortcuts do anything. They work again as soon as focus moves back to the chat, the URL bar, or the panel header. In practice I have to click outside the page before every layout shortcut.
Impact#
Minor bug or occasional failure
Version or commit#
0.0.45 (stable). The code below is unchanged on main @ 7812230.
Environment#
macOS 26.2 (arm64), T3 Code (Alpha) 0.0.45, Electron 44.4.2
Logs or stack traces#
No response
Screenshots, recordings, or supporting files#
No response
Workaround#
Click the URL bar or panel header first, then press the shortcut.
Likely cause, from reading the source:
- Layout shortcuts are resolved by
keydown listeners on the host renderer's window, e.g. AppSidebarLayout.tsx#L126 and ChatView.tsx#L7678. Key events in the <webview> guest never reach that window.
- The guest's
before-input-event handler only intercepts the refresh shortcut, and menu shortcuts are ignored for the guest. See Manager.ts#L2037-L2048 and #L2074.
Related: #15035 forwards browser-style shortcuts (tabs, mod+l, back/forward) from a focused page, and its description says panel toggles are intentionally not forwarded. This issue covers those panel toggles: sidebar.toggle, rightPanel.toggle, rightPanel.toggleMaximized. Ideally every user binding without a previewFocus condition would apply too.
Note
Grok responding on behalf of Julius.
Triage#
Thanks for the clear repro and the source pointers, @SherzodAli! This matches current
main(7812230572f2), and no duplicate turned up. There turn out to be two separate things in here.What I found#
sidebar.toggle(mod+b) andrightPanel.toggle(mod+alt+b) are hostwindowlisteners inAppSidebarLayout.tsxandChatView.tsx. The URL bar and panel header live in that document, so the keys work there, but a focused<webview>page is a separate process whose keys never reach those listeners.beforeInputhandler only claims the refresh chord, andsetIgnoreMenuShortcuts(true)keeps other keys away from the application menu. The test "keeps preview shortcuts out of the host window" covers chords likemod+k,mod+j, andmod+w.when: previewFocuswould have side effects: from the host, the focused element is the<webview>, soeditableFocusis false even while typing in the page. For examplemod+zwould undo a thread action, andmod+bwould toggle the sidebar instead of bolding text in a page editor.rightPanel.toggleMaximizedis a separate problem. It's a bindable command and the header button callstoggleRightPanelMaximized, but no keydown handler dispatches it, so a custom binding does nothing even when the chat has focus.Likely fix area#
ChatViewkeydown handler, next torightPanel.toggle.beforeInput, or keeping them with the page.A maintainer will decide on the fix direction.