From 2e20b0cd2b8ee64f5832171e49d7ef22a4e7da46 Mon Sep 17 00:00:00 2001 From: linshen <32978552+linshenkx@users.noreply.github.com> Date: Tue, 9 Dec 2025 22:12:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor(ui):=20=E4=BC=98=E5=8C=96=E9=AB=98?= =?UTF-8?q?=E7=BA=A7=E6=A8=A1=E5=BC=8F=E6=B5=8B=E8=AF=95=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E7=BB=93=E6=9E=84=EF=BC=8C=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E5=9B=BE=E5=83=8F=E6=A8=A1=E5=BC=8F=E5=92=8C=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E6=B5=8B=E8=AF=95=E9=9D=A2=E6=9D=BF=E5=B8=83?= =?UTF-8?q?=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - **统一布局结构**:图像模式、基础模式和高级模式测试面板布局保持一致,提升用户体验。 - 使用 `NCard` 包裹测试控制栏和输入区域,使左右两侧卡片结构对称。 - 使用 `NFlex gap` 替换 `marginBottom` 实现统一间距管理。 - 移除冗余的 `div` 包装层、`NFlex` 和 `NCard` 层级,节省垂直空间。 - **简化UI**: - 移除冗余的"测试区域"标题卡片。 - 将"全局变量"按钮整合到临时变量卡片的 header 区域。 - **代码优化**: - 移除测试运行时隐藏变量表单的逻辑,保持始终可见。 - 清理未使用的 `useBreakpoints` / `isMobile` 和 `showVariableForm`。 --- packages/ui/src/components/TestAreaPanel.vue | 15 +- .../context-mode/ContextSystemWorkspace.vue | 179 ++++----- .../context-mode/ContextUserTestPanel.vue | 208 +++++----- .../context-mode/ContextUserWorkspace.vue | 188 ++++----- .../context-mode/ConversationTestPanel.vue | 210 +++++----- .../components/image-mode/ImageWorkspace.vue | 17 +- packages/web/src/App.vue | 358 +++++++++--------- 7 files changed, 540 insertions(+), 635 deletions(-) diff --git a/packages/ui/src/components/TestAreaPanel.vue b/packages/ui/src/components/TestAreaPanel.vue index c1d80e75..9d6c8375 100644 --- a/packages/ui/src/components/TestAreaPanel.vue +++ b/packages/ui/src/components/TestAreaPanel.vue @@ -1,7 +1,7 @@ + + + +
+ + + + + + + 🗑️ + + + + 💾 + +
+ + + + + + + + + {{ t("test.variables.addVariable") }} + + +
+ -
+ -
+ ]; "compare-toggle": []; "open-variable-manager": []; + "open-global-variables": []; "variable-change": [name: string, value: string]; "save-to-global": [name: string, value: string]; "temporary-variable-remove": [name: string]; @@ -432,9 +435,6 @@ const { setVariableValues, } = variableManager; -// 是否显示变量表单 -const showVariableForm = computed(() => true); - // 开发环境下的性能调试 if (import.meta.env.DEV) { const logPerformance = debounce( diff --git a/packages/ui/src/components/context-mode/ContextUserWorkspace.vue b/packages/ui/src/components/context-mode/ContextUserWorkspace.vue index d7fbcd16..e12ffb56 100644 --- a/packages/ui/src/components/context-mode/ContextUserWorkspace.vue +++ b/packages/ui/src/components/context-mode/ContextUserWorkspace.vue @@ -107,113 +107,83 @@ - - - - - - {{ $t("test.areaTitle") }} + + - - - - - - {{ - $t("contextMode.actions.globalVariables") - }} - + + - - - + - - - - - - - - - - - - - - - - + + + - + -
- - - - - -
- - - - - - - 🗑️ - - - - 💾 - -
- - - + + + {{ t("test.variables.tempCount", { count: displayVariables.length }) }} + + - - - - - - {{ t("test.variables.addVariable") }} - - + quaternary + @click="handleClearAllVariables" + > + {{ t("test.variables.clearAll") }} + + + {{ t("contextMode.actions.globalVariables") }} + -
-
+ + + + +
+ + + + + + + 🗑️ + + + + 💾 + +
+ + + + + + + + + {{ t("test.variables.addVariable") }} + + +
+ -
+ -
+ { return sortedTestVariables.value; }); -// 是否显示变量表单 -const showVariableForm = computed(() => { - return !props.isTestRunning; -}); - // 获取变量的显示值 const getVariableDisplayValue = (varName: string): string => { return mergedVariables.value[varName] || ""; diff --git a/packages/ui/src/components/image-mode/ImageWorkspace.vue b/packages/ui/src/components/image-mode/ImageWorkspace.vue index 4d3c0b13..1834e2f1 100644 --- a/packages/ui/src/components/image-mode/ImageWorkspace.vue +++ b/packages/ui/src/components/image-mode/ImageWorkspace.vue @@ -308,17 +308,17 @@
- - - -
+ + -
+
- + -
- + diff --git a/packages/web/src/App.vue b/packages/web/src/App.vue index eacf3aad..3a386054 100644 --- a/packages/web/src/App.vue +++ b/packages/web/src/App.vue @@ -577,198 +577,194 @@ - - - - - + + - - + + - - + + - - + + - -