Files
FreeCADWasmDev/web/docs/current/desktop-parity-continuation.md
2026-11-13 14:28:46 +08:00

71 lines
4.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Web FreeCAD 桌面功能与 GUI 对标 · 接续点
更新:2026-11-13
计划:`/home/mes123456/.claude/plans/partitioned-puzzling-haven.md`
## 目标
统一 React 桌面式单壳;32 模块功能/GUI 对标;OPFS 文件;three.js 图形;
逐 workbench 截图 + 1492 命令矩阵 + 324 官方案例验收。
## 已完成(P0)
- **桌面参照可运行**:找到 `freecad-source/build/native-release/bin/FreeCAD`(GUI)
与 `FreeCADCmd`(控制台)。补齐缺失 GUI 模块(PartGui/SketcherGui/PartDesignGui/
TechDrawGui/FemGui/MeshGui/StartGui 等 18 个 `.so`)。
- 修复桌面源码编译缺口:
- `src/Gui/CommandStd.cpp` 增加 `NetworkRetriever.h` 引用;
- `src/Gui/NetworkRetriever.h/.cpp` 补 `StdCmdDownloadOnlineHelp::updateAction/className`;
- `src/Mod/Mesh/Gui/RemeshGmsh.cpp` `countFacets()` → `CountFacets()`。
- Xvfb `:2` 截图:`web/docs/current/desktop-parity-evidence/Part-desktop.png`。
- **桌面 GUI 清单**:`tools/parity/extract-desktop-gui.mjs`
- 输出 `web/public/api/desktop-gui-manifest.json`:29 个 GUI workbench(Plot/Show/Web
无桌面 workbench)、1492 命令记录、309 菜单命令、237 工具栏命令、746 条命令元数据。
- 输出 `web/docs/current/desktop-parity-matrix.json` 与
`web/public/api/gui-command-gap-report.json`:
implemented 3 / native-ui-check 196 / gui-route-missing 425 / gui-missing 865 / boundary 3。
- **Web 基线审计**:`tools/parity/audit-web-gui.mjs --workbench Part`
- 输出 `Part-web.png` 与 `Part-web-audit.json`;0 错误/0 溢出;
缺失菜单仅 `Part_ColorPerFace`(解析器伪菜单,后续修正)。
## 已完成(P1 骨架)
- `web/src/shell/`:
- `command-registry.ts`:加载 `desktop-gui-manifest.json`,提供 workbench/命令元数据;
- `menu-bar.tsx`:File/Edit/View/Tools/Macro/Windows/Help + 工作台菜单,支持子菜单与命令;
- `toolbar.tsx`:按 manifest 渲染工作台工具栏;
- `shell-preview.tsx` + `shell-preview.html`:29 个 workbench 选择器、菜单/工具栏、
three.js 预览视口(网格/坐标轴/Box)、属性/树/状态栏。
- 页面检查:`http://127.0.0.1:5181/shell-preview.html` 29 个 workbench、3 个工具栏、
0 pageError、0 横向溢出;截图
`web/docs/current/desktop-parity-evidence/shell-preview.png`。
- 说明:预览页仅渲染清单与命令回调(记录 last command),尚未接入统一文档/执行路由。
## 真实残余
- 统一桌面壳尚未实现:project-shell 仍只支持 9 个 workbench、菜单仅 Start/File/Edit/View/Part;
`workbench.html`/`partdesign.html` 仍是独立壳。
- `gui-route-missing` 425、`gui-missing` 865 尚未逐条分配 React owner。
- 桌面清单解析仍有伪菜单(Part_ColorPerFace、空 submenu),需过滤与层次修正。
- 桌面 GUI 启动有 `--no-sandbox` 警告横幅(来自环境变量),截图时需裁掉或清理环境。
- 桌面源码改动(3 文件)与 Web 工具/清单尚未提交。
## 下一步精确入口
1. 清理并提交:`tools/parity/extract-desktop-gui.mjs`、`audit-web-gui.mjs`、
`web/public/api/{desktop-gui-manifest,gui-command-gap-report}.json`、
`web/docs/current/desktop-parity-*`;桌面 3 个源码修复单独提交。
2. 把 `shell-preview` 的菜单/工具栏挂入 `project-shell.tsx`,用 command registry
替换静态菜单;Part 先接通 `activatePartAction`,其余 workbench 接 `desktopCommands`/
`workbench-registry`;旧页面重定向。
3. 修正解析器:去掉空/伪菜单,保留菜单层级;补 Python InitGui 的菜单/工具栏。
4. 每完成一个 workbench:`audit-web-gui.mjs --workbench <id>` 截图 + 差异 JSON。
## 关键路径
- 桌面 GUI:`freecad-source/build/native-release/bin/FreeCAD`
- 桌面源码:`freecad-source/src/Gui`、`freecad-source/src/Mod/*/Gui`
- Web 壳:`web/src/project-shell.tsx`、`web/src/workbench-shell.tsx`
- 清单/审计:`tools/parity/`、`web/public/api/desktop-gui-manifest.json`
- 证据:`web/docs/current/desktop-parity-evidence/`