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:
@@ -67,6 +67,8 @@ export type QuickAddAction = {
|
||||
icon?: string;
|
||||
/** Navigation target used by the FAB sheet and command palette. */
|
||||
url: string;
|
||||
/** Client-side create dialog key (see quick-add create registry). */
|
||||
createKey?: string;
|
||||
action?: (ctx: WidgetContext) => void | Promise<void>;
|
||||
};
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ export type SerializedQuickAddItem = {
|
||||
label: string;
|
||||
icon?: string;
|
||||
url: string;
|
||||
createKey?: string;
|
||||
moduleId: string;
|
||||
moduleName: string;
|
||||
};
|
||||
@@ -95,11 +96,12 @@ export async function fireItemToggleHooks(payload: ItemTogglePayload): Promise<v
|
||||
|
||||
export function getQuickAdds(): SerializedQuickAddItem[] {
|
||||
return [...modules.values()].flatMap((manifest) =>
|
||||
(manifest.quickAdds ?? []).map(({ id, label, icon, url }) => ({
|
||||
(manifest.quickAdds ?? []).map(({ id, label, icon, url, createKey }) => ({
|
||||
id,
|
||||
label,
|
||||
icon,
|
||||
url,
|
||||
createKey,
|
||||
moduleId: manifest.id,
|
||||
moduleName: manifest.name,
|
||||
})),
|
||||
|
||||
Reference in New Issue
Block a user