From fc4fb54a206b96b214883ef279cff7eff03a7008 Mon Sep 17 00:00:00 2001 From: wangdequan Date: Sun, 14 Jun 2026 23:21:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E8=BF=9B=20INI=20=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=20ui=20shell=20export?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- text11.txt | 63 +++++++++++++++++++ wasm-port/docs/ui-panel-state-summary.md | 2 + wasm-port/runtime/ui/ini-panel/ui-shell.js | 11 ++++ .../ui/node/verify_ini_panel_ui_shell.mjs | 48 ++++++++++++++ .../ui/node/verify_ini_panel_ui_shell.sh | 6 ++ .../tests/ui/node/verify_ui_node_smokes.sh | 1 + 6 files changed, 131 insertions(+) create mode 100644 wasm-port/runtime/ui/ini-panel/ui-shell.js create mode 100644 wasm-port/tests/ui/node/verify_ini_panel_ui_shell.mjs create mode 100755 wasm-port/tests/ui/node/verify_ini_panel_ui_shell.sh diff --git a/text11.txt b/text11.txt index f0b81d0..b44774e 100644 --- a/text11.txt +++ b/text11.txt @@ -1390,3 +1390,66 @@ host_wasm_opfs_browser_smokes=ok controller/renderer 组合成一个更明确的 `ui-shell` 或 `panel-entry` 文档/API 入口,或者新增 一个 node smoke 验证 docs 中列出的入口与 manifest 完全一致;仍保持只读,不新增控制按钮, 不解析 G-code。 + +十七、2026-06-14 继续执行记录:INI panel ui shell export + +本轮按“加快实质性推进”新增统一 UI shell 导出,把 entry manifest、control page controller +和 control view renderer 收敛到单一入口模块,方便上层页面、文档和 smoke 共享。 + +完成内容: + +- 新增 `wasm-port/runtime/ui/ini-panel/ui-shell.js`; +- `ui-shell.js` 统一 re-export: + - `INI_PANEL_ENTRIES`; + - `getIniPanelEntryByHref()`; + - `getIniPanelEntryManifest()`; + - `createMachineSessionControlPageController()`; + - `renderMachineSessionControlView()`; +- 新增 `wasm-port/tests/ui/node/verify_ini_panel_ui_shell.mjs`; +- 新增 `wasm-port/tests/ui/node/verify_ini_panel_ui_shell.sh`; +- `wasm-port/tests/ui/node/verify_ui_node_smokes.sh` 纳入 ui shell node smoke; +- `wasm-port/docs/ui-panel-state-summary.md` 补充 ui shell 说明; +- 未新增控制按钮; +- 未解析 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_ui_shell.sh +wasm-port/tests/ui/node/verify_ui_node_smokes.sh +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_ui_shell_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 +host_wasm_opfs_browser_smokes=ok +``` + +下一步建议: + +继续保持只读边界,下一批建议在 `docs/ui-panel-state-summary.md` 之外补一个更短的 +`ui-shell.md` 或 `panel-entry.md`,只列出 `ui-shell.js`、`launch.html`、`control-page.html` +三者关系和最小用法,或者把 launcher 页面改成从 `ui-shell.js` 读取 manifest;仍不新增控制 +按钮,不解析 G-code。 diff --git a/wasm-port/docs/ui-panel-state-summary.md b/wasm-port/docs/ui-panel-state-summary.md index 65c415b..6b0e55d 100644 --- a/wasm-port/docs/ui-panel-state-summary.md +++ b/wasm-port/docs/ui-panel-state-summary.md @@ -34,6 +34,8 @@ The page uses `createMachineSessionControlPageController(...)` from reuse the same iframe/API polling contract. For a light navigation entry, open `runtime/ui/ini-panel/launch.html`. Its entry list is defined in `runtime/ui/ini-panel/entry-manifest.js`. +For a single shell-facing import, use `runtime/ui/ini-panel/ui-shell.js`, which +re-exports the entry manifest, control page controller, and control view renderer. ## `createIniPanelStateSummary(input)` diff --git a/wasm-port/runtime/ui/ini-panel/ui-shell.js b/wasm-port/runtime/ui/ini-panel/ui-shell.js new file mode 100644 index 0000000..3e9e950 --- /dev/null +++ b/wasm-port/runtime/ui/ini-panel/ui-shell.js @@ -0,0 +1,11 @@ +export { + INI_PANEL_ENTRIES, + getIniPanelEntryByHref, + getIniPanelEntryManifest, +} from "./entry-manifest.js"; +export { + createMachineSessionControlPageController, +} from "./control-page-controller.js"; +export { + renderMachineSessionControlView, +} from "./control-view-renderer.js"; diff --git a/wasm-port/tests/ui/node/verify_ini_panel_ui_shell.mjs b/wasm-port/tests/ui/node/verify_ini_panel_ui_shell.mjs new file mode 100644 index 0000000..57657a8 --- /dev/null +++ b/wasm-port/tests/ui/node/verify_ini_panel_ui_shell.mjs @@ -0,0 +1,48 @@ +import assert from "node:assert/strict"; + +import { + INI_PANEL_ENTRIES, + createMachineSessionControlPageController, + getIniPanelEntryByHref, + getIniPanelEntryManifest, + renderMachineSessionControlView, +} from "../../../runtime/ui/ini-panel/ui-shell.js"; + +assert.deepEqual(getIniPanelEntryManifest(), INI_PANEL_ENTRIES); +assert.equal(getIniPanelEntryByHref("./index.html")?.id, "edit-run"); +assert.equal(typeof createMachineSessionControlPageController, "function"); +assert.equal(typeof renderMachineSessionControlView, "function"); + +const panelFrame = { + contentWindow: { + linuxCncIniPanelApi: { + getMachineSessionControlView: () => ({ + status: { + lastAction: "run-gcode", + runStatus: "ok", + error: null, + }, + sections: [], + }), + }, + }, + addEventListener() {}, +}; +const statusNode = { textContent: "" }; +const viewNode = { textContent: "" }; +let renderedView = null; +const controller = createMachineSessionControlPageController({ + panelFrame, + statusNode, + viewNode, + renderControlView: (_container, view) => { + renderedView = view; + return { rendered: true }; + }, +}); + +assert.deepEqual(controller.render(), { rendered: true }); +assert.equal(statusNode.textContent, "run-gcode | ok | -"); +assert.equal(renderedView.status.runStatus, "ok"); + +console.log("ini_panel_ui_shell_node_smoke=ok"); diff --git a/wasm-port/tests/ui/node/verify_ini_panel_ui_shell.sh b/wasm-port/tests/ui/node/verify_ini_panel_ui_shell.sh new file mode 100755 index 0000000..e5ece04 --- /dev/null +++ b/wasm-port/tests/ui/node/verify_ini_panel_ui_shell.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT_DIR="$(cd "$(dirname "$0")/../../.." && pwd)" + +node "$ROOT_DIR/tests/ui/node/verify_ini_panel_ui_shell.mjs" diff --git a/wasm-port/tests/ui/node/verify_ui_node_smokes.sh b/wasm-port/tests/ui/node/verify_ui_node_smokes.sh index 5c89213..863ea9e 100755 --- a/wasm-port/tests/ui/node/verify_ui_node_smokes.sh +++ b/wasm-port/tests/ui/node/verify_ui_node_smokes.sh @@ -11,5 +11,6 @@ ROOT_DIR="$(cd "$(dirname "$0")/../../.." && pwd)" "$ROOT_DIR/tests/ui/node/verify_ini_panel_state_summary.sh" "$ROOT_DIR/tests/ui/node/verify_ini_panel_control_page_controller.sh" "$ROOT_DIR/tests/ui/node/verify_ini_panel_entry_manifest.sh" +"$ROOT_DIR/tests/ui/node/verify_ini_panel_ui_shell.sh" echo "ui_node_smokes=ok"