feat(shortcuts): add bindable Pin/Unpin Workspace action

OY
2mo ago
+200-1

▎ 🤖 Authored with AI assistance. This change was implemented with Claude (Anthropic) via Claude Code. A human author reviewed it and is responsible for the submission. Commits carry a Co-Authored-By: Claude trailer.

Summary

What changed? Adds a bindable keyboard-shortcut action, Pin or Unpin Focused Workspace, that toggles the pinned state of the currently focused workspace.

Why? The behavior already exists via the workspace context menu and the command palette (TabManager.togglePin), but there was no way to pin/unpin from the keyboard. This exposes it as a first-class, user-customizable shortcut action.

Design notes:

  • Ships unbound by default. The natural mnemonic (⌘⇧F) collides with an existing default binding, so instead of forcing a conflicting default, the action ships unbound and users can assign any chord in Settings → Keyboard Shortcuts. This mirrors the precedent set by sendFeedback and the canvas-align actions.
  • Implementation mirrors the existing toggleFocusedWorkspaceGroupCollapsed action end-to-end (enum case, group, label, default, routing) to stay consistent with how focused-workspace actions are wired.
  • The routing handler returns false (lets the chord propagate) when no workspace is focused, consistent with the group shortcuts' fall-through policy.

Files changed:

  • CmuxSettings/ShortcutAction: new togglePinnedWorkspace case + navigation group membership + display label
  • CmuxSettings/ShortcutAction+Defaults: unbound default stroke
  • KeyboardShortcutSettings.Action: mirrored case, label, and unbound default
  • AppDelegate: shortcut routing + handleTogglePinnedWorkspaceShortcut (calls TabManager.togglePin on the focused workspace)
  • web/data/cmux.schema.json + web/data/cmux-shortcuts.ts: binding enum entry + shortcuts metadata

Testing

  • CmuxSettings package builds cleanly (swift build) and all 251 package tests pass (swift test).
  • Full macOS app (Debug) builds cleanly with the change.
  • Verified manually: bound the action to ⌘⇧F in Settings → Keyboard Shortcuts, then confirmed it pins and unpins the focused workspace, matching the existing context-menu "Pin Workspace" behavior.

Demo Video

For UI or behavior changes, include a short demo video (GitHub upload, Loom, or other direct link).

  • Video URL or attachment:

Review Trigger (Copy/Paste as PR comment)

@codex review
@coderabbitai review
@greptile-apps review
@cubic-dev-ai review

Checklist

  • I tested the change locally
  • I added or updated tests for behavior changes
  • I updated docs/changelog if needed
  • I requested bot reviews after my latest commit (copy/paste block above or equivalent)
  • All code review bot comments are resolved
  • All human review comments are resolved

🤖 Generated with Claude Code


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


[!NOTE]
Low Risk
Shortcut plumbing only; no new pin logic beyond calling existing togglePin, ships unbound so default behavior is unchanged.

Overview
Adds a new customizable shortcut action Pin or Unpin Focused Workspace so users can toggle pin state from the keyboard; it reuses existing TabManager.togglePin behavior already available from the context menu and command palette.

The action is wired end-to-end like other focused-workspace shortcuts: new togglePinnedWorkspace cases in CmuxSettings and KeyboardShortcutSettings, unbound by default (to avoid default-key collisions such as ⌘⇧F), and AppDelegate routing via handleTogglePinnedWorkspaceShortcut that only consumes the key when a focused workspace exists—otherwise the chord falls through to other bindings.

Web shortcut metadata and cmux.schema.json are updated so the action appears in docs and config validation.

Reviewed by Cursor Bugbot for commit a0498f0d22fe663d112dcdd0db344260cb9880ee. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Adds a bindable keyboard shortcut to pin or unpin the focused workspace, reusing the existing TabManager.togglePin behavior.

  • New togglePinnedWorkspace action, routed in AppDelegate through the main container to toggle the focused workspace.
  • Ships unbound by default to avoid colliding with an existing binding; assign a chord in Settings → Keyboard Shortcuts (e.g., ⌘⇧F).
  • The chord only fires when a live focused workspace exists; otherwise it falls through to other bindings, so a stale selection doesn't swallow the key.
  • Updated embedded config schema, web shortcuts metadata, skill docs, and localized labels across all 20 locales.

Summary by CodeRabbit

  • New Features

    • Added a “Pin or Unpin Focused Workspace” shortcut action, available in the context menu and command palette.
    • The action is intentionally shipped unbound by default to avoid shortcut collisions.
    • Added localized label/description (English and Japanese) and enabled configurable bindings in shortcut settings (including chords).
  • Bug Fixes

    • Shortcut handling no longer consumes keyboard events when no valid focused workspace/tab is available, allowing other matching shortcuts to trigger.