feat: 优化业务界面并修复助手意图回复

This commit is contained in:
NathanAlex7
2026-09-15 14:34:48 +08:00
parent 370ec46775
commit 97f8f0edc9
10 changed files with 218 additions and 6 deletions
+26
View File
@@ -0,0 +1,26 @@
const assert = require("node:assert/strict");
const fs = require("node:fs");
const path = require("node:path");
const root = path.resolve(__dirname, "..");
const read = (file) => fs.readFileSync(path.join(root, file), "utf8");
const globals = read("src/app/globals.css");
const navigation = read("src/components/xingbang/navigation.css");
const workspace = read("src/app/data-access/workspace.css");
const assistant = read("src/components/xingbang/business-assistant.css");
const operations = read("src/app/operations-center/operations.css");
assert.match(globals, /font-size:\s*16px/, "全局正文应提供清晰的基础字号");
assert.match(globals, /:focus-visible/, "键盘操作应有明显焦点提示");
assert.match(navigation, /\.xb-agent-nav a\{min-height:42px[^}]*font-size:14px/, "主导航应扩大文字和点击区域");
assert.match(navigation, /\.xb-role-switch\{min-height:42px/, "身份选择器应保留足够大的点击区域");
assert.match(workspace, /\.ra-button\{min-height:42px[^}]*font-size:14px[^}]*font-weight:700/, "工作台按钮应清晰且易点击");
assert.match(workspace, /\.ra-button\.primary\{background:#17634c/, "主操作按钮应采用稳定的主色强调");
assert.match(workspace, /\.xb-review-final>\.ra-button:not\(\.primary\)\{border-color:#d7837b/, "退回操作应与批准操作清楚区分");
assert.match(workspace, /\.xb-panel>p,.xb-panel p,.xb-panel details\{font-size:14px/, "业务面板正文不应继续使用过小字号");
assert.match(assistant, /\.ba-messages article p\{font-size:15px/, "助手对话正文应易于阅读");
assert.match(assistant, /\.ba-workspace aside button\{min-height:46px/, "助手快捷操作应有明显点击区域");
assert.match(operations, /\.td-hero-actions button,.td-hero-actions select\{height:46px/, "时效看板操作控件应易于辨认和点击");
console.log("Business UI readability checks passed");
+1
View File
@@ -210,6 +210,7 @@ def main() -> int:
("backend-unit", [project_python(), "-m", "unittest", "discover", "-s", ".", "-p", "test_*.py", "-v"], BACKEND),
("reviewer-workspace-ui", [executable("node"), "scripts/test_reviewer_workspace.cjs"], ROOT),
("identity-recovery-ui", [executable("node"), "scripts/test_identity_recovery.cjs"], ROOT),
("ui-readability", [executable("node"), "scripts/test_ui_readability.cjs"], ROOT),
("frontend-build", [npm, "run", "build"], ROOT),
("compose-local-config", [docker, "compose", "-f", "docker-compose.yml", "config", "--quiet"], ROOT),
("compose-aliyun-config", [docker, "compose", "--env-file", "deploy/aliyun.env.example", "-f", "deploy/docker-compose.aliyun.yml", "config", "--quiet"], ROOT),