From 8e127c2cebb95660cfb717bf3c0d310208eda624 Mon Sep 17 00:00:00 2001 From: Ruud Andriessen Date: Tue, 10 Mar 2026 22:24:47 +0100 Subject: [PATCH] fix: prevent duplicate new task hotkey --- src/components/layout/task-list.tsx | 1 + src/components/new-task-button.tsx | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/layout/task-list.tsx b/src/components/layout/task-list.tsx index 18237c4..213459c 100644 --- a/src/components/layout/task-list.tsx +++ b/src/components/layout/task-list.tsx @@ -112,6 +112,7 @@ export function TaskList() { variant="ghost" size="icon-xs" iconOnly + hotkeyEnabled className="text-muted-foreground shadow-none hover:border-transparent hover:shadow-none" /> diff --git a/src/components/new-task-button.tsx b/src/components/new-task-button.tsx index d0427f5..3167ce8 100644 --- a/src/components/new-task-button.tsx +++ b/src/components/new-task-button.tsx @@ -14,9 +14,14 @@ type ButtonProps = ComponentProps; type NewTaskButtonProps = Omit & { iconOnly?: boolean; + hotkeyEnabled?: boolean; }; -export function NewTaskButton({ iconOnly = false, ...props }: NewTaskButtonProps) { +export function NewTaskButton({ + iconOnly = false, + hotkeyEnabled = false, + ...props +}: NewTaskButtonProps) { const navigate = useNavigate(); const [creating, setCreating] = useState(false); const { data: projects } = useLiveQuery((query) => @@ -25,7 +30,7 @@ export function NewTaskButton({ iconOnly = false, ...props }: NewTaskButtonProps const [defaultProject] = projects; - useHotkey(hotkeys.newTask.keys, () => handleNewTask()); + useHotkey(hotkeys.newTask.keys, () => handleNewTask(), { enabled: hotkeyEnabled }); function handleNewTask() { const repoUrl = defaultProject?.repo_url;