推进 INI 面板 control view helper

This commit is contained in:
2026-06-14 22:40:47 +08:00
parent e6f55d775f
commit 4133d202f0
6 changed files with 237 additions and 2 deletions

View File

@@ -958,3 +958,64 @@ host_wasm_opfs_browser_smokes=ok
继续沿“单点只读入口”推进,把 `window.linuxCncIniPanelApi` 再收敛成一个更明确的
`getMachineSessionView()` 或 `getMachineSessionStateBundle()` 的稳定消费者契约,并开始只
在这个 bundle 上面叠控制页展示逻辑;仍不新增按钮、不把 CNC 语义搬进 JS。
十、2026-06-14 继续执行记录INI panel control view helper
本轮按“加快实质性推进”继续往控制网页界面的只读展示层推进,在 bundle 之上新增
control view helper让上层 UI 可以直接渲染 status 与 sections/rows。
完成内容:
- `wasm-port/runtime/ui/ini-panel/panel-state-summary.js` 新增
`createMachineSessionControlView(bundle)`
- control view 返回:
- `status`
- `sections`
- readiness/session/run 三组 rows
- `wasm-port/runtime/ui/ini-panel/app.js` 在
`window.linuxCncIniPanelApi`、`window.getMachineSessionControlView()` 下暴露该 helper
- `wasm-port/tests/ui/node/verify_ini_panel_state_summary.mjs` 覆盖 view model 输出结构;
- `wasm-port/tests/browser/ini_panel_smoke.html` 在真实 save、restore-load、run 流程后验证
control view 的 status、section id、workflow row 和 canonical-event row
- `wasm-port/docs/ui-panel-state-summary.md` 补充 control view helper 说明;
- 未新增按钮;
- 未解析 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_state_summary.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_state_summary_node_smoke=ok
ui_node_smokes=ok
browser_ini_opfs_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
host_wasm_opfs_browser_smokes=ok
```
下一步建议:
继续推进实际控制网页界面的只读展示层。下一批建议新增一个极薄的 browser smoke 或
文档化控制页消费示例,直接读取 `window.linuxCncIniPanelApi.getMachineSessionControlView()`
并渲染 sections仍保持只读不加控制按钮不解析 G-code。