提交工作区中 AI 写作(表单/时间线/历史/上下文/流式 hook/类型)、 研究模板配置页、lead_agent、researcher/graph/state 及 gateway/config 的进行中改动。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
51 lines
1.7 KiB
TypeScript
51 lines
1.7 KiB
TypeScript
import { UserRound } from 'lucide-react';
|
|
import type { CompletedIntervention } from '../../types/ai-writing';
|
|
|
|
/**
|
|
* 时间线里「用户输入交互的要求」独立样式卡 —— 与 AI 步骤(灰)、完成卡(绿)、
|
|
* 等待卡(黄)在视觉上明确区分:靛蓝主色 + 用户图标 + 顶部要求类型标签。
|
|
*
|
|
* 触发场景(record.userInput 非空时):
|
|
* 素材确认 → 按用户要求补充检索内容
|
|
* 大纲确认 → 用户提出大纲修改意见
|
|
* 草稿确认 → 用户提出写作修改意见
|
|
* 编辑意见处理 → 用户在编辑审核时提出处理意见
|
|
*/
|
|
|
|
function requirementLabel(record: CompletedIntervention): string {
|
|
switch (record.pausePoint) {
|
|
case 'material_confirm':
|
|
return '补充检索内容';
|
|
case 'outline_confirm':
|
|
return '修改大纲意见';
|
|
case 'draft_confirm':
|
|
return '修改写作意见';
|
|
case 'review_confirm':
|
|
return '编辑审核意见';
|
|
default:
|
|
return '我的要求';
|
|
}
|
|
}
|
|
|
|
interface Props {
|
|
record: CompletedIntervention;
|
|
}
|
|
|
|
export function UserRequirementCard({ record }: Props) {
|
|
if (!record.userInput) return null;
|
|
|
|
return (
|
|
<div className="mt-2 rounded-md border border-indigo-200 bg-indigo-50/60 dark:border-indigo-900/40 dark:bg-indigo-950/20 px-3 py-2">
|
|
<div className="flex items-center gap-1.5">
|
|
<UserRound className="size-3.5 text-indigo-500 shrink-0" />
|
|
<span className="text-[11px] font-semibold text-indigo-600 dark:text-indigo-400">
|
|
我的要求 · {requirementLabel(record)}
|
|
</span>
|
|
</div>
|
|
<p className="mt-1 pl-5 text-xs leading-relaxed text-foreground/90 whitespace-pre-wrap break-words">
|
|
{record.userInput}
|
|
</p>
|
|
</div>
|
|
);
|
|
}
|