接入 INI 面板浏览器状态 report getter

This commit is contained in:
2026-06-14 22:10:57 +08:00
parent 5b45491e55
commit 404cb1344c
4 changed files with 147 additions and 13 deletions

View File

@@ -624,3 +624,73 @@ host_wasm_opfs_browser_smokes=ok
- 复制、下载、对外 API
当前阶段先继续补 workflow 和 report后面再把它整理成一版面向“控制网页界面”的 roadmap。
五、2026-06-14 继续执行记录INI panel browser state report getter
本轮按“导出层”第一步推进,把 `MachineSessionStateReport` 接入真实浏览器 INI panel
流程,提供明确的上层 UI/API 读取入口,避免继续让消费者直接抓 DOM 或读取临时
`window.linuxCncIniPanelMachineSessionState`。
完成内容:
- `wasm-port/runtime/ui/ini-panel/app.js` 新增并暴露
`window.getMachineSessionStateReport()`
- getter 每次调用 `createMachineSessionStateReport(window.linuxCncIniPanelMachineSessionState)`
返回当前稳定 report
- `wasm-port/tests/browser/ini_panel_smoke.html` 在真实 save、restore-load、run
流程后读取 report并验证
- snapshot label
- G-code OPFS path
- loaded INI/parameter WASM path
- selected program source/path
- run status
- canonical-event 和 motion snapshot count
- last action 与 error
- `wasm-port/docs/ui-panel-state-summary.md` 明确上层 UI/API 应读取
`createMachineSessionStateReport(...)` 或 `window.getMachineSessionStateReport()`
不应抓 DOM 或直接依赖临时 window state
- 未新增下载/复制按钮,先稳定 API 入口;
- 未改变 INI panel OPFS bridge、snapshot-store、machine-file-store、LinuxCNC
interpreter、G-code 文本、canonical-event 语义、tool、parameter、planner 或
LinuxCNC-owned runtime semantics。
验证已通过:
```bash
git diff --check
wasm-port/tools/verify_vendor_sync.sh
wasm-port/tools/verify_no_standalone_cnc_semantics.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
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
vendor sync up to date
standalone CNC semantics guard complete
ini_panel_run_summary_node_smoke=ok
ini_panel_run_workflow_node_smoke=ok
ini_panel_session_summary_node_smoke=ok
ini_panel_session_workflow_node_smoke=ok
ini_panel_machine_file_summary_node_smoke=ok
ini_panel_state_summary_node_smoke=ok
ui_node_smokes=ok
browser_ini_opfs_smoke=ok
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
```
下一步建议:
继续沿“导出层/控制网页界面”roadmap 推进。下一批可以在不新增复杂 UI 按钮的前提下,
补一个更靠近上层消费者的 report export helper 或 SDK-facing wrapper例如把 report
序列化成稳定 JSON 文本/Blob 输入;仍只组合已有 host/runtime boundary facts不解析
G-code、不推导 CNC 语义、不读取 DOM。