feat(web): make right panel maximize bindable (#5091)

This commit is contained in:
El-Hussein Abdelraouf authored and GitHub committed 2026-08-15 12:27:49 +00:00
1 parent 62bb97428a
commit e17f244e0d
8 files changed
+42 -7

No files matched your search

+1
View File
@@ -203,6 +203,7 @@ it.layer(NodeServices.layer)("keybindings", (it) => {
assert.equal(defaultsByCommand.get("projectSearch.toggle"), "mod+shift+f");
assert.equal(defaultsByCommand.get("sidebar.toggle"), "mod+b");
assert.equal(defaultsByCommand.get("rightPanel.toggle"), "mod+alt+b");
assert.isFalse(defaultsByCommand.has("rightPanel.toggleMaximized"));
assert.equal(defaultsByCommand.get("terminal.splitVertical"), "mod+shift+d");
assert.equal(defaultsByCommand.get("modelPicker.jump.1"), "mod+1");
assert.equal(defaultsByCommand.get("modelPicker.jump.9"), "mod+9");
+8
View File
@@ -4739,6 +4739,13 @@ function ChatViewContent(props: ChatViewProps) {
return;
}
if (command === "rightPanel.toggleMaximized") {
event.preventDefault();
event.stopPropagation();
toggleRightPanelMaximized();
return;
}
if (command === "terminal.split") {
event.preventDefault();
event.stopPropagation();
@@ -4834,6 +4841,7 @@ function ChatViewContent(props: ChatViewProps) {
keybindings,
onToggleDiff,
toggleRightPanel,
toggleRightPanelMaximized,
toggleTerminalVisibility,
composerRef,
]);
@@ -135,7 +135,7 @@ describe("KeybindingsSettings.logic", () => {
expect(options).not.toContain("customModeActive");
});
it("builds command options from defaults and resolved project bindings", () => {
it("builds command options from built-in commands and resolved project bindings", () => {
const options = buildKeybindingCommandOptions([
{
command: "script.setup-db.run",
@@ -150,7 +150,9 @@ describe("KeybindingsSettings.logic", () => {
},
] satisfies ResolvedKeybindingsConfig);
expect(options).toEqual(expect.arrayContaining(["chat.new", "script.setup-db.run"]));
expect(options).toEqual(
expect.arrayContaining(["chat.new", "rightPanel.toggleMaximized", "script.setup-db.run"]),
);
});
it("reports unknown when variables without rejecting parseable expressions", () => {
@@ -1,4 +1,5 @@
import {
STATIC_KEYBINDING_COMMANDS,
type KeybindingCommand,
type KeybindingShortcut,
type KeybindingWhenNode,
@@ -255,10 +256,7 @@ export function buildWhenVariableOptions(): ReadonlyArray<WhenVariableOption> {
export function buildKeybindingCommandOptions(
keybindings: ResolvedKeybindingsConfig,
): ReadonlyArray<KeybindingCommandOption> {
const commands = new Set<KeybindingCommand>();
for (const binding of DEFAULT_RESOLVED_KEYBINDINGS) {
commands.add(binding.command);
}
const commands = new Set<KeybindingCommand>(STATIC_KEYBINDING_COMMANDS);
for (const binding of keybindings) {
commands.add(binding.command);
}
+16
View File
@@ -679,6 +679,22 @@ describe("resolveShortcutCommand", () => {
);
});
it("resolves a custom right panel maximize binding", () => {
const keybindings = compile([
{
shortcut: modShortcut("m", { shiftKey: true }),
command: "rightPanel.toggleMaximized",
},
]);
assert.strictEqual(
resolveShortcutCommand(event({ key: "m", metaKey: true, shiftKey: true }), keybindings, {
platform: "MacIntel",
}),
"rightPanel.toggleMaximized",
);
});
it("matches bracket shortcuts using the physical key code", () => {
assert.strictEqual(
resolveShortcutCommand(
+3
View File
@@ -47,6 +47,9 @@ Use **Inspect** to pick an element in the app and reveal its color token. Inspec
successful pick; its hover glow and badge preview the element and token that click will select.
**Cancel** or `Escape` exits Inspect and clears its selection and spotlight.
`rightPanel.toggleMaximized` maximizes or restores the open right panel. It has no default shortcut,
so add one in **Settings** → **Keybindings** if you want to use it.
The command palette searches active thread titles, projects, branches, user messages, and final
agent responses across connected environments. Message matches show one labeled excerpt while
keeping the thread's project, branch, and machine context visible. Message search begins after two
@@ -42,6 +42,12 @@ it.effect("parses keybinding rules", () =>
});
assert.strictEqual(parsedRightPanelToggle.command, "rightPanel.toggle");
const parsedRightPanelToggleMaximized = yield* decode(KeybindingRule, {
key: "mod+shift+m",
command: "rightPanel.toggleMaximized",
});
assert.strictEqual(parsedRightPanelToggleMaximized.command, "rightPanel.toggleMaximized");
const parsedClose = yield* decode(KeybindingRule, {
key: "mod+w",
command: "terminal.close",
+2 -1
View File
@@ -47,7 +47,7 @@ export const MODEL_PICKER_KEYBINDING_COMMANDS = [
] as const;
export type ModelPickerKeybindingCommand = (typeof MODEL_PICKER_KEYBINDING_COMMANDS)[number];
const STATIC_KEYBINDING_COMMANDS = [
export const STATIC_KEYBINDING_COMMANDS = [
"sidebar.toggle",
"terminal.toggle",
"terminal.split",
@@ -55,6 +55,7 @@ const STATIC_KEYBINDING_COMMANDS = [
"terminal.new",
"terminal.close",
"rightPanel.toggle",
"rightPanel.toggleMaximized",
"diff.toggle",
"preview.toggle",
"preview.refresh",