feat: add web master-agent chat menu
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
popAppHistoryEntry,
|
||||
resolveAppBackAction,
|
||||
} from "@/lib/boss-app-client";
|
||||
import { getMasterAgentChatMenuItems } from "@/lib/master-agent-chat-menu";
|
||||
import {
|
||||
extractApprovedTargetProjectIds,
|
||||
summarizeDispatchPlan,
|
||||
@@ -810,6 +811,52 @@ export function MasterIdentityPill({ identity }: { identity: MasterIdentitySumma
|
||||
);
|
||||
}
|
||||
|
||||
export function MasterAgentChatMenu({ projectId }: { projectId: string }) {
|
||||
const router = useRouter();
|
||||
const items = getMasterAgentChatMenuItems(projectId);
|
||||
|
||||
if (items.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<details className="relative">
|
||||
<summary
|
||||
className="flex h-9 w-9 list-none items-center justify-center rounded-full border border-[#E5E5EA] bg-white text-[18px] font-semibold leading-none text-[#57606A] shadow-sm marker:content-none"
|
||||
aria-label="更多"
|
||||
>
|
||||
…
|
||||
</summary>
|
||||
<div className="absolute right-0 top-11 z-20 min-w-[116px] rounded-2xl border border-[#E5E5EA] bg-white p-2 shadow-[0_12px_28px_rgba(15,23,42,0.14)]">
|
||||
{items.map((item) =>
|
||||
item.href ? (
|
||||
<Link
|
||||
key={item.key}
|
||||
href={item.href}
|
||||
className="flex rounded-xl px-3 py-2 text-[13px] text-[#111111] hover:bg-[#F7F8FA]"
|
||||
>
|
||||
{item.label}
|
||||
</Link>
|
||||
) : (
|
||||
<button
|
||||
key={item.key}
|
||||
type="button"
|
||||
onClick={() => {
|
||||
if (item.action === "refresh") {
|
||||
router.refresh();
|
||||
}
|
||||
}}
|
||||
className="flex w-full rounded-xl px-3 py-2 text-left text-[13px] text-[#111111] hover:bg-[#F7F8FA]"
|
||||
>
|
||||
{item.label}
|
||||
</button>
|
||||
),
|
||||
)}
|
||||
</div>
|
||||
</details>
|
||||
);
|
||||
}
|
||||
|
||||
type PendingDispatchPlanState = {
|
||||
planId: string;
|
||||
summary?: string;
|
||||
|
||||
Reference in New Issue
Block a user