dsh-postapi 0.0.0-stage → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +139 -2
  3. package/cordis.patch.yml +3 -0
  4. package/dist/client.js +5651 -0
  5. package/docs/DETAIL.md +27 -0
  6. package/docs/apifox-design-spec.md +101 -0
  7. package/docs/apifox-research/analysis.md +254 -0
  8. package/docs/apifox-ui-delivery.md +150 -0
  9. package/docs/apifox-visual-parity-spec.md +353 -0
  10. package/docs/feature-matrix.md +112 -0
  11. package/docs/flow-reference/sequence-reference.html +163 -0
  12. package/docs/interface-contract-v2.md +175 -0
  13. package/docs/interface-contract.md +105 -0
  14. package/docs/nav-layout-v2-spec.md +107 -0
  15. package/docs/preview.svg +9 -0
  16. package/docs/probe-client.legacy.js +31 -0
  17. package/docs/rootcause-sidebar-vanish.md +95 -0
  18. package/docs/rootcause.md +86 -0
  19. package/docs/sidebar-notes.md +153 -0
  20. package/docs/ui-audit.md +197 -0
  21. package/docs/ui-notes.md +98 -0
  22. package/docs/v2-delivery.md +99 -0
  23. package/icon.svg +4 -0
  24. package/index.js +5 -0
  25. package/locale/en.json +7 -0
  26. package/locale/zh.json +7 -0
  27. package/package.json +73 -4
  28. package/src/client/index.js +132 -0
  29. package/src/client/jsx-shim.js +9 -0
  30. package/src/client/pages/__tests__/heights.test.js +135 -0
  31. package/src/client/pages/components/AssertTable.jsx +122 -0
  32. package/src/client/pages/components/BodyEditor.jsx +91 -0
  33. package/src/client/pages/components/EmptyState.jsx +52 -0
  34. package/src/client/pages/components/FolderTree.jsx +109 -0
  35. package/src/client/pages/components/JsonEditor.jsx +45 -0
  36. package/src/client/pages/components/ParamTable.jsx +226 -0
  37. package/src/client/pages/components/ResponsePanel.jsx +278 -0
  38. package/src/client/pages/components/ScriptPanel.jsx +99 -0
  39. package/src/client/pages/components/StatusPill.jsx +35 -0
  40. package/src/client/pages/components/__tests__/apifox-ui.test.js +291 -0
  41. package/src/client/pages/components/__tests__/pages-a.test.js +392 -0
  42. package/src/client/pages/components/__tests__/tree.test.js +379 -0
  43. package/src/client/pages/components/headerPresets.js +63 -0
  44. package/src/client/pages/debug.jsx +576 -0
  45. package/src/client/pages/design-tokens.css +2604 -0
  46. package/src/client/pages/doc.jsx +552 -0
  47. package/src/client/pages/env.jsx +378 -0
  48. package/src/client/pages/flow.jsx +349 -0
  49. package/src/client/pages/history.jsx +238 -0
  50. package/src/client/pages/import.jsx +396 -0
  51. package/src/client/pages/mock.jsx +316 -0
  52. package/src/client/pages/overview.jsx +348 -0
  53. package/src/client/pages/schema.jsx +317 -0
  54. package/src/client/pages/search.jsx +216 -0
  55. package/src/client/pages/sequence.jsx +344 -0
  56. package/src/client/pages/settings.jsx +205 -0
  57. package/src/client/pages/test.jsx +470 -0
  58. package/src/client/pages/theme.js +27 -0
  59. package/src/client/pages-entry.js +20 -0
  60. package/src/client/shell/ApiTitle.js +19 -0
  61. package/src/client/shell/Body.js +492 -0
  62. package/src/client/shell/definition.js +57 -0
  63. package/src/client/shell/locales.js +185 -0
  64. package/src/client/shell/menu.js +174 -0
  65. package/src/client/shell/registry.js +530 -0
  66. package/src/host/bridge.js +407 -0
  67. package/src/host/codegen.js +356 -0
  68. package/src/host/import-export.js +1044 -0
  69. package/src/host/index.js +102 -0
  70. package/src/host/mock-server.js +303 -0
  71. package/src/host/request.js +336 -0
  72. package/src/host/script-sandbox.js +272 -0
  73. package/src/host/storage.js +803 -0
  74. package/src/host/test-runner.js +126 -0
  75. package/src/host/variables.js +108 -0
package/docs/DETAIL.md ADDED
@@ -0,0 +1,27 @@
1
+ # PostAPI
2
+
3
+ Apifox 风格的接口工作区,运行在 DeepSeek Harness 官方右侧栏的 `postapi` 页签里。
4
+
5
+ ## 能力
6
+
7
+ - 12 个页面:总览、接口文档、调试发送、Mock、数据模型、环境与变量、历史、自动化测试、导入导出、流程图、全局搜索、设置。
8
+ - 宿主桥 48 条路由,覆盖项目/目录/接口/模型/环境/全局变量/Mock/测试用例/测试场景/流程图/设置的完整 CRUD,以及请求发送、脚本执行、Schema 校验、导入导出与代码生成。
9
+ - 数据落盘为本地 JSON,默认目录 `~/.dsh/postapi`,可用 `POSTAPI_DATA_DIR` 或宿主 config 覆盖。
10
+
11
+ ## 接线
12
+
13
+ - 右栏页签由 `ctx.sidebarRightTabs.register` 注册(id/kind 均为 `postapi`,`keepMounted`,guide 单入口)。
14
+ - 页签主体挂在 `sidebar.right.pane.tab`(key=`postapi`),标题挂在 `sidebar.right.pane.tab.title`。
15
+ - 数据经 `/dsh-postapi/api` 同源 prefix 桥传输,host 侧先过 `connection.requestRejection` 鉴权栅栏。
16
+ - 样式表以文本形式打进 `dist/client.js`,由 client 在 apply 时注入带 `data-plugin="dsh-postapi"` 的 `<style>`。
17
+
18
+ ## 开发
19
+
20
+ ```bash
21
+ npm install
22
+ npm run build # esbuild 打包 + vm smoke
23
+ npm test # 328 用例
24
+ npm run smoke # 宿主端到端 27 项
25
+ ```
26
+
27
+ 契约与视觉规格见 `docs/interface-contract-v2.md`、`docs/apifox-visual-parity-spec.md`、`docs/feature-matrix.md`。
@@ -0,0 +1,101 @@
1
+ # Apifox 设计语言规范(UI 复刻基线)
2
+
3
+ > lead 产出 · 2026-11-18 · 分支 feature/apifox-ui-parity
4
+ > 数据来源:`.research/apifox/app/dist/renderer/*.css`(165 个 CSS chunk,Apifox 2.8.55)全量统计
5
+ > 所有页面改造必须遵守本文档;token 落在 `src/client/pages/design-tokens.css`,页面只消费变量。
6
+
7
+ ## 1. 色板(按 CSS 出现频次排序,取前 20 为正式 token)
8
+
9
+ | 用途 | Apifox 原值 | 出现次数 | 我们的 token |
10
+ |---|---|---|---|
11
+ | 主分割线 / 卡片边框 | `#eaecf0` | 94 | `--border` |
12
+ | 次级背景 / hover 底 | `#f2f4f7` | 53 | `--bg-hover` / `--bg-subtle` |
13
+ | 正文前景 | `#344054` | 42 | `--fg` |
14
+ | 三级文字 / 占位 | `#98a2b3` | 39 | `--fg-tertiary` |
15
+ | 品牌主色(Apifox 紫) | `#9373ee` | 39 | `--accent` |
16
+ | 应用底色 | `#f9fafb` | 37 | `--bg-app` |
17
+ | 危险 / DELETE | `#f04438` | 20 | `--error` / `--method-delete` |
18
+ | PATCH / 紫红 | `#ee46bc` | 30 | `--method-patch` |
19
+ | 次级文字 | `#667085` | 18 | `--fg-secondary` |
20
+ | 强边框 | `#d0d5dd` | 12 | `--border-strong` |
21
+ | 成功 / GET | `#17b26a` | 17 | `--success` / `--method-get` |
22
+ | POST / 信息蓝 | `#2e90fa` | 15 | `--info` / `--method-post` |
23
+ | 警告 / PUT | `#f79009` | 15 | `--warning` / `--method-put` |
24
+ | 链接 / 次级蓝 | `#6172f3` | 15 | `--link` |
25
+ | 主色 hover | `#8276c9` | 10 | `--accent-hover` |
26
+ | 表格斑马 | `#f5f5f5` | 9 | `--bg-stripe` |
27
+ | 青色(HEAD/OPTIONS) | `#06aed4` | 15 | `--method-other` |
28
+
29
+ 暗色皮肤:`#101828`(底)/`#1d2939`(面)/`#344054`(边框)/`#f9fafb`(前景)。
30
+
31
+ ## 2. 尺寸刻度(按频次)
32
+
33
+ | 类别 | Apifox 高频值 | 我们的 token |
34
+ |---|---|---|
35
+ | 控件高 | **32px**(377 次,绝对主力)、24px(254)、40px(136)、28px(83) | `--ctl-h: 32px` / `--ctl-h-sm: 24px` / `--ctl-h-lg: 40px` |
36
+ | 表格行高 | 40px / 48px | `--row-h: 36px`(紧凑文档感,介于两者) |
37
+ | 标签/胶囊高 | 22px(88) | `--pill-h: 22px` |
38
+ | 字号 | **12px**(255)、13px(101)、14px(99)、16px(101)、20px、24px | `--fs-12`…`--fs-24` |
39
+ | 行高 | **22px**(523,配 14px)、20px(319,配 13px)、24px(216) | `--lh-20: 20px` / `--lh-22: 22px` / `--lh-24: 24px` |
40
+ | 圆角 | **8px**(311)、12px(208)、6px(131)、10px(110)、4px(86) | `--radius-ctl: 6px` / `--radius-card: 8px` / `--radius-lg: 12px` / `--radius-sm: 4px` |
41
+ | 间距 | **8px**(389)、4px(259)、12px(114)、16px(86)、20px(181)、24px(80) | `--sp-1..--sp-6`(4/8/12/16/20/24) |
42
+ | 图标 | 16px(100)、24px(124)、14px(50)、18px(37)、20px(35) | `--icon-sm: 14px` / `--icon: 16px` / `--icon-lg: 20px` |
43
+ | 左树宽 | 240px(24 次)/ 216px(28 次) | `--nav-w: 240px` |
44
+ | 右 TOC 宽 | 240px | `--toc-w: 240px` |
45
+ | 卡片内边距 | 12px(213)/ 16px(177)/ 20px(181) | `--card-pad: 16px` |
46
+ | 弹层最大宽 | 400px(32)/ 720px(26) | `--popover-w: 400px` |
47
+ | 滚动条 | 6px | `--scrollbar: 6px` |
48
+
49
+ ## 3. 布局骨架(Apifox 主工作台)
50
+
51
+ ```
52
+ ┌──────────────────────────────────────────────────────────────┐
53
+ │ 顶栏 48px:项目名 / 环境选择 / 搜索 / 运行 / 保存 / 更多 │ --topbar-h: 48px
54
+ ├────────────┬─────────────────────────────────┬───────────────┤
55
+ │ 左树 240px │ 主区(文档 or 调试) │ 右栏 240px │
56
+ │ 目录+接口 │ 页签条 40px + 内容区 │ TOC / 响应 │
57
+ │ 行高 32px │ 内容 padding 20px 24px │ 行高 32px │
58
+ └────────────┴─────────────────────────────────┴───────────────┘
59
+ ```
60
+
61
+ - 顶栏:`--topbar-h: 48px`,底部 1px `--border`,白底。
62
+ - 三段式用 grid:`grid-template-columns: var(--nav-w) minmax(0,1fr) var(--toc-w)`。
63
+ - 页签条:高 40px,页签本身 `--ctl-h` 高,激活态下边框 2px `--accent`。
64
+ - 分区一律 1px `--border`,**不投阴影**(Apifox 只在浮层用 `0 4px 16px rgba(0,0,0,.08)`)。
65
+ - 表格:表头 `--bg-subtle` 底 + `--fg-secondary` 文字,行 hover `--bg-hover`,选中 `--bg-selected`。
66
+
67
+ ## 4. 组件规格
68
+
69
+ | 组件 | 规格 |
70
+ |---|---|
71
+ | 主按钮 | 高 `--ctl-h`、`--accent` 底、白字、圆角 `--radius-ctl`、padding 0 16px、hover `--accent-hover` |
72
+ | 次按钮 | 白底、1px `--border-strong`、`--fg` 字、hover 边框 `--accent` |
73
+ | 输入框 | 高 `--ctl-h`、1px `--border-strong`、圆角 `--radius-ctl`、focus 边框 `--accent` + 2px `--accent-tint` 外环 |
74
+ | 方法徽标 | 高 `--pill-h`、mono `--fs-12`、粗体、圆角 `--radius-sm`、白字彩底(GET 绿 / POST 蓝 / PUT 橙 / DELETE 红 / PATCH 紫红) |
75
+ | 状态胶囊 | 高 `--pill-h`、圆角全圆、1px 同色边框 + 同色文字、无底色 |
76
+ | 树行 | 高 `--ctl-h`、圆角 `--radius-ctl`、选中 `--bg-selected` + `--accent` 字 |
77
+ | 页签 | 高 `--ctl-h`、无底色、激活下边框 2px `--accent` |
78
+ | 代码块 | mono `--fs-12`、`--lh-20`、`--bg-subtle` 底、1px `--border`、圆角 `--radius-ctl`、padding 12px |
79
+ | 表格 | 行高 `--row-h`、表头 `--bg-subtle`、单元格 padding 0 12px |
80
+
81
+ ## 5. 硬约束(heights.test.js 会静态检查)
82
+
83
+ 1. `design-tokens.css` 里所有 `height/min-height/max-height` 必须是 `var(--ctl-h)` / `var(--row-h)` / `var(--pill-h)`、`100%`/`auto` 等关键字,或含上述 token 的 `calc()`。
84
+ 2. 页面内联 `style` 只允许 layout(display/flex/grid/gap/width/margin),**禁止颜色与字号字面量**。
85
+ 3. 禁止 `alert/confirm/prompt`。
86
+ 4. 禁止新增 npm 依赖;只用 `react` 与本地相对路径。
87
+ 5. 新增 CSS 类一律 `.pp-` 前缀,写进 `design-tokens.css`(由 design-system 角色统一维护)。
88
+
89
+ ## 6. 与旧皮肤的差异(必须改掉)
90
+
91
+ | 项 | 旧(Vercel Geist) | 新(Apifox) |
92
+ |---|---|---|
93
+ | 主色 | `#0070f3` 蓝 | `#9373ee` 紫 |
94
+ | 底色 | `#fafafa` | `#f9fafb` |
95
+ | 正文 | `#000` 纯黑 | `#344054` 石板灰 |
96
+ | 边框 | `#eaeaea` | `#eaecf0` |
97
+ | 控件高 | 28px | 32px |
98
+ | 行高 | 1.45 倍数 | 固定 20/22/24px |
99
+ | 圆角 | 6/8 | 6/8/12 |
100
+ | 左树宽 | 220px | 240px |
101
+ | 密度 | PostHog/Mintlify 文档感 | Apifox 工作台密度(更松、卡片化) |
@@ -0,0 +1,254 @@
1
+ # Apifox 2.8.55 (Windows x64) 安装包静态分析报告
2
+
3
+ > 任务 task-1(T1 apifox-rea)产出 · dsh-postapi 契约 v1 §1 校正依据 · 2026-11-18
4
+ > 工具链:curl / 7-Zip 26.04(NSIS)/ @electron/asar extract / REA(analyze_javascript_application → inspect_analysis_view)+ 静态 grep 与 node 正则取证;全程未运行目标程序。
5
+
6
+ ## 0. 分析元信息
7
+
8
+ | 项 | 值 |
9
+ |---|---|
10
+ | 下载直链 | https://file-assets.apifox.com/download/Apifox-windows-latest.zip(docs.apifox.com/download 页解析;GET 必须带完整浏览器头 + Referer: docs.apifox.com,否则 302 到 black-list.apifox.com 拦截页;HEAD 放行、GET 拦截) |
11
+ | zip SHA-256 | ae2a9b49ba645fd8e24d05396bfa99aa63226d95f4781fd55a682719886f515b(194,838,883 B) |
12
+ | 内含安装器 | pkg/Apifox-2.8.55.exe,194,909,008 B,构建时间 2026-11-14 21:55,SHA-256 8aeeb11d95d4ef634e9c8f9129d866b270d9d0722fd27f118a2d7f53d68c62d8 |
13
+ | 安装器格式 | NSIS-3 Unicode(7z Type=Nsis);第二层 $PLUGINSDIR/app-64.7z 194,121,124 B |
14
+ | 解出应用 | app64/(1410 文件,857,655,623 B);resources/app.asar 430,713,112 B,SHA-256 1d95914cf73152bac45ac264a509ad6357e06b23768285576102687769a2a368;asar 解出 app/(dist + node_modules + package.json,640 MB) |
15
+ | 本地工作区 | .research/apifox/{Apifox-windows-latest.zip, pkg/, installer/, app64/, app/, tools/} |
16
+ | 版本 | apifox 2.8.55(app/package.json);customBuild.stable.forceAutoUpdateVersion=2.1.8,alpha=2.1.8-alpha.66 |
17
+
18
+ ## 1. 架构文字图
19
+
20
+ ```
21
+ Apifox-windows-latest.zip
22
+ └─ Apifox-2.8.55.exe [NSIS-3 Unicode 安装器]
23
+ └─ $PLUGINSDIR/app-64.7z [纯 7z 数据层]
24
+ └─ app64/ [Electron 桌面应用: Electron 37.7.0 / Chromium 138.0.7204.251]
25
+ ├─ Apifox.exe [Electron 主二进制]
26
+ └─ resources/
27
+ ├─ app.asar [应用主包]
28
+ │ └─ dist/
29
+ │ ├─ main/ [主进程: webpack 分包]
30
+ │ │ ├─ main.js (35B stub) → load-jsc("main.jsc") ← bytenode V8 字节码, 共 7 个 .jsc:
31
+ │ │ │ main / server.local / worker.runner / WorkerThread /
32
+ │ │ │ ExecutionProcess / ThreadGroupExecutable / agent.manager
33
+ │ │ ├─ vendors.js(27MB) / 900.js(13MB) / 260.js / context-extend-factory.js(869KB)
34
+ │ │ ├─ local-server-impl.js(2.5MB) [本地服务实现]
35
+ │ │ ├─ io-service-worker.js / worker.groupRunner.js / worker.utilityRunner.js
36
+ │ │ ├─ preload.main-window.js / preload.tab-view.js [渲染进程桥]
37
+ │ │ ├─ dexie-host-preload.js (360B) [Dexie 主机端口转发壳]
38
+ │ │ └─ agent-debugger-preload.js / a2a-debugger-preload.js [AI/agent 调试入口]
39
+ │ ├─ renderer/ [渲染进程: UmiJS, 1168 个 JS, webpack 数字 chunk + 1299 条 chunk 映射]
40
+ │ │ ├─ index.html [zh-CN 单入口, APP_REGION=CN, AliLog 错误上报]
41
+ │ │ ├─ fb859e9ae0dcbd.405165ba.js (20KB) [webpack runtime + chunk 映射]
42
+ │ │ ├─ index.4fed96b5fcebc02a.js (675KB) [Umi 路由表 + 数据模型实体注册]
43
+ │ │ ├─ <chunkId>.<hash>.async.js ×1166 [业务/组件懒加载 chunk]
44
+ │ │ ├─ p__*.css ×26 [页面级样式, 语义命名]
45
+ │ │ └─ ts.<hash>.worker.js [数据引擎 Web Worker: IndexedDB/Dexie 宿主]
46
+ │ ├─ offline/ [离线模式资源镜像]
47
+ │ ├─ assets/
48
+ │ └─ node_modules/ [生产依赖: 数据库驱动全家桶]
49
+ └─ app-update.yml [electron-updater: generic, api.apifox.cn/api/v1/configs/client-updates/<ver>/win64/]
50
+
51
+ 进程间通道(观测到的 IPC 通道族):
52
+ renderer --ipc--> electronAPI:attachIPC:{create,send,invoke,subscribe,unsubscribe,dispose,event}
53
+ renderer <--MessagePort-- electronAPI:dexieHost:port (dexie-host-preload 转发 → ts.worker IndexedDB 宿主)
54
+ renderer <--MessagePort-- electronAPI:ioProxy:port
55
+ 云端: https://api.apifox.{cn,com} (REST /api/v1/*, 登录/同步/AI/更新)
56
+ ```
57
+
58
+ 存储抽象枚举(dist/renderer/index…js 模块 92462 原文):
59
+ `((n={})[n.None=0]="None",n[n.Ipc=1]="Ipc",n[n.Local=2]="Local",n[n.File=4]="File",n[n.Local_Ipc=3]="Local_Ipc",n)`,
60
+ 伴生 `{userDataPath:""}` 注入装饰器——每条数据读取通道可声明为 IPC / 本地 / 文件 / 本地+IPC 四种介质。
61
+
62
+ ## 2. 技术栈 + 版本证据
63
+
64
+ | 组件 | 版本 | 证据位置 |
65
+ |---|---|---|
66
+ | Electron | 37.7.0 | Apifox.exe 二进制内嵌 UA 串 "Chrome/138.0.7204.251 Electron/37.7.0"(node Buffer 直搜) |
67
+ | Chromium | 138.0.7204.251 | 同上 |
68
+ | React | 16.13.1 与 17.0.2 混用 | renderer 各 chunk "@license React v16.13.1" / "v17.0.2" 均命中 |
69
+ | 打包器 | rspack 1.5.8 | dexie-host-preload.js 注入头 t.rv=()=>"1.5.8", t.ruid="bundler=rspack@1.5.8";renderer webpack 数字 chunk 形态 |
70
+ | 路由框架 | UmiJS(p__ 页面约定 + 嵌套路由对象) | p__*.css 26 个语义名;REA routes 视图 mechanism=nested-route-object |
71
+ | UI 库 | antd 痕迹 26 处 + 自研 ui- token(index.html 内 --ui-border-color-base、--safe-window-control-*) | grep antd/ant-design |
72
+ | 编辑器 | Monaco/CodeMirror 族痕迹 269 处(含 .LICENSE.txt 旁证) | grep monaco/CodeMirror |
73
+ | bytenode | 1.5.7 | package.json dependencies;dist/main/*.jsc + load-jsc.js(os.arch() 自适应 arm64/x64) |
74
+ | MCP SDK | @modelcontextprotocol/sdk 1.25.1 | package.json(2.8.55 已内置 MCP 能力,配合 agent/a2a-debugger-preload) |
75
+ | 数据库驱动 | mysql2 2.3.3 / pg 8.5.1 / mssql 8.1.2 / mongoose 7.6.3 / redis 4.6.10 / clickhouse 2.6.0 / dmdb 1.0.17128 / ibm_db(@tarslib 4.0.1-1) / oracledb(@tarslib 5.1.0-3) / ssh2(@tarslib 1.16.0) / kerberos | package.json(连接数据库功能依赖面) |
76
+ | 内部包族 | @tarslib/*(base/json-bigint/json-schema-faker/mock-base/nunjucks/protobuf-parser/register-client/swagger2openapi 6.0.3-beta.12/widdershins 4.0.17) | package.json(mock/文档/OAS 转换能力) |
77
+ | 其他 | chardet 1.4 / jsonpath 1.1.1 / mongodb-query-parser 4.4.2 / node-machine-id 1.1.12 / node-schedule 2.0.0 / @napi-rs/snappy 全平台 optional / nodejieba 2.5.2 | package.json |
78
+ | 更新通道 | generic provider, https://api.apifox.cn/api/v1/configs/client-updates/2.8.55/win64/, 缓存目录 apifox-updater | app64/resources/app-update.yml 原文 |
79
+
80
+ ## 3. 页面路由全表
81
+
82
+ 来源 A:index.4fed96b5fcebc02a.js 正则抽取 path:"…"(完整 97 条);来源 B:REA javascript-routes 视图去重 48 条静态候选(两者交叉验证,REA 每条含精确 source_range provenance)。
83
+
84
+ ```
85
+ /user /user/login /user/sso-login /user/ldap-login /user/sso-overwrite
86
+ /user/passport/:type/login-result-success …/login-result-failure …/login-result-binding
87
+ /user/register /user/password-confirm /user/reset-password
88
+ /pdv /pdv/license-error/:reason
89
+ /invite/:type?
90
+ /project/:id? ← 项目工作台根
91
+ /specs
92
+ /api-manage/ ← 接口管理(树)
93
+ /api-test/ /api-test/test-case/index /api-test/test-case/detail
94
+ /api-test/test-suite/index /api-test/test-suite/detail
95
+ /api-test/test-report/index
96
+ /api-doc/ /api-doc/shared-doc/shared-doc-list/ /api-doc/shared-doc/
97
+ /api-doc/published-project/ …/publish-settings …/basic-settings …/layout-settings
98
+ /history
99
+ /project-settings/
100
+ /project-settings/common/basic/ …/git-branch/ …/members/
101
+ …/feature-setting/ …/api-status-setting/ …/mock/ …/advanced-setting
102
+ …/notification/ …/targets …/events …/settings
103
+ /project-settings/resource/template-parameter …/project-branch …/api-version
104
+ …/common-response/ …/common-script/ …/database-connection/ …/git-connection/
105
+ …/alibaba-cloud-config/ …/custom-function/ …/socket-input …/socket-output …/socket-unpack
106
+ /project-settings/data/bind /project-settings/data/import /project-settings/data/export
107
+ …/dubbo-import-config
108
+ /account/settings
109
+ /exception/403 /exception/500
110
+ /error /error/show/:errorType
111
+ /main/:key? /main/:key?/:id? ← 主工作台(tab 容器)
112
+ /main/settings/organizations/:id (+ /settings /teams /plans /members /saml-groups /sso
113
+ /enterprisePolicies /secret-scanner /audit-logs /selfHostedRunners /scripts
114
+ /databaseConnections /externalPrograms /api-hub)
115
+ /main/teams/:id /main/organizations/:id
116
+ /online-share /online-share/clone /online-share/login
117
+ /link /link/project/:projectId /link/landing /link/email-preferences
118
+ /uninstall / (多条 "/" 嵌套入口)
119
+ ```
120
+
121
+ REA 视图原文要点(evidence ev_b0ce78b5…,view=javascript-routes):
122
+ coverage: {"status":"page","examined":48,"total":48,"next_offset":null,"exhausted":true};
123
+ 每条形如 {id:"jsr:…", path:"/account/settings", classification:"page", classification_basis:"router-configuration", mechanisms:["nested-route-object"], provenance:{source_range:{line:1,column:25657…}}}。
124
+
125
+ ## 4. 组件 / 端点观测清单
126
+
127
+ ### 4.1 渲染层组件面
128
+ - 页面级样式 chunk(语义命名即页面清单):p__entry__Main、p__account__settings、p__invite、p__organization(-api-hub/-audit-logs/-coming-soon/-enterprise-policies/-members/-plans/-saml-groups/-secret-scanner/-self-hosted-runners/-settings/-sso/-teams)、p__user__login(+__components__{DocsSiteLogin,LdapLogin,LoginOrClone,SamlSsoOrgSelector})、p__user__{password-confirm,register,reset-password,saml-sso-overwrite}、p__link__EmailPreference。
129
+ - 接口 Diff 字段比较器组件族(94743 chunk):以 {key,title,pickedFieldNames,formatter,hideFieldNameIfSingleField,translateRelevantData} 为注册单元的声明式字段渲染/对比框架。
130
+ - 编辑器:Monaco/CodeMirror 族痕迹 269 处(JSON Schema/代码编辑)。
131
+
132
+ ### 4.2 IPC face 端点(renderer↔host 契约面,观测自 index chunk 字符串常量)
133
+ ```
134
+ electronAPI:attachIPC:create | send | invoke | subscribe | unsubscribe | dispose | event
135
+ electronAPI:dexieHost:port (MessagePort 转发, dexie-host-preload.js 360B 全文实现)
136
+ electronAPI:ioProxy:port (MessagePort)
137
+ ```
138
+ attachIPC 族即 Apifox 的通用 host face:统一 create/send/invoke/subscribe/dispose 生命周期语义。
139
+
140
+ ### 4.3 云端 REST 端点(静态可见样本)
141
+ ```
142
+ https://api.apifox.cn/api/v1/configs/client-updates/<version>/win64/ (electron-updater)
143
+ /api/v1/ai/test-cases/test-case-types
144
+ 域名面: api.apifox.cn(preconnect) / api.apifox.com / cdn.apifox.{cn,com}
145
+ 埋点: AliLogTracker → cn-hangzhou.log.aliyuncs.com apifox/desktop-app-error (GET 拼参上报)
146
+ ```
147
+ 本地 mock 服务(local-server-impl.js, 2.5MB 明文)未观测到 .listen( 调用与端口常量——监听逻辑疑似位于 .jsc 或动态组装;标注为未观测项。
148
+
149
+ ### 4.4 REA coverage / limitations 原文
150
+ 第一轮(input=renderer, source=fb859 主 chunk,evidence ev_337d8dcbafc854bbb8db46be9b942ce7314ca93f99e48fba68a7f853ce44401a):
151
+ - coverage: {"status":"complete-within-view","examined":1169,"total":1169,"next_offset":null,"exhausted":true}
152
+ - limitations 原文(全量):
153
+ ```
154
+ "Boundary extraction covers unshadowed JSON/global coercions plus parse and validation method candidates."
155
+ "Caller-selected source analysis leaves 1173 inventoried files outside analysis scope. Inventory identity covers the complete artifact; relationships through unselected sources remain unknown."
156
+ "Child-process extraction covers asynchronous node:child_process creation, literal argv/env/stdio options, exit/error listeners, and kill signals."
157
+ "CommonJS and ESM binding relationships were recovered from inert syntax and resolved only within the inventoried artifact container."
158
+ "Configuration extraction covers process.env, process.argv, node:fs reads, and direct logical defaults."
159
+ "Event extraction covers EventEmitter-style literal registrations, removals, and dispatch candidates; dynamic names remain unknown."
160
+ "Function fingerprints are static candidates; equal digests can remain ambiguous and do not prove behavioral equivalence."
161
+ "Graph coverage is incomplete; unavailable facts remain explicit and must not be read as absence."
162
+ "JavaScript and HTML were parsed as inert text; bundle bootstrap code was never executed."
163
+ "Local data flow does not claim control-flow-sensitive reaching definitions or arbitrary dynamic property resolution."
164
+ "Promise ownership covers explicit unshadowed Promise construction, static factories, aggregation, chaining, and await syntax only."
165
+ "Request extraction covers fetch, WebSocket, node:http/node:https construction, direct option fields, and exact local response consumers."
166
+ "Resource extraction covers built-in filesystem/network acquisition and exact local close/destroy/end handles."
167
+ "Static imports, entrypoints, workers, endpoints, and storage relationships do not prove runtime execution."
168
+ "Static paths and relationships may remain unresolved when expressions are dynamic or obfuscated."
169
+ "The semantic graph contains static syntax observations and conservative relationship candidates; it does not claim runtime execution."
170
+ "Timer extraction covers global or node:timers scheduling and exact local-handle cancellation."
171
+ "Webpack/Rspack factories were recovered from AST literals; REA did not invoke push handlers or bundle bootstrap code."
172
+ ```
173
+ - unknowns: 1173 application graph unknowns + 16644 semantic graph unknowns(未选源与动态表达所致)。
174
+ 第二轮(source=index 业务 chunk,evidence ev_b0ce78b57ba997d083ef2557fc41f047191be492c535f21c441587a89009fd67):coverage examined 2053/2053 exhausted;routes 视图 48/48 exhausted。
175
+
176
+ ### 4.5 recover_javascript_sources 未调用说明
177
+ renderer 全部为可读 minified JS(标识符压缩但结构完整,正则/AST 可稳定取证),非 wakaru 目标形态的"丢失模块名 bundle",证据获取未受阻,故未调用;dist/main 的 7 个 .jsc 为 bytenode V8 字节码,wakaru/静态 JS 工具链不可还原(需运行时 V8 版本匹配),且本轮七项证据均取自明文层,无需打开该层。
178
+
179
+ ## 5. API 数据模型字段全表 + 与契约 §1 差异表
180
+
181
+ ### 5.1 数据实体(Dexie store 名注册表,index chunk 模块 406997 原文抽取)
182
+ ApiDetail、WebSocketApi、WebSocketApis、ProjectDataSource、ProjectDataSources、ProjectDataResource、ProjectDataResources、RpcMethod、RpcMethods、RpcMessage、RpcMessages、RpcModule、RpcModules、RpcService、RpcServices、HttpApiDetail、ApiDetails、ApiMock、ApiResponse、ApiSchema、ApiSchemaTreeList、CommonParameters、UserProjectState、CustomApiFields、ProjectSetting、HttpFolders、File、RequestHistory、TeamMembers、UsageHelpAssets、DataSchemaFolders、OASExportSettings、Environments、OasComponent、OasComponentFolder、OasComponentTreeList、SecurityScheme、ApiExportTempStorage。
183
+
184
+ ### 5.2 ApiDetail/endpoint 字段表(94743 chunk Diff 字段注册表 + pickedFieldNames 汇总,共 52 个观测键)
185
+ ```
186
+ 基本: name displayName description path protocol method folderId status maintainerId responsibleId
187
+ tags[] serverId operationId sourceUrl customApiFields customEndpointFields
188
+ 参数: parameters{ query[] cookie[] header[] path } required schemeGroups
189
+ CommonParameters(公共参数引用) itemSchema example/examples
190
+ 请求体: requestBody( type 多形态[json/xml/form-data/x-www-form-urlencoded/raw/binary…]
191
+ + jsonSchema + content + example ) [formatRequestBodyType/mapRequestBodyType 函数旁证]
192
+ 认证: auth{ authType authConfigs } securityScheme oasAuthType guidanceConfigs
193
+ 响应: responses[] { code contentType name jsonSchema doc defaultEnable }
194
+ responseExamples transformResponseContent
195
+ 处理链: preProcessors inheritPreProcessors postProcessors inheritPostProcessors
196
+ 其他: advancedSettings priority docId doc itemOrders ordering options
197
+ ```
198
+ OpenAPI Operation 字段全集(OAS 转换层 94743 原文):["tags","summary","description","externalDocs","operationId","parameters","requestBody","responses","callbacks","deprecated","security","servers"];MediaType 子集 ["schema","example","examples","encoding"];Response 子集 ["description","headers","content","links","name"]。
199
+
200
+ ### 5.3 与契约 §1 schema 逐字段差异表
201
+
202
+ | 契约 §1 (dsh-postapi) | Apifox 对应 | 差异判定 |
203
+ |---|---|---|
204
+ | projects: [{id,name,updatedAt}] | project + TeamMembers 实体(IndexedDB)+ 云端同步 | 结构性差异:Apifox 项目元数据不落单文件 index.json,由 DB 表 + 云端账套承载 |
205
+ | folders: {id,name,parentId} | HttpFolders / DataSchemaFolders / OasComponentFolder 树 + endpoint.folderId 挂接 | 同构(folderId 外键一致);Apifox 额外有 itemsOrder 排序字段,契约无 |
206
+ | endpoints.id | 实体 id(形态未在明文观测到完整生成规则) | 标注:Apifox id 规则未取证,契约 proj_/fld_/ep_+36 进制方案不受影响 |
207
+ | method 枚举 7 值 | method 字段存在;全集枚举未在明文 chunk 观测到 | 标注:无法核对全集,契约 7 值为子集假设 |
208
+ | url | path + protocol + serverId(projectSetting.servers[]) | 结构性差异:Apifox 把 host 拆到环境级 servers,endpoint 只存 path;契约 url 为完整串(简化,可保留) |
209
+ | params: [{key,value,enabled}] | parameters 按 query/cookie/header 位置分组 + required/style/explode + JSON-Schema 化 + 示例值 + CommonParameters 引用 | 结构性差异:契约是扁平 enabled 开关模型,Apifox 是 schema 化+位置分组模型;契约刻意简化成立 |
210
+ | pathParams: [] | path 内 {} 变量 + parameters.path | 等价(契约独立数组 vs Apifox 内嵌 path+参数组) |
211
+ | headers: [{key,value,enabled}] | parameters.header 子组 | 同上(扁平 vs 分组) |
212
+ | body {type: json|form|raw|none, content} | requestBody {type: json/xml/form-data/x-www-form-urlencoded/raw/binary…, jsonSchema, content, example} | 契约为 Apifox requestBody 的子集;契约 type 命名 form↔form-data 对齐建议保留契约简版 |
213
+ | auth {type: none|bearer|basic, token, username, password} | auth {authType, authConfigs[]} + securityScheme(oasAuthType) | 契约为 Apifox authType 的子集;Apifox 支持 securityScheme/OAS 认证联动,契约单对象扁平模型成立 |
214
+ | description | description | 一致 |
215
+ | createdAt/updatedAt | 未在明文观测到同名字段(疑在 .jsc/元数据层) | 标注:契约 timestamps 方案不受影响 |
216
+ | flow.steps {actor,action,target,message,note} | 无直接对应物;最近邻为 testSteps(自动化测试步骤, 含 options/performanceTestOptions) | 结构性差异:契约 flow 是 sequence 叙事模型,Apifox 对应物是测试编排而非流程图叙事;dsh-postapi flow 为差异化功能,无现成 schema 可抄 |
217
+
218
+ 结论:契约 §1 是 Apifox 数据模型的刻意简化子集,无字段级冲突;差异全部为「Apifox 更复杂、契约取子集」方向,T3 按契约实现即可,§1 无需修改。备注(非契约变更):endpoint.folderId 语义与 Apifox 一致,未来若支持排序可预留 itemsOrder 字段位。
219
+
220
+ ## 6. 本地存储方式(观测结论)
221
+
222
+ 1. 主存储 = IndexedDB(Dexie):dexie 痕迹 20 处(dist 全局),renderer/ts.<hash>.worker.js 为数据引擎 Worker(indexedDB API 14 处);数据实体(§5.1)即 Dexie store 名。SQLite 0 命中(better-sqlite3/sql.js/.sqlite 全库 grep 无结果)——纯 IndexedDB 架构。
223
+ 2. 跨 context 通道 = MessagePort:dexie-host-preload.js(360B 全文)监听 IPC 通道 electronAPI:dexieHost:port,把 e.ports[0] 以 window.postMessage({__dexieHostPortChannel}, "*", [r]) 转发给页面——preload 是零逻辑薄壳,数据逻辑全部在 worker/页面侧。
224
+ 3. 设置层 = localStorage:64 处调用;观测键:currentAccessToken、apiMode、Context:currentProject、命名空间模板 <store>.<key>(localStorageStore 实现 get/set/delete/bulkSet,index chunk 模块 460637)与三段式 <a>.<b>.<c>。
225
+ 4. 文件介质:数据源枚举含 File/Local_Ipc(§1 架构图),userDataPath 由装饰器注入——导入/导出/离线资源走文件系统;dist/offline/ 为离线资源镜像。
226
+ 5. 更新缓存:apifox-updater 目录(app-update.yml)。
227
+ 6. 对契约 §1 的含义:Apifox 的 DB-in-IndexedDB + MessagePort 架构服务于多窗口/多 tab 实时共享 + 云同步场景;dsh-postapi 契约的单文件 JSON + 原子写 + 串行队列是不同问题域的正确选择(插件宿主已有 inject face 数据面),维持契约现状。
228
+
229
+ ## 7. 对本插件(dsh-postapi)的借鉴点清单
230
+
231
+ 1. face 生命周期命名:attachIPC:{create,send,invoke,subscribe,unsubscribe,dispose,event} 的统一生命周期动词表,可作为 postapi.storage/request face 方法命名的对齐参考(契约签名已固定,仅命名风格借鉴)。
232
+ 2. 薄壳 preload + 端口转发:dexie-host-preload 360B 只转发 MessagePort,逻辑在 worker——本插件 client 侧 api 桩可同样保持零业务逻辑薄壳(与契约 §3「页面先用注入 api 对象桩」一致)。
233
+ 3. 字段注册表模式:Diff 比较器 {key,title,pickedFieldNames,formatter,hideFieldNameIfSingleField} 声明式字段描述——doc 页接口属性表/未来对比功能可直接套用此模式。
234
+ 4. OAS Operation 字段全集:契约 endpoint 未来扩展(responses/security/callbacks)时的字段位规划参照 §5.2/§5.3。
235
+ 5. 路由参数化:/project/:id?、/main/:key? 可选参数路由——契约五页 hash 路由中的 #/doc/:endpointId 已同构,无需改动;可选段 "?" 写法可借鉴到 overview→doc 直跳场景。
236
+ 6. localStorage 命名空间:<Context>:<key> / <store>.<key> 两级命名空间(Apifox 用 Context:currentProject 隔离项目态)——插件 UI 态持久化键建议 postapi:<page>:<key> 风格。
237
+ 7. 桌面窗口安全区:index.html 的 --safe-window-control-width/height:48px 处理自定义标题栏与系统热区冲突——T5 页面若做贴边布局需预留同等变量(Geist token 体系内补 --safe-* 即可)。
238
+ 8. 埋点轻量桥:eventTracking.dataLayer.push + AliLogTracker GET 上报——插件如需诊断遥测可复用此零依赖模式(可选,契约未要求)。
239
+ 9. 更新通道描述文件:app-update.yml 按 <version>/win64/ 路径寻址——dsh_release_watch 的版本探测可对齐 Apifox 官方通道 URL 规律(观测:client-updates/<精确版本>/win64/)。
240
+ 10. 反模式警示:React 16.13.1 与 17.0.2 双版本共存于同一渲染层(多入口遗留)——插件构建须锁定单一 React 依赖,避免同类碎片化;bytenode/NSIS 双层保护对本插件无必要,保持 esbuild 透明产物即可。
241
+
242
+ ## 8. 验收自检(七项)
243
+
244
+ | # | 验收项 | 状态 | 位置 |
245
+ |---|---|---|---|
246
+ | 1 | 架构文字图 | ✅ | §1 |
247
+ | 2 | 技术栈+版本证据 | ✅ | §2(逐项证据位置) |
248
+ | 3 | 页面路由全表 | ✅ | §3(97 条正则全表 + REA 48 条佐证) |
249
+ | 4 | 组件/端点观测清单(附 coverage/limitations 原文) | ✅ | §4(原文全量引用) |
250
+ | 5 | 数据模型字段全表 + 契约 §1 差异表 | ✅ | §5(52 观测键 + 逐字段差异表;3 处「未取证」显式标注) |
251
+ | 6 | 本地存储方式 | ✅ | §6(无 SQLite 显式证据) |
252
+ | 7 | 借鉴点清单 | ✅ | §7(10 条) |
253
+
254
+ 缺项说明:无缺项。三处显式「未取证」项(Apifox id 生成规则、method 枚举全集、createdAt/updatedAt 字段名)均在 §5.3 表内标注,均不阻塞契约实现。
@@ -0,0 +1,150 @@
1
+ # Apifox 视觉复刻交付总结(feature/apifox-ui-parity)
2
+
3
+ > 交付日 2026-11-18 · 分支 `feature/apifox-ui-parity`(3 个提交,可逐条回滚)
4
+ > 视觉基线:`docs/apifox-design-spec.md`(从 Apifox 2.8.55 的 165 个 CSS chunk 统计得出)
5
+ > 审计报告:`docs/ui-audit.md`
6
+
7
+ ## 1. 结论
8
+
9
+ 插件从 Vercel Geist 皮肤整体切换到 **Apifox 工作台视觉**:紫主色、32px 控件、240px 左树、1px 边框卡片化、白字彩底方法徽标、固定行高 20/22/24。12 页全部重排,骨架改为「顶栏 + 全局页签条 + 三段式」。
10
+
11
+ 五道验收全绿:
12
+
13
+ | 验收 | 命令 | 结果 |
14
+ |---|---|---|
15
+ | 构建 + 产物 smoke | `node build.mjs` | exit 0,7 个 effect(含样式注入),12 页注册 |
16
+ | 单元/集成测试 | `node tests/run.js` | **247 通过 / 0 失败**(9 套件) |
17
+ | 宿主端到端冒烟 | `node scripts/smoke-host.mjs` | **27 项通过 / 0 失败** |
18
+ | 高度纪律 | `node src/client/pages/__tests__/heights.test.js` | **PASS (54 checks)** |
19
+ | UI 一致性审计 | `node tests/ui-audit.test.js` | **12 通过 / 0 失败,软清单 0 问题**(硬断言 423/423) |
20
+
21
+ 真机截图验证:desktop profile 页签内 12 条导航 + 4 块统计 + 项目卡片 + 最近接口表全部按 Apifox 样式渲染,左树无链接下划线,窄栏表格不竖排。
22
+
23
+ ## 2. 设计基线(从 Apifox 实测提取)
24
+
25
+ | 项 | Apifox 实测 | 落地 token |
26
+ |---|---|---|
27
+ | 主色 | `#9373ee`(紫,39 次) | `--accent` |
28
+ | 底色 | `#f9fafb` | `--bg-app` |
29
+ | 正文 | `#344054`(石板灰,42 次) | `--fg` |
30
+ | 边框 | `#eaecf0`(94 次) | `--border` |
31
+ | 次级底 / hover | `#f2f4f7`(53 次) | `--bg-subtle` / `--bg-hover` |
32
+ | 三级文字 | `#98a2b3` | `--fg-tertiary` |
33
+ | 控件高 | 32px(377 次,绝对主力) | `--ctl-h` |
34
+ | 行高 | 固定 20/22/24px | `--lh-20/22/24` |
35
+ | 圆角 | 4/6/8/12px | `--radius-sm/ctl/card/lg` |
36
+ | 左树宽 | 240px | `--nav-w` |
37
+ | 顶栏高 | 48px | `--topbar-h` |
38
+ | 方法徽标 | 白字彩底(GET 绿/POST 蓝/PUT 橙/DELETE 红/PATCH 紫红) | `--method-*` |
39
+
40
+ 完整色板 22 项 + 尺寸 33 项见规范文档,审计套件逐值断言。
41
+
42
+ ## 3. 并行分工
43
+
44
+ | teammate | 任务 | 写范围 | 产出 |
45
+ |---|---|---|---|
46
+ | shell-frame | task-6 | shell/Body.js、locales.js、ApiTitle.js、tests/shell-frame.test.js | 工作台骨架(顶栏 + 12 条全局页签 + 左树竖排 + 右上下文栏),18 条测试 |
47
+ | pages-a2 | task-7 | doc.jsx、debug.jsx、components/** | 文档页三段式 + 调试台(URL 行/四页签/响应面板)+ 4 组件 Apifox 化,11 条新测试(pages-a 16→27) |
48
+ | pages-b2 | task-8 | 其余九页 + tests/pages-b.test.js | 九页重排(统计块/卡片网格/表格/胶囊/JSON 编辑器),12 条新测试(70→82) |
49
+ | ui-audit | task-9 | tests/ui-audit.test.js、docs/ui-audit.md | 独立审计(硬断言 2 项 + 软清单 9 项),定位 18 处问题 |
50
+ | lead | 集成 | design-tokens.css、build.mjs、client/index.js、pages-entry.js、tests/run.js、docs/** | 设计规范、token 全量重写、样式注入、问题收口、真机验证 |
51
+
52
+ ## 4. lead 修掉的三个关键缺陷
53
+
54
+ ### 4.1 样式表根本没被加载(最严重)
55
+
56
+ `design-tokens.css` 只被注释引用,从未被 import 或注入。宿主 `__ModuleLoader__` 只加载 CJS 模块、没有 CSS 入口,因此**所有 `.pp-*` 类完全不生效**,页面是无样式裸 HTML(第一次截图就是这个状态)。
57
+
58
+ 修法:`build.mjs` 加 `loader: { '.css': 'text' }` 把样式表以文本打进产物;`src/client/index.js` 在 apply 首步插 `<style data-plugin="dsh-postapi">`,并在 disposer 里移除。构建 smoke 增加「产物必须含 `--ctl-h`」断言。
59
+
60
+ ### 4.2 左树链接下划线泄漏
61
+
62
+ 骨架的左树条目是 `<a href="#/...">`,`.pp-tree-row` 没有 `text-decoration: none`,整列变成带下划线的蓝色链接。已补 `text-decoration: none` + 显式 `color`,`.pp-list-row` 同样处理。
63
+
64
+ ### 4.3 窄栏表格中文竖排
65
+
66
+ 侧边栏宽度约 500px,`.pp-table td` 原用 `word-break: break-word`,中文被逐字断行,「查询订单列表」变成一列竖排字。改为 `white-space: nowrap` + 省略号,并新增 `.pp-table-wrap` 横向滚动容器。
67
+
68
+ ## 5. 审计发现与收口
69
+
70
+ 审计首轮报 18 处问题,已全部清零:
71
+
72
+ | 类别 | 首轮 | 定稿 | 处理 |
73
+ |---|---|---|---|
74
+ | 颜色字面量 | 7 | **0** | 新增 `--fg-on-accent`;徽章 `#247bbf` → `currentColor` |
75
+ | 字号字面量 | 11 | **0** | 新增 `--fs-chart: 10px`;SVG 11 处改 token |
76
+ | 方法徽标缺失 | 2 | **0** | test 场景步骤 + import 示例接口补 `.pp-method[data-method]` |
77
+ | 布局骨架缺失 | 1 | **0** | Body.js 补工作台级 `.pp-tabs` |
78
+ | 旧皮肤残留 | 2 | **0** | sequence.jsx `--paper` → `--bg-app`,兜底色 → `currentColor` |
79
+
80
+ ## 6. 提交历史(逐条可回滚)
81
+
82
+ ```
83
+ 6dbfbe9 新增(界面): 全站 Apifox 视觉复刻(工作台骨架/紫主色/12 页重排/样式注入)
84
+ c9750e7 新增(设计): Apifox 设计规范与全量 token 重写(紫主色/32px 控件/240 树宽)
85
+ 2966224 修复(测试): 临时产物改落仓库内 .tmp,绕开 Windows 临时目录写入拒绝
86
+ ```
87
+
88
+ 回滚方式:`git revert 6dbfbe9` 退回 Vercel Geist 皮肤;`git reset --hard 76c2fbe` 回到分支起点(master)。
89
+
90
+ ## 7. 遗留待办
91
+
92
+ 1. **顶栏环境下拉**只有「默认环境」占位——骨架拿不到 projectId(取项目是页面职责),要真下拉需给骨架一个「当前项目」来源。
93
+ 2. **doc 页双层右栏**:骨架给 doc 出右栏(页面说明+快捷入口),doc 页自身又有右 TOC,视觉上多一层 240px。需要决定是让 doc 在骨架内走两栏,还是骨架对 doc 不出右栏。
94
+ 3. **「新建接口」按钮**只跳 `#/doc`(无 saveEndpoint 的 projectId 来源,不做假写库)。
95
+ 4. `.pp-seg`/`.pp-field`/`.pp-field-head`/`.pp-warn`/`.pp-scroll`/`.pp-aside-sticky` 为预留工具类,当前无页面使用。
96
+
97
+
98
+ ---
99
+
100
+ ## 10. 导航 v2 改造(2026-11-18 追加)
101
+
102
+ ### 10.1 为什么要改
103
+
104
+ v1 的两个硬伤在真机截图里暴露得很清楚:
105
+
106
+ 1. **重复导航**:12 条路由在左树平铺一遍、又在水平页签条平铺一遍,两套入口做同一件事,还白吃 40px 纵向。
107
+ 2. **主区被挤压**:侧栏容器实测宽 719px,v1 是 240px 左树 + 主区 + 240px 右栏 → 主区只剩约 240px,内容全挤成竖排。
108
+
109
+ ### 10.2 改成什么
110
+
111
+ ```
112
+ 顶栏 44px 标题 / 分组面包屑 · 搜索 · 新建接口 · 环境 · ☀ ⚙ ?
113
+ ├ 图标轨 48px(5 个分组:项目 / 接口 / 数据 / 质量 / 工具)
114
+ └ 主区 = 容器宽 - 48px(页头一行说明 + 页面内容)
115
+ ↑ 点分组图标 → 浮层 200px 覆盖在主区之上,主区宽度不变
116
+ ```
117
+
118
+ 实测:`.pp-shell` 719px → `.pp-main-v2` **671px**(719 − 48),浮层展开后主区宽度仍是 671px(`position: absolute` 不参与布局)。v1 同容器下主区约 240px,**可用宽提升约 2.8 倍**。
119
+
120
+ ### 10.3 三级菜单如何避免撑开
121
+
122
+ | 层级 | 形态 | 是否占主区宽度 |
123
+ |---|---|---|
124
+ | 一级 | 图标轨 `.pp-rail` 48px,5 个 SVG 图标 | 占 48px(固定,永不展开) |
125
+ | 二级 | 浮层 `.pp-flyout` 200px,`position: absolute` | **不占**(覆盖) |
126
+ | 三级 | 浮层内路由条目 `.pp-flyout-item` | **不占**(覆盖) |
127
+
128
+ 交互:点分组图标展开/收起、点条目跳转并自动收起、Esc 关闭、点浮层外关闭、路由变化自动收起。
129
+
130
+ ### 10.4 其它 ergonomics 修正
131
+
132
+ - **三层标题去重**:v1 顶栏标题 + 页头标题 + 页面自身 `h1` 三层叠着。v2 顶栏保留标题,页头只留一行说明(无说明时整块不渲染),页面自身标题归页面。
133
+ - **图标改 SVG**:原先用 `◫ ≡ ⬡ ✓ ⚙` 等符号字符,在 Windows 字体下基线与粗细不一致、看起来歪。改为 24×24 stroke 风格 SVG(`Icon` 组件 + `ICON_PATHS` 表)。
134
+ - **动作图标化**:主题/设置/帮助从文字按钮改成 28×28 图标按钮(`.pp-icon-btn`,满足 `--hit: 28px` 命中区),窄栏不再换行。
135
+ - **右上下文栏收进 `?` 浮层**:原 240px 常驻右栏信息价值低,改为顶栏一个帮助图标按需浮出(页面说明 + 4 条快捷入口)。
136
+ - **顶栏 48 → 44px**,纵向再省 4px。
137
+
138
+ ### 10.5 验收
139
+
140
+ | 项 | 结果 |
141
+ |---|---|
142
+ | `node build.mjs` | exit 0,7 个 effect,产物含 `--rail-w` |
143
+ | `node tests/run.js` | **250 通过 / 0 失败** |
144
+ | `node scripts/smoke-host.mjs` | 27 项通过 / 0 失败 |
145
+ | `heights.test.js` | **PASS (68 checks)**(新增 rail/hit token 纳入检查) |
146
+ | `ui-audit.test.js` | **12 通过 / 0 失败**,软清单 0 问题 |
147
+ | 真机实测 | 轨 5 个 SVG 图标;主区 671px;浮层展开 3 条目且主区宽度不变 |
148
+
149
+ 提交:`2ac4350 重构(界面): 导航改图标轨+浮层二级菜单,主区不再被导航挤压`
150
+