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