推进 INI 面板 readonly status API

This commit is contained in:
2026-06-15 05:40:41 +08:00
parent deb8b7cdd3
commit 3280f3a53e
11 changed files with 302 additions and 1 deletions

View File

@@ -587,3 +587,75 @@ host_wasm_opfs_browser_smokes=ok
和 `run` 的状态入口再向上收拢成一个稳定的只读状态 API优先服务 control page 和 shell 的
统一读取;仍保持只描述 UI/host boundary facts不在 JS 中解释 G-code、canonical events 或
CNC 运行语义。
六、2026-06-15 继续执行记录INI panel readonly status API
本轮按“第一原则:加快实质性推进”继续把 control page / shell 的状态入口向上收拢,新增稳定的
read-only status API让外层 UI 能一次读取 state bundle、workflow status、overview、control view、
session、run readiness 和 run 结果。
完成内容:
- 新增 `wasm-port/runtime/ui/ini-panel/readonly-status-api.js`
- 新增 `createMachineSessionReadonlyStatus(input)`,固定只读状态对象 shape
- 新增 `readMachineSessionReadonlyStatus({ getPanelApi, getControlView })`,通过现有 panel API
读取 `stateBundle`、`workflowStatus` 和 `controlView`
- `createMachineSessionControlPageController()` 新增 `readStatus()`
- `ui-shell.js` re-export readonly status API
- `createIniPanelShellViewModel()` 的 `controlPage` 新增 `readStatus`
- 新增 `wasm-port/tests/ui/node/verify_ini_panel_readonly_status_api.mjs` 和 `.sh`
- `verify_ui_node_smokes.sh` 纳入 readonly status API smoke
- `verify_ini_panel_control_page_controller.mjs` 覆盖 controller `readStatus()`
- `verify_ini_panel_ui_shell.mjs` 覆盖 shell export、view-model 和 controller 读取路径;
- `verify_ini_panel_entry_docs.mjs` 与 `docs/panel-entry.md` 同步记录新 API
- 未新增控制按钮;
- 未解析 G-code
- 未解释 canonical events
- 未改变 OPFS/session persistence、LinuxCNC interpreter、tool、parameter、planner 或
LinuxCNC-owned runtime semantics。
验证已通过:
```bash
git diff --check
wasm-port/tests/ui/node/verify_ini_panel_readonly_status_api.sh
wasm-port/tests/ui/node/verify_ini_panel_control_page_controller.sh
wasm-port/tests/ui/node/verify_ini_panel_ui_shell.sh
wasm-port/tests/ui/node/verify_ini_panel_entry_docs.sh
wasm-port/tests/ui/node/verify_ui_node_smokes.sh
SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 wasm-port/tests/browser/verify_ini_panel_browser.sh
wasm-port/tools/verify_vendor_sync.sh
wasm-port/tools/verify_no_standalone_cnc_semantics.sh
SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_interp_wasm.sh
SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_sim_configs_inventory_wasm.sh
wasm-port/tests/host/verify_host_smokes.sh
```
关键输出:
```text
ini_panel_readonly_status_api_node_smoke=ok
ini_panel_control_page_controller_node_smoke=ok
ini_panel_ui_shell_node_smoke=ok
ini_panel_entry_docs_node_smoke=ok
ui_node_smokes=ok
browser_ini_opfs_smoke=ok
browser_ini_control_page_smoke=ok
browser_ini_launch_smoke=ok
vendor sync up to date
standalone CNC semantics guard complete
interp_wasm_node_smoke=ok
sim_configs_wasm_node_inventory_executed=28
sim_configs_wasm_node_inventory_passed=28
sim_configs_wasm_node_inventory_skipped=131
sim_configs_wasm_node_inventory_unexpected_fail=0
browser_interp_smoke=ok
host_wasm_opfs_browser_smokes=ok
```
下一步建议:
继续推进 SDK/API surface。下一批建议把 readonly status API 的 shape 写入一个轻量 SDK-facing
入口或 manifest方便外部页面稳定发现 `readStatus()`、`loadSessionState()`、`refresh()` 和
`renderView()`;仍保持只描述 UI/host boundary facts不在 JS 中解释 G-code、canonical events
或 CNC 运行语义。