diff --git a/packages/views/locales/en/modals.json b/packages/views/locales/en/modals.json index 83077d996..cf002eb95 100644 --- a/packages/views/locales/en/modals.json +++ b/packages/views/locales/en/modals.json @@ -118,9 +118,6 @@ "select_agent_aria": "Select agent", "pick_an_agent": "Pick an agent…", "no_agents": "No agents available.", - "select_project_aria": "Select project", - "in_project": "in", - "no_project": "No project", "version_missing": "This agent's daemon doesn't report a CLI version. Create with agent needs multica CLI ≥ {{min}}. Upgrade the daemon and reconnect, or switch to manual create.", "version_below": "This agent's daemon CLI is {{current}} — Create with agent needs ≥ {{min}}. Upgrade the daemon, or switch to manual create.", "prompt_placeholder": "Tell the agent what to do, e.g. \"let Bohan fix the inbox loading slowness in the Web project\"", diff --git a/packages/views/locales/zh-Hans/modals.json b/packages/views/locales/zh-Hans/modals.json index a790048f7..92cd723b1 100644 --- a/packages/views/locales/zh-Hans/modals.json +++ b/packages/views/locales/zh-Hans/modals.json @@ -118,9 +118,6 @@ "select_agent_aria": "选择智能体", "pick_an_agent": "选一个智能体...", "no_agents": "暂无可用智能体。", - "select_project_aria": "选择项目", - "in_project": "在", - "no_project": "无项目", "version_missing": "该智能体的守护进程没有报告 CLI 版本。通过智能体创建需要 multica CLI ≥ {{min}}。请升级守护进程并重连,或切换到手动创建。", "version_below": "该智能体的守护进程 CLI 是 {{current}}——通过智能体创建需要 ≥ {{min}}。请升级守护进程,或切换到手动创建。", "prompt_placeholder": "告诉智能体要做什么,例如:\"让 Bohan 修一下 Web 项目里收件箱加载慢的问题\"", diff --git a/packages/views/modals/quick-create-issue.tsx b/packages/views/modals/quick-create-issue.tsx index 6992dde04..3113b5332 100644 --- a/packages/views/modals/quick-create-issue.tsx +++ b/packages/views/modals/quick-create-issue.tsx @@ -31,7 +31,8 @@ import { useFileUpload } from "@multica/core/hooks/use-file-upload"; import { formatShortcut, modKey, enterKey } from "@multica/core/platform"; import type { Agent } from "@multica/core/types"; import { ActorAvatar } from "../common/actor-avatar"; -import { ProjectIcon } from "../projects/components/project-icon"; +import { PillButton } from "../common/pill-button"; +import { ProjectPicker } from "../projects/components/project-picker"; import { canAssignAgent } from "../issues/components/pickers/assignee-picker"; import { useAuthStore } from "@multica/core/auth"; import { memberListOptions } from "@multica/core/workspace/queries"; @@ -66,7 +67,6 @@ export function AgentCreatePanel({ data?: Record | null; }) { const { t } = useT("modals"); - const { t: tProjects } = useT("projects"); const workspaceName = useCurrentWorkspace()?.name; const wsId = useWorkspaceId(); const userId = useAuthStore((s) => s.user?.id); @@ -136,10 +136,6 @@ export function AgentCreatePanel({ if (projectId === null || projects.length === 0) return; if (!projects.some((p) => p.id === projectId)) setProjectId(null); }, [projects, projectId]); - const selectedProject = useMemo( - () => projects.find((p) => p.id === projectId), - [projects, projectId], - ); // Daemon CLI version gate. The agent-create flow needs the runtime's // bundled multica CLI to be ≥ MIN_QUICK_CREATE_CLI_VERSION; older @@ -312,12 +308,8 @@ export function AgentCreatePanel({ - {/* Agent + project pickers — share one row so the modal stays compact. - The project picker remembers the user's last pick across opens - (useQuickCreateStore.lastProjectId) so workspaces that primarily - ship into one project don't have to retype "in project A" on - every prompt. */} -
+ {/* Agent picker */} +
- - {/* Project picker — visually subordinate to the agent picker (it's - the optional second target), placed on the same row so the - header stays one tight line. Hidden entirely when the workspace - has no projects — there is nothing to pick. */} - {projects.length > 0 && ( - - $.create_issue.agent.select_project_aria)} - className="flex max-w-[14rem] items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer rounded-sm px-1.5 py-1 hover:bg-accent/60" - > - {selectedProject ? ( - <> - {t(($) => $.create_issue.agent.in_project)} - - - {selectedProject.title} - - - ) : ( - {t(($) => $.create_issue.agent.no_project)} - )} - - } - /> - - setProjectId(null)} - className="flex items-center gap-2" - > - - {tProjects(($) => $.picker.no_project)} - - {projectId === null && ( - - )} - - {projects.map((p) => ( - setProjectId(p.id)} - className="flex items-center gap-2" - > - - {p.title} - {projectId === p.id && ( - - )} - - ))} - - - )}
{selectedAgent && versionBlocked && ( @@ -470,6 +406,21 @@ export function AgentCreatePanel({
{error}
)} + {/* Property toolbar — mirrors the manual panel's pill row so the + project pill sits in the same place across both modes. Agent mode + owns only the project (status / priority / assignee / due-date are + inferred from the prompt), so it's a single pill. The pick is + persisted per-workspace via useQuickCreateStore.lastProjectId so + users targeting one project skip retyping "in project X". */} +
+ setProjectId(u.project_id ?? null)} + triggerRender={} + align="start" + /> +
+ {/* Footer */}