- 冲突「采纳改法」:有补丁瞬时改入终稿并选中;无补丁但可定位则采纳时调 AI(refiner)重写该段套入;定位不到提示手改 - 正文改为行内高亮叠层编辑器(与页面同底色、随内容增高、无滚动条),点冲突卡/锚点整页滚到并选中+闪烁 - 仅对可在正文定位的冲突显示「跳转」/锚点;locate 支持从 where 引号抽原文,杜绝定位失败刷屏 - 伏笔建议卡:新埋一键登记(预填表单)/ 疑似回收一键标记 CLOSED(复用现有端点) - 审稿页草稿自动保存(防抖 PUT /draft),与「验收本章」解耦,刷新不丢 - 写作路由带章号 ?chapter=N + 验收成功面板/大纲页「写下一章」入口;写作目录从大纲列出全部章节 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
61 lines
2.0 KiB
TypeScript
61 lines
2.0 KiB
TypeScript
"use client";
|
||
|
||
import Link from "next/link";
|
||
|
||
import type { OutlineChapterView } from "@/lib/api/types";
|
||
import {
|
||
isCloseWindow,
|
||
windowBadgeLabel,
|
||
} from "@/lib/outline/outline";
|
||
|
||
interface OutlineChapterRowProps {
|
||
chapter: OutlineChapterView;
|
||
projectId: string;
|
||
}
|
||
|
||
// 单章大纲行(UX §6.7):章号 + beats + 伏笔窗口徽标(⚑)+ 「写此章」入口。
|
||
// 接近回收窗口的徽标用琥珀 + 「可回收」提示(a11y:图标 + 文案,不单靠色)。
|
||
export function OutlineChapterRow({ chapter, projectId }: OutlineChapterRowProps) {
|
||
const windows = chapter.foreshadow_windows ?? [];
|
||
return (
|
||
<li className="border-l-2 border-line py-2 pl-3">
|
||
<div className="flex flex-wrap items-center gap-2">
|
||
<span className="font-mono text-xs text-ink-soft">
|
||
第 {chapter.no} 章
|
||
</span>
|
||
<Link
|
||
href={`/projects/${projectId}/write?chapter=${chapter.no}`}
|
||
className="rounded border border-line px-1.5 py-0.5 text-xs text-ink-soft hover:border-cinnabar hover:text-cinnabar"
|
||
>
|
||
✍ 写此章
|
||
</Link>
|
||
{windows.map((w) => {
|
||
const close = isCloseWindow(chapter, w);
|
||
return (
|
||
<span
|
||
key={w.code}
|
||
title={close ? "进入回收窗口,建议本章安排回收" : undefined}
|
||
className={`rounded px-1.5 py-0.5 text-xs ${
|
||
close
|
||
? "bg-overdue/15 text-overdue"
|
||
: "bg-[var(--color-cinnabar-wash)] text-cinnabar"
|
||
}`}
|
||
>
|
||
{windowBadgeLabel(w)}
|
||
{close ? " · 可回收" : ""}
|
||
</span>
|
||
);
|
||
})}
|
||
</div>
|
||
{chapter.beats && chapter.beats.length > 0 ? (
|
||
<p className="mt-1 text-sm text-ink">
|
||
<span className="text-ink-soft">beats: </span>
|
||
{chapter.beats.join(" / ")}
|
||
</p>
|
||
) : (
|
||
<p className="mt-1 text-sm text-ink-soft/60">(无节拍)</p>
|
||
)}
|
||
</li>
|
||
);
|
||
}
|