Skip to content

feat(shortcuts): add assignable shortcut to toggle sleeping workspaces - #6169

Merged
Jinwoo-H merged 3 commits into
stablyai:mainfrom
mmarabel:feat/toggle-sleeping-workspaces-shortcut
Jun 23, 2026
Merged

Jinwoo-H merged 3 commits into
stablyai:mainfrom
mmarabel:feat/toggle-sleeping-workspaces-shortcut

Conversation

@mmarabel

Copy link
Copy Markdown
Contributor

What & why

Closes #5209.

Revealing a sleeping workspace today is a four-step dance: open the sidebar
filter menu -> toggle "Hide sleeping" off -> click the now-visible worktree to
wake it -> reopen the menu to hide sleeping again. This adds a keyboard
shortcut that flips the "show sleeping workspaces" filter directly.

Changes

  • New keybinding action sidebar.sleepingWorkspaces.toggle ("Toggle
    Sleeping Workspaces", Global group), shipped unbound by default —
    matching existing assign-it-yourself commands (sidebar.checks.toggle,
    workspace.openBoard). Users bind it in Settings -> Shortcuts. This avoids
    claiming a cross-platform chord and is exactly what the issue requests.
  • When the shortcut reveals sleeping workspaces, the left sidebar opens so
    the now-visible worktrees are reachable (the issue's real goal). Hiding
    forces no sidebar change.
  • The filter menu's "Hide sleeping" row now displays the assigned chord, so the
    menu doubles as the shortcut's discovery point.

Testing

  • Added a registry regression test: the action ships unbound on all platforms,
    becomes matchable once a user binds it, and is discoverable by title/keywords.
  • oxlint, typecheck, and build pass; new and adjacent test files pass.
  • Manually verified on macOS with a custom binding: toggles the filter, opens
    the left sidebar on reveal, and shows the chord on the "Hide sleeping" row.

AI-agent review summary

  • Cross-platform: No hardcoded modifiers; uses the shared keybinding
    registry (Mod -> Cmd on macOS, Ctrl on Linux/Windows). Unbound on all three
    platforms, so no default-chord collisions. Labels render via the existing
    platform-aware useShortcutLabel.
  • SSH / remote / local: Pure renderer UI-state toggle (zustand
    showSleepingWorkspaces); no process/file/shell/network assumptions.
    Identical for local, remote, and SSH worktrees.
  • Agent / integration compatibility: No agent/integration code touched;
    provider-neutral (no GitHub/GitLab-specific logic).
  • Performance: O(1) state flip in the existing keydown dispatcher; no new
    listeners, timers, or hot-path work.
  • UI quality: Uses the DropdownMenuShortcut shadcn primitive and existing
    tokens — no new colors/sizes.
  • Security: No new IPC, no input parsing, no privilege boundaries crossed.

Platform / testing notes

Verified manually on macOS with a custom binding. The action is layout-position
based (physical Backslash when bound to e.g. Cmd+), which does not collide
with terminal Ctrl+\ (SIGQUIT). No visual change unless a user assigns a binding.

Demo

Screen recording attached in the PR conversation below.

Add a "Toggle Sleeping Workspaces" keybinding action that flips the
sidebar's show-sleeping-workspaces filter without opening the filters
menu. Ships unbound (like sidebar.checks.toggle / workspace.openBoard)
so users assign their own chord in Settings -> Shortcuts. Revealing
sleeping workspaces also opens the left sidebar so they're reachable,
and the filter menu's "Hide sleeping" row surfaces the assigned chord
for discoverability.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mmarabel

Copy link
Copy Markdown
Contributor Author

Screen Recording:

sleepingtoggle-clean.mov

@coderabbitai

coderabbitai Bot commented Jun 23, 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

Run ID: a9dd7056-1cc3-47e2-a966-800b96d152fe

📥 Commits

Reviewing files that changed from the base of the PR and between 793aed2 and 98e25b1.

📒 Files selected for processing (4)
  • src/renderer/src/App.tsx
  • src/renderer/src/components/task-page-github-work-item-status.ts
  • src/shared/keybindings.test.ts
  • src/shared/keybindings.ts
💤 Files with no reviewable changes (1)
  • src/renderer/src/components/task-page-github-work-item-status.ts
✅ Files skipped from review due to trivial changes (1)
  • src/renderer/src/App.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/shared/keybindings.ts
  • src/shared/keybindings.test.ts

📝 Walkthrough

Walkthrough

A new keybinding action, sidebar.sleepingWorkspaces.toggle, is registered in the shared KeybindingActionId union and KEYBINDING_DEFINITIONS array with no default bindings assigned. A handler for this action is added to the global window-level shortcut dispatcher in App.tsx, which toggles the showSleepingWorkspaces Zustand state and conditionally opens the left sidebar. SidebarFilter is updated to resolve the user-assigned shortcut label via useShortcutLabel and display it in the "Hide sleeping" toggle row using a new shortcutLabel prop on FilterToggleRow. Tests verify the action is unassigned by default and matches after a user override. An unrelated change removes the default fallback case in a getTaskPageGitHubPRIconTone switch statement.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main change: adding an assignable keyboard shortcut for toggling sleeping workspaces visibility.
Description check ✅ Passed The description comprehensively covers all required template sections with detailed implementation details, testing evidence, and cross-platform considerations.
Linked Issues check ✅ Passed The PR directly addresses issue #5209 by implementing an assignable keyboard shortcut to toggle sleeping workspaces, eliminating the multi-step workflow described in the issue.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the keybinding feature. The removal of a switch fallback in the GitHub PR status icon file is a minor cleanup unrelated to the main feature but not a material out-of-scope change.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

Jinwoo-H and others added 2 commits June 23, 2026 13:45
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>

@Jinwoo-H Jinwoo-H 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.

Thanks, this is in good shape.

Verified locally:

  • added sidebar.sleepingWorkspaces.toggle as an unbound, assignable global shortcut
  • custom binding toggles sleeping workspace visibility
  • revealing sleeping workspaces opens the left sidebar
  • filter menu shows the assigned shortcut
  • typecheck, lint, focused keybinding tests, and Electron validation pass

I also resolved the main conflict and included a small lint cleanup needed for current main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Allow Shortcut to Toggle Sleeping Workspaces on/off

2 participants