feat(web): 生成器 ThinkingIndicator/空结果态/数量校验 + 文风页 PageHeader + Codex 分段控件 + RefineView role 修正
This commit is contained in:
@@ -41,7 +41,7 @@ export function RefineView({
|
||||
return (
|
||||
<div
|
||||
className="rounded border border-cinnabar bg-panel p-3 text-xs"
|
||||
role="dialog"
|
||||
role="region"
|
||||
aria-label="回炉对比"
|
||||
>
|
||||
<div className="mb-2 flex items-center justify-between">
|
||||
@@ -61,14 +61,22 @@ export function RefineView({
|
||||
<Badge variant="warning">
|
||||
该段在终稿中为空,请先在终稿中保留该段正文。
|
||||
</Badge>
|
||||
) : refiner.status === "refining" ? (
|
||||
<p className="text-info">
|
||||
<ThinkingIndicator label="回炉中" />
|
||||
</p>
|
||||
) : refiner.status === "error" ? (
|
||||
<p className="text-conflict">回炉失败,请稍后重试。</p>
|
||||
) : refiner.result ? (
|
||||
<div className="space-y-2">
|
||||
) : (
|
||||
<div role="status" aria-live="polite">
|
||||
{refiner.status === "refining" ? (
|
||||
<p className="text-info">
|
||||
<ThinkingIndicator label="回炉中" />
|
||||
</p>
|
||||
) : refiner.status === "error" ? (
|
||||
<p className="text-conflict">回炉失败,请稍后重试。</p>
|
||||
) : refiner.result ? (
|
||||
<span className="sr-only">回炉完成,可对比后采纳。</span>
|
||||
) : null}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{segment.trim().length > 0 && refiner.result ? (
|
||||
<div className="mt-2 space-y-2">
|
||||
<div>
|
||||
<p className="mb-1 text-ink-soft">原段</p>
|
||||
<p className="whitespace-pre-wrap rounded border border-line bg-bg p-2 text-ink-soft line-through">
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import { AppShell } from "@/components/AppShell";
|
||||
import { PageHeader } from "@/components/ui/PageHeader";
|
||||
import { SectionHeader } from "@/components/ui/SectionHeader";
|
||||
import type { ProjectResponse } from "@/lib/api/types";
|
||||
import { useStyleLearn } from "@/lib/style/useStyleLearn";
|
||||
import type { Fingerprint, StyleLearnMode } from "@/lib/style/style";
|
||||
@@ -27,21 +29,31 @@ export function StylePage({ project, initialFingerprint }: StylePageProps) {
|
||||
projectId={project.id}
|
||||
activeNav="style"
|
||||
>
|
||||
<div className="flex min-h-[calc(100vh-var(--chrome,4rem))] flex-col lg:grid lg:h-[calc(100vh-var(--chrome,4rem))] lg:min-h-0 lg:grid-cols-[28rem_1fr]">
|
||||
<section className="flex flex-col border-line bg-panel px-6 py-6 lg:overflow-auto lg:border-r">
|
||||
<h1 className="mb-3 font-serif text-lg text-ink">学习文风</h1>
|
||||
<StyleUpload
|
||||
busy={learn.busy}
|
||||
pollStatus={learn.pollStatus === "idle" ? "idle" : learn.pollStatus}
|
||||
progress={learn.progress}
|
||||
hasFingerprint={learn.fingerprint !== null}
|
||||
onLearn={onLearn}
|
||||
<div className="flex min-h-[calc(100vh-var(--chrome,4rem))] flex-col">
|
||||
<div className="px-6 pt-6">
|
||||
<PageHeader
|
||||
title="文风指纹"
|
||||
description="上传你的代表作样本,让 AI 学出十六维文风指纹,作为后续写作与第四审的对照标尺。"
|
||||
/>
|
||||
</section>
|
||||
</div>
|
||||
<div className="flex flex-1 flex-col lg:grid lg:min-h-0 lg:grid-cols-[28rem_1fr]">
|
||||
<section className="flex flex-col border-line bg-panel px-6 py-6 lg:overflow-auto lg:border-r">
|
||||
<SectionHeader title="学习文风" className="mb-3" />
|
||||
<StyleUpload
|
||||
busy={learn.busy}
|
||||
pollStatus={
|
||||
learn.pollStatus === "idle" ? "idle" : learn.pollStatus
|
||||
}
|
||||
progress={learn.progress}
|
||||
hasFingerprint={learn.fingerprint !== null}
|
||||
onLearn={onLearn}
|
||||
/>
|
||||
</section>
|
||||
|
||||
<section className="bg-bg px-6 py-6 lg:overflow-auto">
|
||||
<FingerprintView fingerprint={learn.fingerprint} />
|
||||
</section>
|
||||
<section className="bg-bg px-6 py-6 lg:overflow-auto">
|
||||
<FingerprintView fingerprint={learn.fingerprint} />
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</AppShell>
|
||||
);
|
||||
|
||||
@@ -28,7 +28,7 @@ export function StylePanel({ style, incomplete, onRefine }: StylePanelProps) {
|
||||
return (
|
||||
<section className="mb-4">
|
||||
<h2 className="text-xs font-semibold uppercase tracking-wide text-ink-soft">
|
||||
文风 (style-auditor)
|
||||
文风
|
||||
</h2>
|
||||
{incomplete ? (
|
||||
<Badge variant="warning" className="mt-1">
|
||||
|
||||
Reference in New Issue
Block a user