fix(app): make cmd+o work regardless of sidebar visibility

The worktree.new keyboard handler was registered inside ProjectHeaderRow,
which only mounts when the sidebar is open. Register a single global handler
in the app layout keyed off the navigation-active workspace selection.
This commit is contained in:
Mohamed Boudra
2026-04-18 16:03:01 +07:00
parent 14cc1cc83c
commit b0e0786419
3 changed files with 61 additions and 11 deletions
@@ -797,17 +797,6 @@ function ProjectHeaderRow({
const mergeWorkspaces = useSessionStore((state) => state.mergeWorkspaces);
const toast = useToast();
useKeyboardActionHandler({
handlerId: `worktree-new-${project.projectKey}`,
actions: ["worktree.new"],
enabled: isProjectActive && canCreateWorktree && Boolean(serverId),
priority: 0,
handle: () => {
handleBeginWorkspaceSetup();
return true;
},
});
const interaction = useLongPressDragInteraction({
drag,
menuController,