diff --git a/text11.txt b/text11.txt index 5859f9c..2e9452b 100644 --- a/text11.txt +++ b/text11.txt @@ -1019,3 +1019,63 @@ host_wasm_opfs_browser_smokes=ok 继续推进实际控制网页界面的只读展示层。下一批建议新增一个极薄的 browser smoke 或 文档化控制页消费示例,直接读取 `window.linuxCncIniPanelApi.getMachineSessionControlView()` 并渲染 sections;仍保持只读,不加控制按钮,不解析 G-code。 + +十一、2026-06-14 继续执行记录:INI panel control view DOM consumer + +本轮按“加快实质性推进”把 control view 从纯数据 helper 推到真实 browser consumer 层, +新增一个极薄的只读 DOM 渲染示例,直接消费 +`window.linuxCncIniPanelApi.getMachineSessionControlView()`。 + +完成内容: + +- `wasm-port/tests/browser/ini_panel_smoke.html` 新增只读 control view DOM 容器; +- 新增 `renderControlView(document, view)`,按 `view.sections` 渲染 section heading 与 + `dl/dt/dd` rows; +- browser smoke 在真实 save、restore-load、run 流程后: + - 读取 `getMachineSessionControlView()`; + - 渲染 sections; + - 验证 DOM status; + - 验证 DOM section count; + - 验证 run section canonical-event row; +- `wasm-port/docs/ui-panel-state-summary.md` 增加最小 browser consumer 示例; +- 未新增控制按钮; +- 未解析 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 +``` + +下一步建议: + +继续推进实质控制网页界面,但保持只读边界。下一批建议把这个 DOM consumer 提取为一个 +可复用的纯 renderer helper,例如 `renderMachineSessionControlView(container, view)`, +供真实页面和 smoke 共用;仍不新增控制按钮,不解析 G-code。 diff --git a/wasm-port/docs/ui-panel-state-summary.md b/wasm-port/docs/ui-panel-state-summary.md index 557055c..3f00c22 100644 --- a/wasm-port/docs/ui-panel-state-summary.md +++ b/wasm-port/docs/ui-panel-state-summary.md @@ -161,6 +161,18 @@ This helper maps a bundle into UI-ready status and sections: It is a presentation mapping over the bundle only. It does not parse G-code, canonical events, or LinuxCNC-owned runtime content. +A minimal read-only browser consumer can render the sections directly: + +```js +const view = window.linuxCncIniPanelApi.getMachineSessionControlView(); +for (const section of view.sections) { + renderSection(section.title, section.rows); +} +``` + +Consumers should treat `rows` as display data and keep actions wired through +explicit workflow APIs instead of deriving behavior from labels. + ## Boundary Rules - Do not parse G-code text in this helper. diff --git a/wasm-port/tests/browser/ini_panel_smoke.html b/wasm-port/tests/browser/ini_panel_smoke.html index 8d28245..70ac4ec 100644 --- a/wasm-port/tests/browser/ini_panel_smoke.html +++ b/wasm-port/tests/browser/ini_panel_smoke.html @@ -6,6 +6,10 @@
running
+
+
+
+