推进 INI 面板 shell integration mount DOM smoke

This commit is contained in:
2026-06-15 11:51:11 +08:00
parent 1375e0ddd5
commit 54f8551c50
4 changed files with 148 additions and 1 deletions

View File

@@ -2565,3 +2565,81 @@ host_wasm_opfs_browser_smokes=ok
继续推进 browser/UI workflow。下一批建议在 shell integration browser workflow 中增加 ready
mount-state DOM rendering helper 或 smoke把 control-page ready 后的 mount render-state 渲染到
外部 shell 自有 DOM 并校验 row/status仍保持只读不新增控制按钮不解析 G-code。
三十二、2026-06-15 继续执行记录INI panel shell integration ready mount DOM smoke
本轮按“第一原则:加快实质性推进”继续推进 browser/UI workflow在真实 shell integration
browser workflow 中新增外部 shell 自有 DOM renderer校验 waiting 与 ready mount-state DOM
显示。
完成内容:
- `ini_panel_shell_integration_workflow_smoke.html` 新增外部 shell 自有只读 mount 区域:
- `[data-external-shell-mount]`
- `[data-external-shell-mount-status]`
- `[data-external-shell-mount-rows]`
- 新增 `renderExternalShellMountState(renderState)` 测试 helper
- workflow 初始阶段把默认 waiting mount render-state 渲染到外部 shell DOM
- workflow 在真实 control page iframe ready 后,把 ready mount render-state 渲染到外部 shell DOM
- browser smoke 校验 waiting DOM
- status 为 `Blocked: session-load-state`
- `data-handoff-ready="false"`
- `session-load-state` row status 为 `blocked`
- browser smoke 校验 ready DOM
- status 为 `Ready: No blocking reasons`
- `data-handoff-ready="true"`
- `session-load-state` row value 为 `ready`
- `session-load-state` row status 为 `pass`
- `docs/panel-entry.md` 记录 shell integration workflow 中外部 shell-owned DOM 渲染;
- `verify_ini_panel_entry_docs.mjs` 覆盖外部 shell mount DOM hooks 与 workflow smoke
- 未新增控制按钮;
- 未解析 G-code
- 未解释 canonical events
- 未新增 JS CNC 语义;
- 未改变 OPFS/session persistence、LinuxCNC interpreter、tool、parameter、planner 或
LinuxCNC-owned runtime semantics。
验证已通过:
```bash
git diff --check
wasm-port/tests/ui/node/verify_ini_panel_entry_docs.sh
wasm-port/tests/ui/node/verify_ini_panel_launch_api_manifest.sh
wasm-port/tests/ui/node/verify_ini_panel_ui_shell.sh
wasm-port/tests/ui/node/verify_ini_panel_shell_integration_manifest.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_entry_docs_node_smoke=ok
ini_panel_launch_api_manifest_node_smoke=ok
ini_panel_ui_shell_node_smoke=ok
ini_panel_shell_integration_manifest_node_smoke=ok
browser_ini_opfs_smoke=ok
browser_ini_control_page_smoke=ok
browser_ini_launch_smoke=ok
browser_ini_shell_integration_workflow_smoke=ok
ui_node_smokes=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
```
下一步建议:
继续推进 SDK/API surface。下一批建议把外部 shell mount DOM renderer 抽成可复用 helper
`renderIniPanelShellSessionHandoffMountState()` 或等价 API并用 Node/browser smoke 保护其
DOM contract仍保持只读不新增控制按钮不解析 G-code。

View File

@@ -230,7 +230,9 @@ state into `[data-handoff-mount]`, `[data-handoff-mount-status]`, and
The browser workflow smoke
`tests/browser/ini_panel_shell_integration_workflow_smoke.html` verifies the
same external shell handoff: read integration manifest, pass readiness gate,
open the control page target, then read readonly machine-session status.
open the control page target, render waiting and ready mount-state into an
external shell-owned `[data-external-shell-mount]` DOM region, then read
readonly machine-session status.
The control-page refresh workflow lives in
`runtime/ui/ini-panel/control-page-refresh-workflow.js`. Use

View File

@@ -6,6 +6,10 @@
</head>
<body>
<pre id="status">running</pre>
<section data-external-shell-mount>
<p data-external-shell-mount-status>waiting</p>
<dl data-external-shell-mount-rows></dl>
</section>
<script type="module">
function assertEqual(actual, expected, label) {
if (actual !== expected) {
@@ -40,6 +44,28 @@
return frame.contentDocument;
}
function renderExternalShellMountState(renderState) {
const mountNode = document.querySelector("[data-external-shell-mount]");
const statusNode = document.querySelector("[data-external-shell-mount-status]");
const rowsNode = document.querySelector("[data-external-shell-mount-rows]");
mountNode.dataset.handoffPhase = renderState.dataset.handoffPhase;
mountNode.dataset.handoffReady = renderState.dataset.handoffReady;
mountNode.dataset.handoffScope = renderState.dataset.handoffScope;
statusNode.textContent = renderState.statusLine;
rowsNode.replaceChildren();
for (const row of renderState.rows) {
const term = document.createElement("dt");
term.dataset.externalMountRow = row.id;
term.dataset.externalMountStatus = row.status;
term.textContent = row.label;
const detail = document.createElement("dd");
detail.dataset.externalMountValue = row.id;
detail.dataset.externalMountStatus = row.status;
detail.textContent = row.value;
rowsNode.append(term, detail);
}
}
try {
const iniText = `[EMC]
MACHINE = browser-shell-integration
@@ -104,6 +130,7 @@ TOOL_TABLE = browser-shell-tool.tbl
const handoffPackageMountState = launchApi.getShellSessionHandoffPackageMountState();
const handoffPackageMountDisplay = launchApi.getShellSessionHandoffPackageMountDisplayViewModel();
const handoffPackageMountRenderState = launchApi.getShellSessionHandoffPackageMountRenderState();
renderExternalShellMountState(handoffPackageMountRenderState);
assertEqual(handoffSummarySchema.summaryVersion, 1, "shell handoff summary schema version");
assertEqual(
launchApi.isSupportedShellSessionHandoffSummary(handoffSummary),
@@ -168,6 +195,21 @@ TOOL_TABLE = browser-shell-tool.tbl
assertEqual(handoffPackageMountState.sessionLoadState.phase, "waiting-panel", "shell handoff package mount-state default session");
assertEqual(handoffPackageMountDisplay.detailText, "session-load-state", "shell handoff package mount display detail");
assertEqual(handoffPackageMountRenderState.statusLine, "Blocked: session-load-state", "shell handoff package mount render-state status");
assertEqual(
document.querySelector("[data-external-shell-mount-status]").textContent,
"Blocked: session-load-state",
"external shell waiting mount status",
);
assertEqual(
document.querySelector("[data-external-shell-mount]").dataset.handoffReady,
"false",
"external shell waiting mount readiness",
);
assertEqual(
document.querySelector('[data-external-mount-value="session-load-state"]').dataset.externalMountStatus,
"blocked",
"external shell waiting mount row status",
);
assertEqual(handoffPackage.checklist.ready, handoffChecklist.ready, "shell handoff package checklist");
assertEqual(
handoffPackage.actionPlan.nextSteps.map(({ id }) => id).join(","),
@@ -245,10 +287,31 @@ TOOL_TABLE = browser-shell-tool.tbl
);
const readyMountDisplay = launchApi.getShellSessionHandoffPackageMountDisplayViewModel(readyMountState);
const readyMountRenderState = launchApi.getShellSessionHandoffPackageMountRenderState(readyMountState);
renderExternalShellMountState(readyMountRenderState);
assertEqual(readyMountState.ready, true, "shell handoff package mount-state readiness");
assertEqual(readyMountState.sessionLoadState.phase, "ready", "shell handoff package mount-state ready session");
assertEqual(readyMountDisplay.detailText, "No blocking reasons", "shell handoff package ready mount display");
assertEqual(readyMountRenderState.statusLine, "Ready: No blocking reasons", "shell handoff package ready mount render-state");
assertEqual(
document.querySelector("[data-external-shell-mount-status]").textContent,
"Ready: No blocking reasons",
"external shell ready mount status",
);
assertEqual(
document.querySelector("[data-external-shell-mount]").dataset.handoffReady,
"true",
"external shell ready mount readiness",
);
assertEqual(
document.querySelector('[data-external-mount-value="session-load-state"]').textContent,
"ready",
"external shell ready mount row value",
);
assertEqual(
document.querySelector('[data-external-mount-value="session-load-state"]').dataset.externalMountStatus,
"pass",
"external shell ready mount row status",
);
assertEqual(
controlPageApi[handoffSummary.handoffMethods.readStatus]().status.lastAction,
null,

View File

@@ -431,6 +431,7 @@ assert.match(docText, /\blinuxCncIniPanelLaunchApi\.isSupportedShellSessionHando
assert.match(docText, /\bdata-handoff-shell\b/);
assert.match(docText, /\bdata-handoff-status\b/);
assert.match(docText, /\bdata-handoff-rows\b/);
assert.match(docText, /\bdata-external-shell-mount\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getControlPageApiMethods\b/);
assert.match(docText, /\bini_panel_shell_integration_workflow_smoke\.html\b/);
assert.match(browserIniPanelText, /\bini_panel_shell_integration_workflow_smoke\.html\b/);
@@ -446,6 +447,9 @@ assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffCheckli
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffPackageSchema\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffPackage\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffPackageReport\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffPackageMountRenderState\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bdata-external-shell-mount\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bdata-external-mount-value\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bisSupportedShellSessionHandoffPackage\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bhandoffSummary\.handoffMethods\.readStatus\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\breadControlPageStatus\b/);