diff --git a/apps/web/components/foreshadow/ForeshadowBoard.tsx b/apps/web/components/foreshadow/ForeshadowBoard.tsx index 8818295..2501911 100644 --- a/apps/web/components/foreshadow/ForeshadowBoard.tsx +++ b/apps/web/components/foreshadow/ForeshadowBoard.tsx @@ -62,15 +62,17 @@ export function ForeshadowBoard({ title="伏笔看板" description="跟踪每条伏笔从埋设、推进到回收的状态,逾期项会单独提醒。" actions={ - + // registerOpen 时隐藏头部入口,避免与展开的表单重复(全局只一个 RegisterForm)。 + registerOpen ? undefined : ( + + ) } /> {registerOpen ? ( @@ -90,11 +92,16 @@ export function ForeshadowBoard({ title="还没有伏笔" description="登记第一条伏笔后,这里会按待推进、推进中、已回收、已逾期四种状态自动分栏。" action={ - + registerOpen ? undefined : ( + + ) } className="mt-6" /> @@ -138,16 +145,15 @@ function ForeshadowBoardSummary({ className="mb-3 grid grid-cols-2 gap-2 sm:grid-cols-4" > {LANES.map((status) => ( - +
{LANE_LABELS[status]} {counts[status]}
-

- {status} - {" · "} +

+ 占比{" "} {total > 0 ? `${Math.round((counts[status] / total) * 100)}%` : "0%"}

diff --git a/apps/web/components/foreshadow/KanbanColumn.tsx b/apps/web/components/foreshadow/KanbanColumn.tsx index 5d70a1b..31a33e2 100644 --- a/apps/web/components/foreshadow/KanbanColumn.tsx +++ b/apps/web/components/foreshadow/KanbanColumn.tsx @@ -26,8 +26,9 @@ export function KanbanColumn({ const overdue = status === "OVERDUE"; return (
)} - {status} {items.length}
diff --git a/apps/web/components/foreshadow/RegisterForm.tsx b/apps/web/components/foreshadow/RegisterForm.tsx index 99c00db..d583f56 100644 --- a/apps/web/components/foreshadow/RegisterForm.tsx +++ b/apps/web/components/foreshadow/RegisterForm.tsx @@ -1,9 +1,11 @@ "use client"; -import { useState, type ReactNode } from "react"; +import { useState } from "react"; import { Plus } from "lucide-react"; import { Button } from "@/components/ui/Button"; +import { Field } from "@/components/ui/Field"; +import { TextArea } from "@/components/ui/TextArea"; import { TextInput } from "@/components/ui/TextInput"; import { cardClass } from "@/lib/ui/variants"; import type { RegisterInput } from "@/lib/foreshadow/board"; @@ -71,8 +73,9 @@ export function RegisterForm({ ); } - const canSubmit = - form.code.trim().length > 0 && form.title.trim().length > 0 && !busy; + const missingRequired = + form.code.trim().length === 0 || form.title.trim().length === 0; + const canSubmit = !missingRequired && !busy; return (
- + set("code", e.target.value)} /> - - + + set("title", e.target.value)} /> - - + + set("plantedAt", e.target.value)} /> - - + + set("expectedCloseFrom", e.target.value)} /> - - + + set("expectedCloseTo", e.target.value)} /> - - + + set("importance", e.target.value)} placeholder="主线/支线" /> - - - + +