feat: add command palette with cross-board search and actions
This commit is contained in:
@@ -41,6 +41,20 @@ export function BoardView() {
|
||||
const [newColumnTitle, setNewColumnTitle] = useState("");
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
// Listen for custom event to open card detail from command palette
|
||||
useEffect(() => {
|
||||
function handleOpenCard(e: Event) {
|
||||
const detail = (e as CustomEvent<{ cardId: string }>).detail;
|
||||
if (detail?.cardId) {
|
||||
setSelectedCardId(detail.cardId);
|
||||
}
|
||||
}
|
||||
document.addEventListener("open-card-detail", handleOpenCard);
|
||||
return () => {
|
||||
document.removeEventListener("open-card-detail", handleOpenCard);
|
||||
};
|
||||
}, []);
|
||||
|
||||
// Drag state
|
||||
const [activeId, setActiveId] = useState<string | null>(null);
|
||||
const [activeType, setActiveType] = useState<"card" | "column" | null>(null);
|
||||
|
||||
Reference in New Issue
Block a user