Skip to content

feat(workspace): add assignable board toggle shortcut - #12992

Open
innocarpe wants to merge 2 commits into
stablyai:mainfrom
innocarpe:feat/workspace-board-toggle-keybinding
Open

feat(workspace): add assignable board toggle shortcut#12992
innocarpe wants to merge 2 commits into
stablyai:mainfrom
innocarpe:feat/workspace-board-toggle-keybinding

Conversation

@innocarpe

Copy link
Copy Markdown
Contributor

Description

Expose the existing Workspace Board toggle as an assignable keyboard action.

Focused fix

  • In scope: route workspace.toggleBoard through the existing keybinding, preload, and renderer paths.
  • Out of scope: changing the open-only workspace.openBoard action or broadening Escape handling.

Preserves

  • workspace.openBoard keeps its open-only semantics, while the new action uses the existing board toggle implementation and platform shortcut policy.

Evidence

  • Test: pnpm exec vitest run --config config/vitest.config.ts src/shared/keybindings.test.ts src/shared/window-shortcut-policy.test.ts src/renderer/src/components/sidebar/useWorkspaceBoardPanel.test.tsx
  • Post-rebase result: 3 files, 120 tests passed.
  • Changed-file oxfmt and oxlint passed.

User-regression-tradeoffs

  • Users can bind one shortcut to open and close the board without changing sidebar-wide shortcuts or relying on Escape.

Fixes #12969

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e1b86421-dbee-49c3-9af7-d61d7212c825

📥 Commits

Reviewing files that changed from the base of the PR and between 595097b and c0f6c21.

📒 Files selected for processing (15)
  • src/main/browser/browser-guest-ui.ts
  • src/main/window/createMainWindow.test.ts
  • src/main/window/createMainWindow.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/renderer/src/App.tsx
  • src/renderer/src/components/sidebar/useWorkspaceBoardPanel.test.tsx
  • src/renderer/src/components/sidebar/useWorkspaceBoardPanel.ts
  • src/renderer/src/hooks/useIpcEvents.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/keybindings.test.ts
  • src/shared/keybindings.ts
  • src/shared/plugins/plugin-command-actions.ts
  • src/shared/window-shortcut-policy.test.ts
  • src/shared/window-shortcut-policy.ts
🚧 Files skipped from review as they are similar to previous changes (15)
  • src/main/window/createMainWindow.ts
  • src/shared/keybindings.test.ts
  • src/shared/keybindings.ts
  • src/preload/index.ts
  • src/renderer/src/App.tsx
  • src/renderer/src/web/web-preload-api.ts
  • src/renderer/src/components/sidebar/useWorkspaceBoardPanel.test.tsx
  • src/renderer/src/components/sidebar/useWorkspaceBoardPanel.ts
  • src/main/browser/browser-guest-ui.ts
  • src/shared/window-shortcut-policy.test.ts
  • src/preload/api-types.ts
  • src/shared/window-shortcut-policy.ts
  • src/shared/plugins/plugin-command-actions.ts
  • src/renderer/src/hooks/useIpcEvents.ts
  • src/main/window/createMainWindow.test.ts

📝 Walkthrough

Walkthrough

Adds the workspace.toggleBoard keybinding and maps it to the toggleWorkspaceBoard window action. Main-process handlers send ui:toggleWorkspaceBoard through the preload UI API. Renderer listeners dispatch a workspace-board toggle event, except in Settings. The workspace board hook handles the event, opens the sidebar when required, and removes its listener during cleanup. Web preload support and tests cover the new event, shortcut resolution, metadata, repeat suppression, and board state changes.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change and testing, but it omits the required Screenshots, AI Review Report, Security Audit, and Notes sections. Add all required template sections, including a no-visual-change statement, completed test checklist, AI review details with cross-platform checks, security audit, and notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding an assignable Workspace Board toggle shortcut.
Linked Issues check ✅ Passed The changes implement the requested assignable toggle, preserve open-only behavior, remain unbound by default, open the sidebar, and suppress key auto-repeat.
Out of Scope Changes check ✅ Passed The changes remain focused on routing the Workspace Board toggle through keybinding, shortcut, preload, and renderer paths without unrelated behavior changes.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/shared/window-shortcut-policy.test.ts (1)

347-347: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add coverage for the unbound default.

The PR contract requires workspace.toggleBoard to ship without a default binding. This test covers only a custom override. Resolve the Linux Ctrl+Alt+T input without overrides and assert null before testing the custom mapping.

Also applies to: 372-378


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b93b0eac-c1fe-468e-a46f-d6a86b215bef

📥 Commits

Reviewing files that changed from the base of the PR and between 7e60b33 and 6d08c1c.

📒 Files selected for processing (14)
  • src/main/browser/browser-guest-ui.ts
  • src/main/window/createMainWindow.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/renderer/src/App.tsx
  • src/renderer/src/components/sidebar/useWorkspaceBoardPanel.test.tsx
  • src/renderer/src/components/sidebar/useWorkspaceBoardPanel.ts
  • src/renderer/src/hooks/useIpcEvents.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/keybindings.test.ts
  • src/shared/keybindings.ts
  • src/shared/plugins/plugin-command-actions.ts
  • src/shared/window-shortcut-policy.test.ts
  • src/shared/window-shortcut-policy.ts

Comment thread src/main/window/createMainWindow.ts
Comment thread src/renderer/src/hooks/useIpcEvents.ts
@goransh-buh

Copy link
Copy Markdown

This looks like a solid, focused change.

@innocarpe

Copy link
Copy Markdown
Contributor Author

Thanks @goransh-buh — glad it reads as focused.

Addressed CodeRabbit:

  1. Sidebar on open: openWorkspaceBoard now calls setSidebarOpen(true) so a keyboard toggle is not a no-op while the left sidebar is collapsed (close path unchanged).
  2. Auto-repeat: toggleWorkspaceBoard is suppressed on key auto-repeat, same as quick-commands toggle (with regression test).
  3. Unbound default: policy test asserts Linux Ctrl+Alt+T resolves to null before the custom override.

tip: 22d55fd1cb

Open the left sidebar when the board opens so a keyboard toggle is not a
no-op while the sidebar is collapsed. Suppress key auto-repeat for
toggleWorkspaceBoard, and assert the unbound default binding.
@innocarpe
innocarpe force-pushed the feat/workspace-board-toggle-keybinding branch from 22d55fd to c0f6c21 Compare August 7, 2026 06:30
@innocarpe

Copy link
Copy Markdown
Contributor Author

Sync update (c0f6c21893)

Rebased onto upstream/main 595097b and revalidated the existing sidebar-open transition fix for the workspace board shortcut. Validation: 202 focused tests and changed-code quality passed.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@AmethystLiang AmethystLiang added the P2 Normal priority: nice-to-have or lower urgency label Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority: nice-to-have or lower urgency

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Assignable shortcut to close/toggle the Workspace Board

4 participants