From 389fd1b6fa6d2b1d02135fbd9ab0e547063517b8 Mon Sep 17 00:00:00 2001 From: api-gateway Date: Tue, 29 Sep 2026 14:28:37 +0800 Subject: [PATCH] =?UTF-8?q?style(agents):=20=E6=99=BA=E8=83=BD=E4=BD=93?= =?UTF-8?q?=E9=A1=B5=E9=97=B4=E8=B7=9D=E4=B8=8E=E5=AF=B9=E9=BD=90=E4=BC=98?= =?UTF-8?q?=E5=8C=96=EF=BC=88=E7=89=88=E6=9C=AC=202.5.1=20=E2=86=92=202.5.?= =?UTF-8?q?2=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 老板反馈「智能体的界面不是很美观,优化下,特别是间距和对齐地方」。 先量后改 —— 用 Playwright 读实际布局矩形定位,修完再量验收。 修复前实测到的 6 个问题: 1. 左右两栏底部差一截(左卡 h=149 vs 右卡 h=492) 2. 卡片套卡片(详情区外层是 .card,内部对话区又各有 .card) 3. KPI 注脚基线不齐(第1张两行、其余一行) 4. 对话区左栏独立色块错位(自带底色+圆角,与主区对不上) 5. 左栏卡标题被挤成两行(「智能 体」) 6. 页面底部大空白(内容未撑满视口) 改法: - 左卡 align-self:stretch + 内部列表 flex:1 滚动 → 两卡 y=219/bottom=952 齐平 - 详情区去掉外层 .card,身份条+Tab 合成「头部卡」;对话区整体一张卡, 左栏改 border-right 分隔线 - KPI 注脚 margin-top:auto + nowrap + 省略号 → 四张注脚 y 全为 182 - 列表卡标题独占一行;底部加共用引擎的说明引导 - .ag-layout 加 min-height: calc(100vh - 300px) 撑满视口 验收:listCard.bottom == chat.bottom == 952;四张 KPI 注脚 y 一致;无 JS 错误。 测试 219 全过;ci_check 全绿。 --- CHANGELOG.md | 31 ++++++++++++++++++++++ app/main.py | 4 +-- frontend/src/locales/en.ts | 1 + frontend/src/locales/zh.ts | 1 + frontend/src/views/Agents.vue | 48 +++++++++++++++++++++++++++-------- 5 files changed, 72 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a923f36..fdd57bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,36 @@ # CHANGELOG +## 2026-09-29 · 智能体页间距与对齐优化(版本 2.5.1 → 2.5.2) + +老板反馈:「智能体的界面不是很美观,优化下,特别是间距和对齐地方」。 + +**先量后改** —— 用 Playwright 读实际布局矩形定位问题(不是凭印象调),修完再量一遍验收。 + +**修复前实测到的 6 个问题**: + +| # | 问题 | 实测证据 | +|---|---|---| +| 1 | 左右两栏**底部差一截** | 左列表卡 `h=149` vs 右详情卡 `h=492` | +| 2 | **卡片套卡片** | 详情区外层是 `.card`,内部对话区又各有 `.card` → 多一层边框 | +| 3 | KPI 卡**注脚基线不齐** | 第 1 张注脚两行、其余一行 → 四张文字底部参差 | +| 4 | 对话区左栏**独立色块错位** | 左栏自带底色+圆角,与主区高度/圆角对不上 | +| 5 | 左栏卡标题被挤成**两行**(「智能 体」) | 标题与说明同一行争夺宽度 | +| 6 | 页面底部**大空白** | 内容未撑满视口 | + +**改法**: +- 左右两栏 `align-items: start` → 左卡 `align-self: stretch` + 内部列表 `flex:1` 滚动 + → 现在两卡 **y=219 / bottom=952 完全齐平** +- 详情区去掉外层 `.card`,**身份条 + Tab 合成一张「头部卡」**;对话区整体一张卡, + 左栏改用 `border-right` 分隔线(不再各自成块) +- KPI 注脚 `margin-top:auto` + `white-space:nowrap` + 省略号 → 四张注脚 **y 全为 182** +- 列表卡标题独占一行(说明文字换到下一行);底部加一句"所有智能体共用同一个引擎"的引导 +- `.ag-layout` 加 `min-height: calc(100vh - 300px)` 撑满视口 + +**验收实测**:`listCard.bottom == chat.bottom == 952`;四张 KPI 注脚 y 一致;无 JS 错误。 + +**测试**:219 全过;`ci_check.sh` 全绿。 + + ## 2026-09-29 · 智能体支持图片附件(版本 2.5.0 → 2.5.1) 老板要求:「图片附件功能加上,其他的先不做」。 diff --git a/app/main.py b/app/main.py index dd8c514..03b89dd 100644 --- a/app/main.py +++ b/app/main.py @@ -336,9 +336,9 @@ _docs_on = config.server.docs_enabled # 安全默认关(report: /docs、/ope # 本轮修复: 版本号收敛到单一常量。此前 "2.4.0" 硬编码在 FastAPI / / 导航 / /auth/login # 三处,/health 干脆没返回版本 —— 前端「网关版本」一直显示 v-。 -# 2026-09-29: 2.4.0 → 2.4.1(前端间距规范统一);2.4.1 → 2.5.0(新增「智能体」功能模块);2.5.0 → 2.5.1(智能体支持图片附件)。 +# 2026-09-29: 2.4.0 → 2.4.1(前端间距规范统一);2.4.1 → 2.5.0(新增「智能体」功能模块);2.5.0 → 2.5.1(智能体支持图片附件);2.5.1 → 2.5.2(智能体页间距与对齐优化)。 # ★ 版本号纪律:每次改动都要往上加,小改动加小版本号、大改动加大版本号(README 有专章)。 -VERSION = "2.5.1" +VERSION = "2.5.2" app = FastAPI( title="API Gateway", diff --git a/frontend/src/locales/en.ts b/frontend/src/locales/en.ts index fd22fc5..b19bb79 100644 --- a/frontend/src/locales/en.ts +++ b/frontend/src/locales/en.ts @@ -473,6 +473,7 @@ export default { imgMax: 'Up to {n} images', imgErr: 'Failed to pick image: {msg}', imgCount: '{n}/{max}', + listFootHint: 'All agents share one engine — new ones share model and memory; only params and sessions differ.', runDefaultTitle: 'Chat', cacheHit: 'cache {n}', meLabel: 'Me', diff --git a/frontend/src/locales/zh.ts b/frontend/src/locales/zh.ts index cf2705d..ab1b098 100644 --- a/frontend/src/locales/zh.ts +++ b/frontend/src/locales/zh.ts @@ -477,6 +477,7 @@ export default { imgMax: '最多 {n} 张', imgErr: '选图失败:{msg}', imgCount: '{n}/{max} 张', + listFootHint: '所有智能体共用同一个引擎 —— 新建时它们会共用模型与记忆,只有参数和会话各自独立。', runDefaultTitle: '对话', cacheHit: '缓存 {n}', meLabel: '我', diff --git a/frontend/src/views/Agents.vue b/frontend/src/views/Agents.vue index 5f5e2a4..92984fe 100644 --- a/frontend/src/views/Agents.vue +++ b/frontend/src/views/Agents.vue @@ -43,7 +43,7 @@
-
+
{{ t('agents.title') }} {{ t('agents.sharedNote') }}
@@ -71,6 +71,7 @@
{{ t('agents.empty') }}
+
{{ t('agents.listFootHint') }}
@@ -83,7 +84,8 @@
- + +
@@ -102,11 +104,12 @@ {{ t('agents.tabConfig') }} {{ t('agents.tabRuns') }}
+