fix: quick add opens create ui

Add createKey to quick-add manifests and client create dialog host.

FAB and command palette open in-place create UIs instead of navigating away.
This commit is contained in:
ginnoir
2026-07-04 11:47:35 -05:00
parent 76f68548b2
commit 68a573c4d6
24 changed files with 1017 additions and 20 deletions
+18 -1
View File
@@ -6,10 +6,13 @@ import type { SerializedQuickAddItem } from "@/modules/_core";
type QuickAddState = {
sheetOpen: boolean;
paletteOpen: boolean;
activeCreateKey: string | null;
openSheet: () => void;
closeSheet: () => void;
openPalette: () => void;
closePalette: () => void;
openCreate: (key: string) => void;
closeCreate: () => void;
actions: SerializedQuickAddItem[];
};
@@ -30,11 +33,14 @@ export function QuickAddProvider({
}) {
const [sheetOpen, setSheetOpen] = useState(false);
const [paletteOpen, setPaletteOpen] = useState(false);
const [activeCreateKey, setActiveCreateKey] = useState<string | null>(null);
const openSheet = useCallback(() => setSheetOpen(true), []);
const closeSheet = useCallback(() => setSheetOpen(false), []);
const openPalette = useCallback(() => setPaletteOpen(true), []);
const closePalette = useCallback(() => setPaletteOpen(false), []);
const openCreate = useCallback((key: string) => setActiveCreateKey(key), []);
const closeCreate = useCallback(() => setActiveCreateKey(null), []);
useEffect(() => {
function onKeyDown(e: KeyboardEvent) {
@@ -49,7 +55,18 @@ export function QuickAddProvider({
return (
<QuickAddContext.Provider
value={{ sheetOpen, paletteOpen, openSheet, closeSheet, openPalette, closePalette, actions }}
value={{
sheetOpen,
paletteOpen,
activeCreateKey,
openSheet,
closeSheet,
openPalette,
closePalette,
openCreate,
closeCreate,
actions,
}}
>
{children}
</QuickAddContext.Provider>