mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-27 21:33:41 +02:00
feat(views): auto-fill project when creating issue via C shortcut on project page
When pressing "C" to create a new issue from a project detail page, automatically set the project_id so the issue is linked to the current project. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -127,12 +127,15 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }
|
||||
if (isEditable) return;
|
||||
if (useModalStore.getState().modal) return;
|
||||
e.preventDefault();
|
||||
useModalStore.getState().open("create-issue");
|
||||
// Auto-fill project when on a project detail page
|
||||
const projectMatch = pathname.match(/^\/projects\/([^/]+)$/);
|
||||
const data = projectMatch ? { project_id: projectMatch[1] } : undefined;
|
||||
useModalStore.getState().open("create-issue", data);
|
||||
}
|
||||
};
|
||||
document.addEventListener("keydown", handleKeyDown);
|
||||
return () => document.removeEventListener("keydown", handleKeyDown);
|
||||
}, []);
|
||||
}, [pathname]);
|
||||
|
||||
return (
|
||||
<Sidebar variant="inset">
|
||||
|
||||
Reference in New Issue
Block a user