推进 INI 面板 run readiness workflow helper

This commit is contained in:
2026-06-15 05:21:01 +08:00
parent a883af2d3e
commit 4a307f63f6
8 changed files with 322 additions and 11 deletions

View File

@@ -371,6 +371,87 @@ host_wasm_opfs_browser_smokes=ok
`loadMachineSessionIntoWasmWorkflow()`,避免 restore+load 与单独 load 的 field/log 状态模型
分叉;仍保持由 LinuxCNC/OPFS bridge 执行实际语义,不在 JS 中解释 CNC 行为。
三、2026-06-15 继续执行记录INI panel run readiness workflow helper
本轮按“第一原则:加快实质性推进”继续推进 run 前置状态模型,将 run 按钮可执行条件、
默认/快照 G-code 选择结果与已加载 session 的 WASM 绑定关系抽成可复用 readiness helper
让 app、state summary、control view 和 Node smoke 共享同一份运行前状态。
完成内容:
- 新增 `wasm-port/runtime/ui/ini-panel/run-workflow.js` 的
`createRunSessionReadinessState(input)`
- `runGcodeSessionWorkflow()` 现在先生成 readiness state再复用其中的选定程序和 loaded
session 信息执行实际 run
- readiness state 固定返回:
- `phase`
- `canRun`
- `missing`
- `loadedSession`
- `snapshot`
- `defaultProgram`
- `program`
- `runButton`
- `wasm-port/runtime/ui/ini-panel/app.js` 在点击 Run 前先写入 readiness state并把
`selectedProgram`、`runReadiness` 和 field state 一起更新到 panel state
- `wasm-port/runtime/ui/ini-panel/panel-state-summary.js` 新增 `runReadiness` 的 report /
workflowStatus / control-view 映射;
- `createMachineSessionControlView()` 的 Run 区新增 `Ready` 与 `Button` 行,用于 read-only
control page 读取首帧 run 前置状态;
- `wasm-port/tests/ui/node/verify_ini_panel_run_workflow.mjs` 覆盖 readiness helper 与
workflow readiness 返回值;
- `wasm-port/tests/ui/node/verify_ini_panel_state_summary.mjs` 覆盖 runReadiness 在 report、
bundle、workflowStatus 和 control view 中的映射;
- `wasm-port/docs/ui-run-summary-helpers.md` 和 `wasm-port/docs/ui-panel-state-summary.md`
同步说明 readiness helper 与 runReadiness 状态;
- 未新增控制按钮;
- 未解析 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_run_workflow.sh
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_run_workflow_node_smoke=ok
ini_panel_state_summary_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
```
下一步建议:
继续推进 OPFS/session persistence 的实质链路。下一批建议将 `load-session` 与
`restore-load-session` 的 field/log 路径再做一次轻量整合,优先把“已加载 session、快照恢复、
run readiness、run 结果”汇总成一个更上层的只读工作流状态对象;仍保持只描述 UI/host
boundary facts不在 JS 中解释 G-code、canonical events 或 CNC 运行语义。
三、2026-06-15 继续执行记录INI panel restore-load workflow 复用 load-session helper
本轮按“第一原则:加快实质性推进”继续推进 OPFS/session persistence 主链路,将