refactor(frontend): 右栏去术语——本章参考/AI 写这章会参考/写完后检查,删重复去审稿(UX P1-3)

This commit is contained in:
Yaojia Wang
2026-07-10 18:00:36 +02:00
parent 59d7c75737
commit 9f6cbb5598

View File

@@ -1,6 +1,5 @@
"use client";
import Link from "next/link";
import { Minus, Pin, PinOff, Plus, RotateCcw, Undo2, X } from "lucide-react";
import { ThinkingIndicator } from "@/components/ThinkingIndicator";
@@ -45,11 +44,11 @@ export function AssistantContent({ projectId, chapterNo }: ChapterAssistantProps
return (
<div className="px-4">
<SectionHeader
title="本章助手"
title="本章参考"
action={
injection.saving ? (
<ThinkingIndicator
label="助手保存中"
label="保存中"
className="text-xs text-ink-soft"
/>
) : null
@@ -58,7 +57,7 @@ export function AssistantContent({ projectId, chapterNo }: ChapterAssistantProps
<section className="mt-4">
<SectionHeader
title="本章注入(透明)"
title="AI 写这章会参考"
action={
data ? (
<RecentStepper
@@ -71,10 +70,10 @@ export function AssistantContent({ projectId, chapterNo }: ChapterAssistantProps
/>
{injection.loading ? (
<p className="mt-2 text-xs text-ink-soft"></p>
<p className="mt-2 text-xs text-ink-soft"></p>
) : !data ? (
// 首次加载失败data 仍为空 → 满屏错误框 + 重试。
<StatusNote variant="danger" className="mt-2 text-xs" title="注入信息暂不可用">
<StatusNote variant="danger" className="mt-2 text-xs" title="参考信息暂不可用">
<p></p>
<button
type="button"
@@ -115,7 +114,7 @@ export function AssistantContent({ projectId, chapterNo }: ChapterAssistantProps
{selected.length === 0 ? (
<p className="mt-2 rounded border border-dashed border-line bg-bg p-3 text-xs text-ink-soft">
/
AI /
</p>
) : (
<ul className="mt-2 space-y-2">
@@ -139,7 +138,7 @@ export function AssistantContent({ projectId, chapterNo }: ChapterAssistantProps
{excluded.length > 0 ? (
<div className="mt-3">
<SectionHeader title="已排除(不注入" />
<SectionHeader title="已排除(本章不参考" />
<ul className="mt-1 space-y-1">
{excluded.map((ref) => (
<ExcludedRow
@@ -156,15 +155,9 @@ export function AssistantContent({ projectId, chapterNo }: ChapterAssistantProps
<section className="mt-6">
<SectionHeader
title="四审"
description="一致性 / 伏笔 / 文风 / 节奏,在审稿逐条裁决。"
title="写完后检查"
description="写完这章AI 会把一致性、伏笔、文风、节奏各查一遍。到左栏或底栏的「审稿逐条。"
/>
<Link
href={`/projects/${projectId}/review?chapter=${chapterNo}`}
className={buttonClass({ variant: "outline", size: "sm", className: "mt-2" })}
>
稿
</Link>
</section>
</div>
);
@@ -194,7 +187,7 @@ function EntityRow({ entity, pinned, disabled, onTogglePin, onExclude }: EntityR
disabled={disabled}
aria-pressed={pinned}
aria-label={
pinned ? `取消置顶 ${entity.name}` : `置顶 ${entity.name}强制注入`
pinned ? `取消置顶 ${entity.name}` : `置顶 ${entity.name}一定参考`
}
onClick={() => onTogglePin(ref)}
className={pinned ? "text-cinnabar" : undefined}
@@ -209,7 +202,7 @@ function EntityRow({ entity, pinned, disabled, onTogglePin, onExclude }: EntityR
variant="ghost"
size="icon"
disabled={disabled}
aria-label={`排除 ${entity.name}不注入本章)`}
aria-label={`排除 ${entity.name}(本章不参考`}
onClick={() => onExclude(ref)}
>
<X className="h-4 w-4" aria-hidden="true" />