From 766f630dfbbedcbd8c3bf317b6b9e367e1fdb2fe Mon Sep 17 00:00:00 2001 From: wangdequan Date: Mon, 15 Jun 2026 17:51:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E8=BF=9B=20INI=20=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=20workflow=20overview=20embedding=20contract?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- text13.txt | 92 +++++++++++++++++ wasm-port/docs/panel-entry.md | 18 ++++ wasm-port/runtime/ui/ini-panel/launch.html | 9 ++ wasm-port/runtime/ui/ini-panel/ui-shell.js | 98 +++++++++++++++++++ .../ui/ini-panel/workflow-overview.html | 13 +++ .../tests/browser/ini_panel_launch_smoke.html | 53 +++++++++- ...anel_shell_integration_workflow_smoke.html | 24 +++++ .../ui/node/verify_ini_panel_entry_docs.mjs | 6 ++ .../verify_ini_panel_launch_api_manifest.mjs | 6 ++ ...y_ini_panel_shell_integration_manifest.mjs | 42 +++++++- .../ui/node/verify_ini_panel_ui_shell.mjs | 86 ++++++++++++++++ 11 files changed, 442 insertions(+), 5 deletions(-) diff --git a/text13.txt b/text13.txt index 1e4bdd3..fb5f0cd 100644 --- a/text13.txt +++ b/text13.txt @@ -1113,3 +1113,95 @@ host_wasm_opfs_browser_smokes=ok `createIniPanelShellSessionHandoffPackageDisplayViewModel()` 或等价 helper,把 package report 压成稳定 label/value rows 与 status text,供 launch 页面或外部 shell 直接渲染 package report; 仍保持只读,不新增控制按钮,不解析 G-code。 + +十、2026-06-15 继续执行记录:INI panel workflow overview embedding contract + +本轮按 `text13.txt` 执行,不再扩展 `text12.txt`。继续推进 browser/UI workflow, +新增只读 workflow-overview embedding contract,让外部 shell 可以先验证 +`workflow-overview.html` iframe 的 API shape,再用 launch API 挂载 workflow overview。 + +完成内容: + +- `ui-shell.js` 新增: + - `createIniPanelShellWorkflowOverviewContract()`; + - `createIniPanelShellWorkflowOverviewReadiness()`; + - `mountIniPanelShellWorkflowOverviewEmbedding()`; +- `createIniPanelLaunchApiManifest().methods` 新增: + - `getWorkflowOverviewContract`; + - `getWorkflowOverviewReadiness`; + - `mountWorkflowOverviewEmbedding`; +- `launch.html` 的 `window.linuxCncIniPanelLaunchApi` 新增真实 browser 入口: + - `getWorkflowOverviewContract()`; + - `getWorkflowOverviewReadiness()`; + - `mountWorkflowOverviewEmbedding()`; +- `workflow-overview.html` 的 `window.linuxCncIniPanelWorkflowOverviewApi` 新增自描述入口: + - `getWorkflowOverviewContract()`; + - `getWorkflowOverviewReadinessFromApi()`; + - `mountWorkflowOverviewEmbedding()`; +- `verify_ini_panel_ui_shell.mjs` 覆盖: + - overview contract shape; + - missing API readiness; + - ready API readiness; + - embedding result; + - thrown mount error 转成 data error; +- `verify_ini_panel_launch_api_manifest.mjs` 覆盖 launch manifest 与 launch 页面真实 API; +- `verify_ini_panel_shell_integration_manifest.mjs` 覆盖 overview contract/readiness helper; +- `ini_panel_launch_smoke.html` 校验真实 launch iframe 加载真实 workflow-overview iframe 后, + 能读取 readiness 并执行 embedding workflow; +- `ini_panel_shell_integration_workflow_smoke.html` 校验外部 shell workflow 可通过 launch API + 消费真实 workflow-overview iframe; +- `docs/panel-entry.md` 与 `verify_ini_panel_entry_docs.mjs` 同步记录新 helper/API; +- 未新增控制按钮; +- 未执行 action-plan; +- 未解析 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_ui_shell.sh +wasm-port/tests/ui/node/verify_ini_panel_launch_api_manifest.sh +wasm-port/tests/ui/node/verify_ini_panel_shell_integration_manifest.sh +wasm-port/tests/ui/node/verify_ini_panel_entry_docs.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_ui_shell_node_smoke=ok +ini_panel_launch_api_manifest_node_smoke=ok +ini_panel_shell_integration_manifest_node_smoke=ok +ini_panel_entry_docs_node_smoke=ok +ui_node_smokes=ok +browser_ini_opfs_smoke=ok +browser_ini_control_page_smoke=ok +browser_ini_launch_smoke=ok +browser_ini_workflow_overview_smoke=ok +browser_ini_shell_integration_workflow_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 +``` + +下一步建议: + +继续推进 browser/UI workflow 与可执行 gate。下一批建议新增一个只读 +`createIniPanelShellWorkflowOverviewEmbeddingReport()` 或等价 helper,把 overview iframe +readiness、missing methods、mount phase、render row count 和 error 合并成 display-ready report, +便于外部 shell 在不能嵌入 overview 时直接显示原因;仍保持只读,不新增控制按钮,不解析 G-code。 diff --git a/wasm-port/docs/panel-entry.md b/wasm-port/docs/panel-entry.md index 279248d..0d6957a 100644 --- a/wasm-port/docs/panel-entry.md +++ b/wasm-port/docs/panel-entry.md @@ -39,6 +39,9 @@ import { createIniPanelShellSessionHandoffWorkflowRenderState, createIniPanelShellSessionHandoffWorkflowDomContract, createIniPanelShellSessionHandoffWorkflowDomReadiness, + createIniPanelShellWorkflowOverviewContract, + createIniPanelShellWorkflowOverviewReadiness, + mountIniPanelShellWorkflowOverviewEmbedding, renderIniPanelShellSessionHandoffWorkflowState, mountIniPanelShellSessionHandoffWorkflow, renderIniPanelShellSessionHandoffMountState, @@ -286,6 +289,21 @@ Use `mountIniPanelShellSessionHandoffWorkflow()` or `linuxCncIniPanelLaunchApi.mountShellSessionHandoffWorkflow()` when an outer shell needs one structured workflow DOM mount result containing contract, readiness, render-state, render result, and any mount error as data. Use +`createIniPanelShellWorkflowOverviewContract()` or +`linuxCncIniPanelLaunchApi.getWorkflowOverviewContract()` when an outer shell +needs the `workflow-overview.html` page href, browser API namespace, and method +names before embedding that page. Use +`createIniPanelShellWorkflowOverviewReadiness()` or +`linuxCncIniPanelLaunchApi.getWorkflowOverviewReadiness()` to check whether a +loaded workflow overview iframe exposes the expected read-only API. Use +`mountIniPanelShellWorkflowOverviewEmbedding()` or +`linuxCncIniPanelLaunchApi.mountWorkflowOverviewEmbedding()` when an outer +shell needs one structured embedding result containing contract readiness, +render-state, workflow overview mount result, and any mount error as data. The +workflow overview page also exposes +`linuxCncIniPanelWorkflowOverviewApi.mountWorkflowOverviewEmbedding()` for the +same read-only embedding path from inside the iframe. +Use `renderIniPanelShellSessionHandoffMountState()` or `linuxCncIniPanelLaunchApi.renderShellSessionHandoffMountState()` when an outer shell needs the shared read-only DOM renderer for those rows. The launch page diff --git a/wasm-port/runtime/ui/ini-panel/launch.html b/wasm-port/runtime/ui/ini-panel/launch.html index 73b26a5..db853c0 100644 --- a/wasm-port/runtime/ui/ini-panel/launch.html +++ b/wasm-port/runtime/ui/ini-panel/launch.html @@ -270,6 +270,15 @@ documentRef: document, }) ), + getWorkflowOverviewContract: (options) => ( + shellViewModel.createWorkflowOverviewContract(options) + ), + getWorkflowOverviewReadiness: (options) => ( + shellViewModel.createWorkflowOverviewReadiness(options) + ), + mountWorkflowOverviewEmbedding: (options) => ( + shellViewModel.mountWorkflowOverviewEmbedding(options) + ), isSupportedShellSessionHandoffPackage: shellViewModel.isSupportedShellSessionHandoffPackage, getLauncherLinks: () => shellViewModel.launcherLinks, getControlPageApiMethods: () => shellViewModel.controlPage.browserApiMethods, diff --git a/wasm-port/runtime/ui/ini-panel/ui-shell.js b/wasm-port/runtime/ui/ini-panel/ui-shell.js index d32e223..82d0d0f 100644 --- a/wasm-port/runtime/ui/ini-panel/ui-shell.js +++ b/wasm-port/runtime/ui/ini-panel/ui-shell.js @@ -156,6 +156,9 @@ export function createIniPanelLaunchApiManifest(entries = getVisibleIniPanelEntr "getShellSessionHandoffWorkflowDomReadiness", "renderShellSessionHandoffWorkflowState", "mountShellSessionHandoffWorkflow", + "getWorkflowOverviewContract", + "getWorkflowOverviewReadiness", + "mountWorkflowOverviewEmbedding", "isSupportedShellSessionHandoffPackage", "getLauncherLinks", "getControlPageApiMethods", @@ -1559,6 +1562,41 @@ export function createIniPanelShellSessionHandoffWorkflowDomContract({ }; } +export function createIniPanelShellWorkflowOverviewContract() { + return { + pageHref: "./workflow-overview.html", + entryId: "workflow-overview", + apiName: "linuxCncIniPanelWorkflowOverviewApi", + methodNames: [ + "getWorkflowOverviewRenderState", + "getWorkflowOverviewDisplayViewModel", + "getWorkflowOverviewSummary", + "getWorkflowOverviewDomContract", + "getWorkflowOverviewDomReadiness", + "renderWorkflowOverview", + "mountWorkflowOverview", + "createWorkflowOverviewRenderState", + ], + }; +} + +export function createIniPanelShellWorkflowOverviewReadiness({ + overviewApi = null, + contract = createIniPanelShellWorkflowOverviewContract(), +} = {}) { + const methodNames = Array.isArray(contract?.methodNames) ? contract.methodNames : []; + const missing = methodNames.filter((methodName) => typeof overviewApi?.[methodName] !== "function"); + const ready = missing.length === 0; + return { + apiName: "ini-panel-shell-workflow-overview-readiness", + readinessVersion: 1, + phase: ready ? "ready" : "blocked", + ready, + missing, + contract, + }; +} + export function createIniPanelShellSessionHandoffWorkflowDomReadiness({ rowDatasetPrefix = "handoffWorkflow", contract = createIniPanelShellSessionHandoffWorkflowDomContract({ rowDatasetPrefix }), @@ -1714,6 +1752,61 @@ export function mountIniPanelShellSessionHandoffWorkflow({ } } +export function mountIniPanelShellWorkflowOverviewEmbedding({ + overviewApi = null, + contract = createIniPanelShellWorkflowOverviewContract(), + mountOptions = {}, +} = {}) { + const readiness = createIniPanelShellWorkflowOverviewReadiness({ + overviewApi, + contract, + }); + if (!readiness.ready) { + return { + apiName: "ini-panel-shell-workflow-overview-embedding", + embeddingVersion: 1, + phase: "blocked", + ready: false, + pageHref: contract.pageHref, + contract, + readiness, + renderState: null, + mountResult: null, + error: null, + }; + } + + try { + const renderState = overviewApi.getWorkflowOverviewRenderState(); + const mountResult = overviewApi.mountWorkflowOverview(mountOptions); + return { + apiName: "ini-panel-shell-workflow-overview-embedding", + embeddingVersion: 1, + phase: mountResult?.phase ?? "blocked", + ready: mountResult?.ready === true, + pageHref: contract.pageHref, + contract, + readiness, + renderState, + mountResult, + error: null, + }; + } catch (error) { + return { + apiName: "ini-panel-shell-workflow-overview-embedding", + embeddingVersion: 1, + phase: "blocked", + ready: false, + pageHref: contract.pageHref, + contract, + readiness, + renderState: null, + mountResult: null, + error: error?.message ?? String(error), + }; + } +} + export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries()) { const shellIntegrationManifest = createIniPanelShellIntegrationManifest(entries); const shellIntegrationReadiness = createIniPanelShellIntegrationReadiness(shellIntegrationManifest); @@ -1800,6 +1893,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries shellSessionHandoffWorkflowDisplayViewModel, ); const shellSessionHandoffWorkflowDomContract = createIniPanelShellSessionHandoffWorkflowDomContract(); + const shellWorkflowOverviewContract = createIniPanelShellWorkflowOverviewContract(); return { pages: entries.map(({ id, href, title }) => ({ id, @@ -1832,6 +1926,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries shellSessionHandoffWorkflowDisplayViewModel, shellSessionHandoffWorkflowRenderState, shellSessionHandoffWorkflowDomContract, + shellWorkflowOverviewContract, launchApiSchema: createIniPanelLaunchApiSchema(), launchApiManifest: createIniPanelLaunchApiManifest(entries), isSupportedShellIntegrationManifest: isSupportedIniPanelShellIntegrationManifest, @@ -1867,6 +1962,9 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries createShellSessionHandoffWorkflowDomReadiness: createIniPanelShellSessionHandoffWorkflowDomReadiness, renderShellSessionHandoffWorkflowState: renderIniPanelShellSessionHandoffWorkflowState, mountShellSessionHandoffWorkflow: mountIniPanelShellSessionHandoffWorkflow, + createWorkflowOverviewContract: createIniPanelShellWorkflowOverviewContract, + createWorkflowOverviewReadiness: createIniPanelShellWorkflowOverviewReadiness, + mountWorkflowOverviewEmbedding: mountIniPanelShellWorkflowOverviewEmbedding, isSupportedShellSessionHandoffPackage: isSupportedIniPanelShellSessionHandoffPackage, controlPage: { browserApiSchema: createControlPageBrowserApiSchema(), diff --git a/wasm-port/runtime/ui/ini-panel/workflow-overview.html b/wasm-port/runtime/ui/ini-panel/workflow-overview.html index f98fc0f..facc163 100644 --- a/wasm-port/runtime/ui/ini-panel/workflow-overview.html +++ b/wasm-port/runtime/ui/ini-panel/workflow-overview.html @@ -87,6 +87,9 @@ createIniPanelShellSessionHandoffWorkflowDomContract, createIniPanelShellSessionHandoffWorkflowDomReadiness, createIniPanelShellSessionHandoffWorkflowRenderState, + createIniPanelShellWorkflowOverviewContract, + createIniPanelShellWorkflowOverviewReadiness, + mountIniPanelShellWorkflowOverviewEmbedding, renderIniPanelShellSessionHandoffWorkflowState, mountIniPanelShellSessionHandoffWorkflow, } from "./ui-shell.js"; @@ -118,6 +121,16 @@ }) ), createWorkflowOverviewRenderState: createIniPanelShellSessionHandoffWorkflowRenderState, + getWorkflowOverviewContract: () => createIniPanelShellWorkflowOverviewContract(), + getWorkflowOverviewReadinessFromApi: () => createIniPanelShellWorkflowOverviewReadiness({ + overviewApi: window.linuxCncIniPanelWorkflowOverviewApi, + }), + mountWorkflowOverviewEmbedding: (options) => ( + mountIniPanelShellWorkflowOverviewEmbedding({ + overviewApi: window.linuxCncIniPanelWorkflowOverviewApi, + ...(options ?? {}), + }) + ), }; diff --git a/wasm-port/tests/browser/ini_panel_launch_smoke.html b/wasm-port/tests/browser/ini_panel_launch_smoke.html index c6b5aa2..549db6e 100644 --- a/wasm-port/tests/browser/ini_panel_launch_smoke.html +++ b/wasm-port/tests/browser/ini_panel_launch_smoke.html @@ -23,9 +23,9 @@ } } - async function loadLaunchFrame() { + async function loadFrame(src) { const frame = document.createElement("iframe"); - frame.src = "../../runtime/ui/ini-panel/launch.html"; + frame.src = src; document.body.appendChild(frame); await new Promise((resolve, reject) => { frame.addEventListener("load", resolve, { once: true }); @@ -34,6 +34,10 @@ return frame.contentDocument; } + async function loadLaunchFrame() { + return loadFrame("../../runtime/ui/ini-panel/launch.html"); + } + try { const visibleEntries = getVisibleIniPanelEntries(); assertEqual(visibleEntries.length, 3, "launch visible entry length"); @@ -96,6 +100,9 @@ !launchApi?.getShellSessionHandoffPackageMountDisplayViewModel || !launchApi?.getShellSessionHandoffPackageMountRenderState || !launchApi?.renderShellSessionHandoffMountState || + !launchApi?.getWorkflowOverviewContract || + !launchApi?.getWorkflowOverviewReadiness || + !launchApi?.mountWorkflowOverviewEmbedding || !launchApi?.isSupportedShellSessionHandoffPackage || !launchApi?.getLauncherLinks || !launchApi?.getControlPageApiMethods @@ -158,6 +165,7 @@ const shellSessionHandoffPackageMountState = launchApi.getShellSessionHandoffPackageMountState(); const shellSessionHandoffPackageMountDisplayViewModel = launchApi.getShellSessionHandoffPackageMountDisplayViewModel(); const shellSessionHandoffPackageMountRenderState = launchApi.getShellSessionHandoffPackageMountRenderState(); + const workflowOverviewContract = launchApi.getWorkflowOverviewContract(); assertEqual( shellIntegrationSchema.manifestVersion, 1, @@ -403,6 +411,21 @@ "Blocked: session-load-state", "shell session handoff package mount render-state status", ); + assertEqual( + workflowOverviewContract.pageHref, + "./workflow-overview.html", + "workflow overview contract page", + ); + assertEqual( + workflowOverviewContract.apiName, + "linuxCncIniPanelWorkflowOverviewApi", + "workflow overview contract API name", + ); + assertEqual( + workflowOverviewContract.methodNames.includes("mountWorkflowOverview"), + true, + "workflow overview contract mount method", + ); assertEqual( shellSessionHandoffPackage.ready, true, @@ -598,6 +621,32 @@ createControlPageBrowserApiMethods().join(","), "launch API control-page browser methods", ); + const workflowOverviewDoc = await loadFrame("../../runtime/ui/ini-panel/workflow-overview.html"); + const workflowOverviewApi = workflowOverviewDoc.defaultView.linuxCncIniPanelWorkflowOverviewApi; + if ( + !workflowOverviewApi?.getWorkflowOverviewRenderState || + !workflowOverviewApi?.getWorkflowOverviewContract || + !workflowOverviewApi?.getWorkflowOverviewReadinessFromApi || + !workflowOverviewApi?.mountWorkflowOverviewEmbedding + ) { + throw new Error("workflow overview API namespace did not expose shell helpers"); + } + const workflowOverviewReadiness = launchApi.getWorkflowOverviewReadiness({ + overviewApi: workflowOverviewApi, + }); + const workflowOverviewEmbedding = launchApi.mountWorkflowOverviewEmbedding({ + overviewApi: workflowOverviewApi, + }); + assertEqual(workflowOverviewApi.getWorkflowOverviewContract().pageHref, "./workflow-overview.html", "workflow overview page contract"); + assertEqual(workflowOverviewReadiness.ready, true, "workflow overview readiness"); + assertEqual(workflowOverviewReadiness.missing.join(","), "", "workflow overview readiness missing"); + assertEqual(workflowOverviewApi.getWorkflowOverviewReadinessFromApi().ready, true, "workflow overview self readiness"); + assertEqual(workflowOverviewEmbedding.apiName, "ini-panel-shell-workflow-overview-embedding", "workflow overview embedding API name"); + assertEqual(workflowOverviewEmbedding.pageHref, "./workflow-overview.html", "workflow overview embedding page"); + assertEqual(workflowOverviewEmbedding.ready, false, "workflow overview embedding default readiness"); + assertEqual(workflowOverviewEmbedding.renderState.dataset.handoffScope, "workflow", "workflow overview embedding scope"); + assertEqual(workflowOverviewEmbedding.mountResult.renderResult.rowCount, 5, "workflow overview embedding rows"); + assertEqual(workflowOverviewEmbedding.error, null, "workflow overview embedding error"); status.textContent = "browser_ini_launch_smoke=ok"; console.log("browser_ini_launch_smoke=ok"); } catch (error) { diff --git a/wasm-port/tests/browser/ini_panel_shell_integration_workflow_smoke.html b/wasm-port/tests/browser/ini_panel_shell_integration_workflow_smoke.html index c1a861e..ae50596 100644 --- a/wasm-port/tests/browser/ini_panel_shell_integration_workflow_smoke.html +++ b/wasm-port/tests/browser/ini_panel_shell_integration_workflow_smoke.html @@ -102,12 +102,16 @@ TOOL_TABLE = browser-shell-tool.tbl !launchApi?.getShellSessionHandoffWorkflowDomReadiness || !launchApi?.renderShellSessionHandoffWorkflowState || !launchApi?.mountShellSessionHandoffWorkflow || + !launchApi?.getWorkflowOverviewContract || + !launchApi?.getWorkflowOverviewReadiness || + !launchApi?.mountWorkflowOverviewEmbedding || !launchApi?.isSupportedShellSessionHandoffPackage ) { throw new Error("launch API namespace did not expose shell integration helpers"); } const integrationManifest = launchApi.getShellIntegrationManifest(); + const workflowOverviewContract = launchApi.getWorkflowOverviewContract(); const readiness = launchApi.getShellIntegrationReadiness(); const handoffSummarySchema = launchApi.getShellSessionHandoffSummarySchema(); const handoffSummary = launchApi.getShellSessionHandoffSummary(); @@ -264,12 +268,32 @@ TOOL_TABLE = browser-shell-tool.tbl true, "shell integration control-page compatibility", ); + assertEqual(workflowOverviewContract.pageHref, "./workflow-overview.html", "shell workflow overview contract page"); + assertEqual( + workflowOverviewContract.methodNames.includes("getWorkflowOverviewRenderState"), + true, + "shell workflow overview contract render method", + ); const controlTarget = integrationManifest.launchApiManifest.targetPages.find( (page) => page.entryId === "control-view", ); assertEqual(controlTarget.href, "./control-page.html", "shell integration control target"); assertEqual(handoffSummary.targetPage.href, controlTarget.href, "shell handoff summary target"); + const workflowOverviewDoc = await loadFrame(`../../runtime/ui/ini-panel/${workflowOverviewContract.pageHref.slice(2)}`); + const workflowOverviewApi = workflowOverviewDoc.defaultView.linuxCncIniPanelWorkflowOverviewApi; + const workflowOverviewReadiness = launchApi.getWorkflowOverviewReadiness({ + overviewApi: workflowOverviewApi, + }); + const workflowOverviewEmbedding = launchApi.mountWorkflowOverviewEmbedding({ + overviewApi: workflowOverviewApi, + }); + assertEqual(workflowOverviewReadiness.ready, true, "shell workflow overview iframe readiness"); + assertEqual(workflowOverviewReadiness.missing.join(","), "", "shell workflow overview iframe missing methods"); + assertEqual(workflowOverviewEmbedding.apiName, "ini-panel-shell-workflow-overview-embedding", "shell workflow overview embedding API"); + assertEqual(workflowOverviewEmbedding.renderState.dataset.handoffScope, "workflow", "shell workflow overview embedding scope"); + assertEqual(workflowOverviewEmbedding.mountResult.renderResult.rowCount, 5, "shell workflow overview embedding rows"); + assertEqual(workflowOverviewEmbedding.error, null, "shell workflow overview embedding error"); const controlDoc = await loadFrame(`../../runtime/ui/ini-panel/${controlTarget.href.slice(2)}`); const controlPageApi = controlDoc.defaultView.linuxCncIniPanelControlPageApi; diff --git a/wasm-port/tests/ui/node/verify_ini_panel_entry_docs.mjs b/wasm-port/tests/ui/node/verify_ini_panel_entry_docs.mjs index 572618e..9945ee5 100644 --- a/wasm-port/tests/ui/node/verify_ini_panel_entry_docs.mjs +++ b/wasm-port/tests/ui/node/verify_ini_panel_entry_docs.mjs @@ -37,6 +37,9 @@ import { createIniPanelShellSessionHandoffWorkflowRenderState, createIniPanelShellSessionHandoffWorkflowDomContract, createIniPanelShellSessionHandoffWorkflowDomReadiness, + createIniPanelShellWorkflowOverviewContract, + createIniPanelShellWorkflowOverviewReadiness, + mountIniPanelShellWorkflowOverviewEmbedding, renderIniPanelShellSessionHandoffWorkflowState, mountIniPanelShellSessionHandoffWorkflow, renderIniPanelShellSessionHandoffMountState, @@ -115,6 +118,9 @@ const requiredShellExports = [ "createIniPanelShellSessionHandoffWorkflowRenderState", "createIniPanelShellSessionHandoffWorkflowDomContract", "createIniPanelShellSessionHandoffWorkflowDomReadiness", + "createIniPanelShellWorkflowOverviewContract", + "createIniPanelShellWorkflowOverviewReadiness", + "mountIniPanelShellWorkflowOverviewEmbedding", "renderIniPanelShellSessionHandoffWorkflowState", "mountIniPanelShellSessionHandoffWorkflow", "renderIniPanelShellSessionHandoffMountState", diff --git a/wasm-port/tests/ui/node/verify_ini_panel_launch_api_manifest.mjs b/wasm-port/tests/ui/node/verify_ini_panel_launch_api_manifest.mjs index e7b8adc..5f47864 100644 --- a/wasm-port/tests/ui/node/verify_ini_panel_launch_api_manifest.mjs +++ b/wasm-port/tests/ui/node/verify_ini_panel_launch_api_manifest.mjs @@ -76,6 +76,9 @@ assert.deepEqual(manifest, { "getShellSessionHandoffWorkflowDomReadiness", "renderShellSessionHandoffWorkflowState", "mountShellSessionHandoffWorkflow", + "getWorkflowOverviewContract", + "getWorkflowOverviewReadiness", + "mountWorkflowOverviewEmbedding", "isSupportedShellSessionHandoffPackage", "getLauncherLinks", "getControlPageApiMethods", @@ -216,6 +219,9 @@ assert.match(launchText, /\bgetShellSessionHandoffWorkflowDomContract\b/); assert.match(launchText, /\bgetShellSessionHandoffWorkflowDomReadiness\b/); assert.match(launchText, /\brenderShellSessionHandoffWorkflowState\b/); assert.match(launchText, /\bmountShellSessionHandoffWorkflow\b/); +assert.match(launchText, /\bgetWorkflowOverviewContract\b/); +assert.match(launchText, /\bgetWorkflowOverviewReadiness\b/); +assert.match(launchText, /\bmountWorkflowOverviewEmbedding\b/); assert.match(launchText, /\bisSupportedShellSessionHandoffPackage\b/); assert.match(launchText, /\bdata-handoff-workflow\b/); assert.match(launchText, /\bdata-handoff-workflow-status\b/); diff --git a/wasm-port/tests/ui/node/verify_ini_panel_shell_integration_manifest.mjs b/wasm-port/tests/ui/node/verify_ini_panel_shell_integration_manifest.mjs index 47c6b26..6ae7eb8 100644 --- a/wasm-port/tests/ui/node/verify_ini_panel_shell_integration_manifest.mjs +++ b/wasm-port/tests/ui/node/verify_ini_panel_shell_integration_manifest.mjs @@ -33,6 +33,9 @@ import { createIniPanelShellSessionHandoffWorkflowRenderState, createIniPanelShellSessionHandoffWorkflowDomContract, createIniPanelShellSessionHandoffWorkflowDomReadiness, + createIniPanelShellWorkflowOverviewContract, + createIniPanelShellWorkflowOverviewReadiness, + mountIniPanelShellWorkflowOverviewEmbedding, renderIniPanelShellSessionHandoffWorkflowState, mountIniPanelShellSessionHandoffWorkflow, createIniPanelShellSessionHandoffPackageReport, @@ -161,7 +164,7 @@ assert.deepEqual(readiness, { counts: { pages: 3, launcherLinks: 3, - launchMethods: 39, + launchMethods: 42, controlPageMethods: 11, persistenceCapabilities: 3, }, @@ -223,7 +226,7 @@ assert.deepEqual(handoffSummary, { counts: { pages: 3, launcherLinks: 3, - launchMethods: 39, + launchMethods: 42, controlPageMethods: 11, persistenceCapabilities: 3, }, @@ -747,6 +750,39 @@ assert.equal( mountIniPanelShellSessionHandoffWorkflow().phase, "blocked", ); +assert.deepEqual(createIniPanelShellWorkflowOverviewContract(), { + pageHref: "./workflow-overview.html", + entryId: "workflow-overview", + apiName: "linuxCncIniPanelWorkflowOverviewApi", + methodNames: [ + "getWorkflowOverviewRenderState", + "getWorkflowOverviewDisplayViewModel", + "getWorkflowOverviewSummary", + "getWorkflowOverviewDomContract", + "getWorkflowOverviewDomReadiness", + "renderWorkflowOverview", + "mountWorkflowOverview", + "createWorkflowOverviewRenderState", + ], +}); +assert.equal(createIniPanelShellWorkflowOverviewReadiness().ready, false); +assert.deepEqual( + createIniPanelShellWorkflowOverviewReadiness({ + overviewApi: { + getWorkflowOverviewRenderState: () => handoffPackageRenderState, + }, + }).missing, + [ + "getWorkflowOverviewDisplayViewModel", + "getWorkflowOverviewSummary", + "getWorkflowOverviewDomContract", + "getWorkflowOverviewDomReadiness", + "renderWorkflowOverview", + "mountWorkflowOverview", + "createWorkflowOverviewRenderState", + ], +); +assert.equal(mountIniPanelShellWorkflowOverviewEmbedding().phase, "blocked"); assert.deepEqual( createIniPanelShellSessionHandoffPackageMountState({ handoffPackage, @@ -1158,7 +1194,7 @@ assert.deepEqual(createIniPanelShellIntegrationReadiness(blockedManifest), { counts: { pages: 3, launcherLinks: 3, - launchMethods: 39, + launchMethods: 42, controlPageMethods: 11, persistenceCapabilities: 3, }, 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 index ac78f26..80abdb4 100644 --- a/wasm-port/tests/ui/node/verify_ini_panel_ui_shell.mjs +++ b/wasm-port/tests/ui/node/verify_ini_panel_ui_shell.mjs @@ -33,6 +33,9 @@ import { createIniPanelShellSessionHandoffWorkflowRenderState, createIniPanelShellSessionHandoffWorkflowDomContract, createIniPanelShellSessionHandoffWorkflowDomReadiness, + createIniPanelShellWorkflowOverviewContract, + createIniPanelShellWorkflowOverviewReadiness, + mountIniPanelShellWorkflowOverviewEmbedding, renderIniPanelShellSessionHandoffWorkflowState, mountIniPanelShellSessionHandoffWorkflow, renderIniPanelShellSessionHandoffMountState, @@ -116,6 +119,9 @@ assert.equal(typeof createIniPanelShellSessionHandoffWorkflowDisplayViewModel, " assert.equal(typeof createIniPanelShellSessionHandoffWorkflowRenderState, "function"); assert.equal(typeof createIniPanelShellSessionHandoffWorkflowDomContract, "function"); assert.equal(typeof createIniPanelShellSessionHandoffWorkflowDomReadiness, "function"); +assert.equal(typeof createIniPanelShellWorkflowOverviewContract, "function"); +assert.equal(typeof createIniPanelShellWorkflowOverviewReadiness, "function"); +assert.equal(typeof mountIniPanelShellWorkflowOverviewEmbedding, "function"); assert.equal(typeof renderIniPanelShellSessionHandoffWorkflowState, "function"); assert.equal(typeof mountIniPanelShellSessionHandoffWorkflow, "function"); assert.equal(typeof renderIniPanelShellSessionHandoffMountState, "function"); @@ -621,6 +627,21 @@ assert.deepEqual(shellViewModel.shellSessionHandoffMountDomContract, { }, renderResultFields: ["rendered", "statusLine", "rowCount", "rowIds", "dataset"], }); +assert.deepEqual(shellViewModel.shellWorkflowOverviewContract, { + pageHref: "./workflow-overview.html", + entryId: "workflow-overview", + apiName: "linuxCncIniPanelWorkflowOverviewApi", + methodNames: [ + "getWorkflowOverviewRenderState", + "getWorkflowOverviewDisplayViewModel", + "getWorkflowOverviewSummary", + "getWorkflowOverviewDomContract", + "getWorkflowOverviewDomReadiness", + "renderWorkflowOverview", + "mountWorkflowOverview", + "createWorkflowOverviewRenderState", + ], +}); assert.equal( createIniPanelShellSessionHandoffPackageMountState({ handoffPackage: shellViewModel.shellSessionHandoffPackage, @@ -766,6 +787,9 @@ assert.equal( shellViewModel.mountShellSessionHandoffWorkflow, mountIniPanelShellSessionHandoffWorkflow, ); +assert.equal(shellViewModel.createWorkflowOverviewContract, createIniPanelShellWorkflowOverviewContract); +assert.equal(shellViewModel.createWorkflowOverviewReadiness, createIniPanelShellWorkflowOverviewReadiness); +assert.equal(shellViewModel.mountWorkflowOverviewEmbedding, mountIniPanelShellWorkflowOverviewEmbedding); assert.equal(shellViewModel.createShellSessionHandoffPackageReport, createIniPanelShellSessionHandoffPackageReport); assert.equal(shellViewModel.createShellSessionHandoffPackageSchema, createIniPanelShellSessionHandoffPackageSchema); assert.equal(shellViewModel.isSupportedShellSessionHandoffPackage, isSupportedIniPanelShellSessionHandoffPackage); @@ -1105,6 +1129,68 @@ assert.equal(workflowDomMountResult.phase, "blocked"); assert.equal(workflowDomMountResult.ready, false); assert.equal(workflowDomMountResult.renderResult.rowCount, 5); assert.equal(workflowDomMountResult.renderResult.dataset.handoffScope, "workflow"); +assert.deepEqual(createIniPanelShellWorkflowOverviewContract(), shellViewModel.shellWorkflowOverviewContract); +assert.deepEqual(createIniPanelShellWorkflowOverviewReadiness(), { + apiName: "ini-panel-shell-workflow-overview-readiness", + readinessVersion: 1, + phase: "blocked", + ready: false, + missing: shellViewModel.shellWorkflowOverviewContract.methodNames, + contract: shellViewModel.shellWorkflowOverviewContract, +}); +const workflowOverviewApi = { + getWorkflowOverviewRenderState: () => workflowRenderState, + getWorkflowOverviewDisplayViewModel: () => workflowDisplayViewModel, + getWorkflowOverviewSummary: () => workflowSummaryResult, + getWorkflowOverviewDomContract: createIniPanelShellSessionHandoffWorkflowDomContract, + getWorkflowOverviewDomReadiness: createIniPanelShellSessionHandoffWorkflowDomReadiness, + renderWorkflowOverview: renderIniPanelShellSessionHandoffWorkflowState, + mountWorkflowOverview: (options) => mountIniPanelShellSessionHandoffWorkflow({ + renderState: workflowRenderState, + ...options, + }), + createWorkflowOverviewRenderState: createIniPanelShellSessionHandoffWorkflowRenderState, +}; +assert.deepEqual(createIniPanelShellWorkflowOverviewReadiness({ + overviewApi: workflowOverviewApi, +}), { + apiName: "ini-panel-shell-workflow-overview-readiness", + readinessVersion: 1, + phase: "ready", + ready: true, + missing: [], + contract: shellViewModel.shellWorkflowOverviewContract, +}); +const workflowOverviewEmbedding = mountIniPanelShellWorkflowOverviewEmbedding({ + overviewApi: workflowOverviewApi, + mountOptions: { + documentRef: mountDocument, + mountNode, + statusNode: mountStatusNode, + rowsNode: mountRowsNode, + }, +}); +assert.equal(workflowOverviewEmbedding.apiName, "ini-panel-shell-workflow-overview-embedding"); +assert.equal(workflowOverviewEmbedding.embeddingVersion, 1); +assert.equal(workflowOverviewEmbedding.ready, false); +assert.equal(workflowOverviewEmbedding.renderState.statusLine, "Blocked: mount:blocked"); +assert.equal(workflowOverviewEmbedding.mountResult.renderResult.rowCount, 5); +assert.equal(workflowOverviewEmbedding.error, null); +assert.deepEqual( + mountIniPanelShellWorkflowOverviewEmbedding({ overviewApi: null }).readiness.missing, + shellViewModel.shellWorkflowOverviewContract.methodNames, +); +assert.equal( + mountIniPanelShellWorkflowOverviewEmbedding({ + overviewApi: { + ...workflowOverviewApi, + mountWorkflowOverview: () => { + throw new Error("mount failed"); + }, + }, + }).error, + "mount failed", +); assert.equal( mountIniPanelShellSessionHandoffWorkflow({ documentRef: mountDocument }).renderResult, null,