@@ -346,6 +333,31 @@ export function ReviewReport({
);
}
+// 审稿失败提示:友好文案(不暴露 raw code)+ 可选「去设置」动作(F4)。
+function ReviewErrorNote({
+ error,
+}: {
+ error: { code: string; message: string };
+}) {
+ const friendly = friendlyError(error.code, error.message);
+ return (
+
+ );
+}
+
interface SectionStatusLineProps {
reviewing: boolean;
done: boolean;
diff --git a/apps/web/components/workbench/Workbench.tsx b/apps/web/components/workbench/Workbench.tsx
index 238e0a7..35dcdec 100644
--- a/apps/web/components/workbench/Workbench.tsx
+++ b/apps/web/components/workbench/Workbench.tsx
@@ -5,6 +5,7 @@ import { useEffect, useRef, useState } from "react";
import { AppShell } from "@/components/AppShell";
import type { ProjectResponse } from "@/lib/api/types";
+import { friendlyError } from "@/lib/errors/messages";
import { useAutosave } from "@/lib/autosave/useAutosave";
import { useDraftStream } from "@/lib/stream/useDraftStream";
import { WORKBENCH_CHAPTER_NO } from "@/lib/workbench/chapter";
@@ -93,6 +94,31 @@ export function Workbench({ project, initialText = "" }: WorkbenchProps) {
);
}
+// 写章失败提示:友好文案(不暴露 raw code)+ 可选「去设置」动作(F4)。
+function StreamErrorNote({
+ streamError,
+}: {
+ streamError: { code: string; message: string };
+}) {
+ const friendly = friendlyError(streamError.code, streamError.message);
+ return (
+
+ {friendly.text}
+ {friendly.actionHref ? (
+ <>
+ {" "}
+
+ {friendly.actionLabel}
+
+ >
+ ) : null}
+
+ );
+}
+
interface ToolbarProps {
projectId: string;
chapterNo: number;
@@ -118,11 +144,7 @@ function Toolbar({
}: ToolbarProps) {
return (
- {streamError ? (
-
- 写章失败({streamError.code}):{streamError.message}
-
- ) : null}
+ {streamError ?
: null}
{streaming ? (