Files
FreeCADWasmDev/web/manual/content/ch15-help-start.md
wangdequan 300c8efb01 docs(web): full UI surface inventory, illustrated manual, panel screenshots
Interface design document and manual now share one authoritative surface
inventory (333 surfaces across 9 categories, gap 0), and every chapter carries
real Playwright screenshots of the panels it documents.

- tools/fcweb: ui-surface-scan/ui-surface-inventory (deterministic --check),
  build-ui-doc renders panel catalog, workbench matrix and mapping tables;
  blank toolbar crops (<1 KB) are skipped and pruned instead of embedded
- web/tools/manual: generate-panel-index (ch16), audit-ui-gaps,
  generate-final-status, generate-gaps-doc; pager is per-chapter so the manual
  no longer overflows horizontally
- manual: 130 screenshot references / 128 PNGs, panel sections for ch02-ch13
- web/src: utility menus stop click propagation (menu reopened on item click);
  workbench shell gains an OPFS document picker so workbench.html can bind a
  real document instead of the fixed workbench-document id; Sketcher panel
  moves from the command column to the main stage

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 01:30:31 +08:00

97 lines
4.5 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.
---
id: ch15
order: 15
title: 帮助、起始页、命令面板与偏好
level: specialist
---
# 第 15 章 帮助、起始页、命令面板与偏好
## 这一章解决什么问题
前面各章都在“做东西”。这一章讲**怎么找到功能、怎么改设置、怎么查一条命令到底能不能用**——也就是桌面 FreeCAD 里 Help、Start 两个工作台和偏好对话框承担的事。
Web 端有一个前提需要先说清楚:所有命令都从同一份桌面命令清单派发,所以“找命令”和“看状态”比桌面更集中。
## 15.1 Help 工作台(4 条命令)
Help 在 Web 端不是一个离线帮助浏览器,而是**源码与 Python API 的清点入口**:
| 命令 | 作用 |
|---|---|
| `Help_Help` | 打开帮助入口 |
| `help.inspectSourceInventory` | 列出当前构建里各模块的源码清单与文件计数 |
| `help.pythonApi` | 输出模块的 Python API 面(类、方法、属性) |
| 以及桌面菜单里的帮助项 | 与桌面同名,受限项会给出 `reason` |
打开方式:主壳的工作台选择器选 `Help`,或在独立页打开 `workbench.html?module=Help`。
> **实测边界**:Help 的多数条目是**只读检查**,不修改文档。真正的操作手册就是你现在读的这份 HTML。
## 15.2 Start 工作台(12 条命令)
Start 在桌面版是欢迎页 + 最近文件 + 示例。Web 端保留了其中的**程序化入口**:
| 命令 | 作用 |
|---|---|
| `Start_Start` | 回到起始视图 |
| `start.moduleImport` | 按模块名导入一个模块的 Python 入口 |
| `start.importSvg` | 导入 SVG |
| `start.inspectSourceInventory` | 起始页的源码清点 |
| `start.pythonApi` | 起始页的 Python API 面 |
与桌面的差别:Web 版**没有最近文件列表**,因为文档全部存在浏览器 OPFS 里,跨设备不共享。要打开已有文档,用主壳的文档标签或 `文件 → 打开`。
## 15.3 命令面板
命令面板是 Web 版最省事的入口:不用记菜单层级,直接输入命令名。
- 打开:`Ctrl+K`(紧凑布局下也可从工具栏打开)。
- 数据源:`workbench-command-matrix.json`,与命令账本同源,所以**搜索结果的状态就是真实状态**。
- 搜到受限命令时,面板会显示原因(例如缺少 worker、桌面侧为 GUI-only)。
命令面板特别适合查找那些“只在某个工作台出现一次”的命令——比如 `Part_SectionCut`、`BIM_IfcExplorer`。
## 15.4 偏好对话框
`编辑 → 偏好` 打开 `shell/preferences-dialog.tsx` 的受控对话框。Web 版可改的项目比桌面少,但下面几项是真实生效的:
| 分组 | 可改内容 | 生效方式 |
|---|---|---|
| 界面 | 语言、主题(明/暗)、单位显示 | 立即重渲染 |
| 工具栏 | 组顺序、显隐 | 写入 `toolbar-preferences.ts` 持久化 |
| 视口 | 显示精度、背景、轴十字 | 影响下一次网格请求 |
| 保存 | OPFS 目录、是否自动保存 | 只影响本地浏览器存储 |
偏好的持久化位置是浏览器 localStorage / OPFS,**不会**写回桌面 FreeCAD 的 `user.cfg`。
## 15.5 快捷键管理器
`编辑 → 快捷键` 打开 `shell/shortcut-manager.tsx`。
- 快捷键与桌面同名命令绑定,冲突检测在保存时执行。
- 修改只对当前浏览器生效。
- `Ctrl+Z` / `Ctrl+Y` 与各工作台自己的编辑快捷键在任务面板内优先。
## 15.6 怎么判断一条命令能不能用
这是本章最实用的部分。看到一条命令时,按下面的顺序判断:
1. **看按钮是否置灰**:置灰说明前置条件不满足(没有选中对象、没有打开文档、当前工作台不适用)。
2. **看状态栏提示**:受限命令会给出 `reason`,例如“current owner has been retained”。
3. **查命令账本**:设计文档第 6 节的状态口径(`implemented` / `native-ui-check` / `gui-route-family` / `gui-route-missing` / `gui-missing` / `boundary`)就是判断依据。
4. **跑一次**:真正执行后看 Report 面板与 Python 控制台输出。
> **不要**把“按钮存在”当成“功能可用”。Web 端的按钮是完整按桌面清单渲染的,可用性取决于它背后的 worker 与文档状态。
## 15.7 本章速查
| 需求 | 入口 |
|---|---|
| 找一条命令 | `Ctrl+K` 命令面板 |
| 看源码清单 | Help → `help.inspectSourceInventory` |
| 看 Python API | Help → `help.pythonApi` |
| 改工具栏 | 偏好 → 工具栏 |
| 改快捷键 | `编辑 → 快捷键` |
| 回到起始视图 | Start 工作台 |