mirror of
https://github.com/multica-ai/multica.git
synced 2026-08-12 10:59:06 +02:00
Adds a streamlined create-issue UI bound to the c shortcut: pick an agent, type one line, submit. The modal closes immediately and the agent translates the prompt into a multica issue create call in the background. Shift+c keeps the legacy advanced form for users who want every field. The "Advanced" button inside the new modal seeds the shared issue-draft store with the prompt + picked agent so switching mid-flow doesn't lose input. Last-used agent persists per (user, workspace) via a workspace-aware zustand store so frequent users skip the picker on every open. Inbox renders quick_create_done items with a status pin to the new issue and quick_create_failed items with an "Edit as advanced form" CTA that re-seeds the legacy modal with the original prompt. ApiError now carries the parsed JSON body so the modal can branch on the structured agent_unavailable code without parsing the error message.
30 lines
676 B
TypeScript
30 lines
676 B
TypeScript
"use client";
|
|
|
|
import { create } from "zustand";
|
|
|
|
type ModalType =
|
|
| "create-workspace"
|
|
| "create-issue"
|
|
| "quick-create-issue"
|
|
| "create-project"
|
|
| "feedback"
|
|
| "issue-set-parent"
|
|
| "issue-add-child"
|
|
| "issue-delete-confirm"
|
|
| "issue-backlog-agent-hint"
|
|
| null;
|
|
|
|
interface ModalStore {
|
|
modal: ModalType;
|
|
data: Record<string, unknown> | null;
|
|
open: (modal: NonNullable<ModalType>, data?: Record<string, unknown> | null) => void;
|
|
close: () => void;
|
|
}
|
|
|
|
export const useModalStore = create<ModalStore>((set) => ({
|
|
modal: null,
|
|
data: null,
|
|
open: (modal, data = null) => set({ modal, data }),
|
|
close: () => set({ modal: null, data: null }),
|
|
}));
|