feat: restore dispatch confirmation flows

This commit is contained in:
kris
2026-03-30 17:11:07 +08:00
parent 40861c63da
commit 5eb1246f02
15 changed files with 823 additions and 9 deletions

View File

@@ -11,8 +11,9 @@ import {
StatusBar,
} from "@/components/app-ui";
import { requirePageSession } from "@/lib/boss-auth";
import { listDispatchPlansByProject, readState } from "@/lib/boss-data";
import { latestPendingDispatchPlan } from "@/lib/dispatch-plan-ui";
import { formatTimestampLabel, getProjectDetailView } from "@/lib/boss-projections";
import { readState } from "@/lib/boss-data";
export const dynamic = "force-dynamic";
@@ -25,6 +26,9 @@ export default async function ProjectChatPage({
const { projectId } = await params;
const state = await readState();
const detail = getProjectDetailView(state, projectId);
const pendingDispatchPlan = detail?.project.isGroup
? latestPendingDispatchPlan(await listDispatchPlansByProject(projectId))
: null;
if (!detail) notFound();
@@ -147,7 +151,21 @@ export default async function ProjectChatPage({
</Link>
</div>
</div>
<ChatComposer projectId={detail.project.id} />
<ChatComposer
projectId={detail.project.id}
initialPendingDispatchPlan={
pendingDispatchPlan
? {
planId: pendingDispatchPlan.planId,
summary: pendingDispatchPlan.summary,
targets: (pendingDispatchPlan.targets ?? []).map((target) => ({
projectId: target.projectId,
threadDisplayName: target.threadDisplayName,
})),
}
: null
}
/>
</AppShell>
);
}