Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/client/src/input/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ const _ACTIONS = {
},
toggleRightPanel: {
label: "Toggle inspector panel",
keybind: { key: "b", code: "KeyB", mod: true },
keybind: { key: "b", code: "KeyB", mod: true, alt: true },
handler: (ctx) => ctx.toggleRightPanel(),
},
toggleRecordingPause: {
Expand Down
15 changes: 15 additions & 0 deletions packages/client/src/input/keyboard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ describe("formatKeybind (non-mac)", () => {
{ kb: { key: "t", mod: true }, expected: "Ctrl+T" },
{ kb: { key: "Tab", ctrl: true }, expected: "Ctrl+Tab" },
{ kb: { key: "]", mod: true, shift: true }, expected: "Ctrl+Shift+]" },
{ kb: { key: "b", mod: true, alt: true }, expected: "Ctrl+Alt+B" },
{ kb: { key: "t" }, expected: "T" },
{ kb: { key: "k", mod: true }, expected: "Ctrl+K" },
] as const)("formatKeybind → $expected", ({ kb, expected }) => {
Expand All @@ -129,6 +130,20 @@ describe("matchesAnyShortcut", () => {
);
});

it("does not capture Ctrl+B", () => {
expect(
matchesAnyShortcut(makeEvent({ key: "b", code: "KeyB", ctrlKey: true })),
).toBe(false);
});

it("matches Ctrl+Alt+B (toggle inspector)", () => {
expect(
matchesAnyShortcut(
makeEvent({ key: "b", code: "KeyB", ctrlKey: true, altKey: true }),
),
).toBe(true);
});

it("does not match Ctrl/Cmd+Shift+C", () => {
expect(
matchesAnyShortcut(
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/features/right-panel.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Feature: Right panel (inspector)
Collapsible right panel with metadata inspector, toggled via Cmd+B or header icon.
Collapsible right panel with metadata inspector, toggled via keyboard shortcut or header icon.
Defaults to collapsed.

Background:
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/step_definitions/right_panel_steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { type KoluWorld, MOD_KEY, POLL_TIMEOUT } from "../support/world.ts";
// ── Actions ──

When("I press the toggle inspector shortcut", async function (this: KoluWorld) {
await this.page.keyboard.press(`${MOD_KEY}+b`);
await this.page.keyboard.press(`${MOD_KEY}+Alt+b`);
await this.waitForFrame();
});

Expand Down