feat(sidebar): keyboard shortcuts for stack menu actions (#729)

* feat(sidebar): implement keyboard shortcuts for stack menu actions

Shortcut labels shown in the context menu and kebab menu were purely
decorative. This wires them up to the corresponding actions on the
currently selected stack.

Cmd/Ctrl shortcuts: Enter (deploy), . (stop), R (restart), Up (update),
Backspace (delete). Single-key shortcuts: a (alerts), h (auto-heal,
paid), u (check updates), p (pin/unpin).

Guards: shortcuts are blocked when an input element is focused, when the
global command palette dialog is open, when no stack is selected, or
when the stack is busy. All visibility and busy flags from the menu
context are respected.

* docs(sidebar): document keyboard shortcuts for stack actions
This commit is contained in:
Anso
2026-04-23 16:45:10 -04:00
committed by GitHub
parent d47f6b40e4
commit 1ef96582e1
3 changed files with 110 additions and 0 deletions
@@ -1,5 +1,6 @@
import { useMemo } from 'react';
import { ArrowUpRight, Loader2 } from 'lucide-react';
import { useStackKeyboardShortcuts } from '@/hooks/useStackKeyboardShortcuts';
import { CommandItem, CommandList } from '@/components/ui/command';
import { Skeleton } from '@/components/ui/skeleton';
import type { Label } from '@/components/label-types';
@@ -108,6 +109,8 @@ export function StackList(props: StackListProps) {
[files, pinnedFiles, stackLabelMap, labels],
);
useStackKeyboardShortcuts(selectedFile, buildMenuCtx);
if (isLoading) {
return (
<div className="space-y-2 px-2 mt-2">