Add keyboard shortcuts for worktree actions and dynamic shortcut display
Replace all hardcoded shortcut key rendering with useShortcutKeys() so rebound shortcuts always display correctly. Add Cmd+O (new worktree), Cmd+Shift+Backspace (archive worktree) with proper active-project scoping. Show shortcut hints in tooltips and dropdown menus. Fix tooltip alignment to center, bump dropdown menu surface level, simplify TerminalPane to single-terminal, and add special key display symbols.
This commit is contained in:
@@ -2,8 +2,20 @@ export type ShortcutKey = "mod" | "shift" | "alt" | "ctrl" | "meta" | string;
|
||||
|
||||
export type ShortcutOs = "mac" | "non-mac";
|
||||
|
||||
const KEY_DISPLAY: Record<string, string> = {
|
||||
Backspace: "⌫",
|
||||
Enter: "↩",
|
||||
Esc: "⎋",
|
||||
Space: "␣",
|
||||
Left: "←",
|
||||
Right: "→",
|
||||
Up: "↑",
|
||||
Down: "↓",
|
||||
};
|
||||
|
||||
function normalizeKey(key: string): string {
|
||||
if (!key) return "";
|
||||
if (KEY_DISPLAY[key]) return KEY_DISPLAY[key];
|
||||
if (key.length === 1) return key.toUpperCase();
|
||||
return key;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user