From 0a249dff3aa8f4d5e46a6f7f0cf47190bfe18686 Mon Sep 17 00:00:00 2001 From: kdletters <61648117+kdletters@users.noreply.github.com> Date: Mon, 5 Oct 2026 21:09:20 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=A7=E7=BB=AD=E6=94=B6=E6=95=9B=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=20IPC=20=E9=94=99=E8=AF=AF=E6=AD=A3=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 保留模板权限、Direct 订阅和剪贴板失败详情 补充前端回归测试与错误处理文档 --- .../ui-editor/components/UiEditorCopyPathButton.tsx | 11 +++++++++-- apps/ai-game-creator-shell/tests/uiEditorPage.test.ts | 6 +++++- ...�ADR】AGC命令错误结构化与错误报告口径-2026-10-01.md | 1 + .../plans/【里程碑】AGC错误具体文本展示-2026-10-04.md | 1 + 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/apps/ai-game-creator-shell/src/view/ui-editor/components/UiEditorCopyPathButton.tsx b/apps/ai-game-creator-shell/src/view/ui-editor/components/UiEditorCopyPathButton.tsx index b33d9e62a..0d6a467a4 100644 --- a/apps/ai-game-creator-shell/src/view/ui-editor/components/UiEditorCopyPathButton.tsx +++ b/apps/ai-game-creator-shell/src/view/ui-editor/components/UiEditorCopyPathButton.tsx @@ -2,6 +2,8 @@ import { writeText } from '@tauri-apps/plugin-clipboard-manager'; import { Copy } from 'lucide-react'; import { useState } from 'react'; +import { visibleClientErrorMessage } from '../../../services/errorReporting'; + type CopyState = 'idle' | 'copied' | 'failed'; export function UiEditorCopyPathButton({ @@ -15,16 +17,21 @@ export function UiEditorCopyPathButton({ relativePath: string; value: CopyState; }>({ relativePath, value: 'idle' }); + const [copyError, setCopyError] = useState(''); const value = copyState.relativePath === relativePath ? copyState.value : 'idle'; async function copyPath() { setCopyState({ relativePath, value: 'idle' }); + setCopyError(''); try { await writeText(relativePath); setCopyState({ relativePath, value: 'copied' }); - } catch { + } catch (error) { setCopyState({ relativePath, value: 'failed' }); + setCopyError( + `复制失败:${visibleClientErrorMessage(error)};请手动复制路径。`, + ); } } @@ -32,7 +39,7 @@ export function UiEditorCopyPathButton({ <> {value === 'failed' ? (
- 复制失败,请手动复制路径。 + {copyError || '复制失败,请手动复制路径。'}
) : null}