推进 INI 面板 shell handoff render-state

This commit is contained in:
2026-06-15 09:51:18 +08:00
parent 5c951ab9bc
commit b1f23e6641
10 changed files with 300 additions and 11 deletions

View File

@@ -507,3 +507,99 @@ host_wasm_opfs_browser_smokes=ok
继续推进 browser/UI workflow。下一批建议在 launch 页面或等价外部 shell view 中增加一个只读 继续推进 browser/UI workflow。下一批建议在 launch 页面或等价外部 shell view 中增加一个只读
snapshot consumer helper把 snapshot 直接压成 launch-side render state并对 blocked snapshot snapshot consumer helper把 snapshot 直接压成 launch-side render state并对 blocked snapshot
做 focused browser smoke仍保持只读不新增控制按钮不解析 G-code。 做 focused browser smoke仍保持只读不新增控制按钮不解析 G-code。
四、2026-06-15 继续执行记录INI panel shell handoff render-state consumer
本轮按“第一原则:加快实质性推进”继续推进 browser/UI workflow新增只读 shell handoff
render-state consumer把 handoff snapshot 压成 launch 页面和外部 shell 可直接渲染的稳定状态。
完成内容:
- `ui-shell.js` 新增 `createIniPanelShellSessionHandoffRenderState()`
- render-state 输出:
- `apiName: "ini-panel-shell-session-handoff-render-state"`
- `renderStateVersion: 1`
- `phase`
- `ready`
- `title`
- `statusText`
- `detailText`
- `statusLine`
- `rows`
- `dataset.handoffPhase`
- `dataset.handoffReady`
- `createIniPanelShellViewModel()` 新增:
- `shellSessionHandoffRenderState`
- `createShellSessionHandoffRenderState`
- `createIniPanelLaunchApiManifest().methods` 新增
`getShellSessionHandoffRenderState`
- `launch.html` 改为从 render-state 渲染 `[data-handoff-status]`、
`[data-handoff-rows]` 和 `[data-handoff-shell]` 的 phase/readiness dataset
- `launch.html` 的 `window.linuxCncIniPanelLaunchApi` 新增真实 browser 入口
`getShellSessionHandoffRenderState()`
- `ini_panel_launch_smoke.html` 校验真实 launch iframe
- render-state version 为 1
- render-state `ready === true`
- render-state status line 为 `Ready: No blocking reasons`
- render-state rows 与 display view-model rows 一致;
- DOM `[data-handoff-shell]` 输出 `handoffPhase=ready` 与 `handoffReady=true`
- `ini_panel_shell_integration_workflow_smoke.html` 校验外部 shell workflow 能读取
render-state并确认 status line 与 display rows 一致;
- `verify_ini_panel_shell_integration_manifest.mjs` 覆盖:
- ready render-state 完整 shape
- blocked snapshot render-state 的 `Blocked: summaryVersion` focused case
- `verify_ini_panel_ui_shell.mjs` 覆盖 shell view-model 的 render-state 聚合关系;
- `verify_ini_panel_launch_api_manifest.mjs`、`verify_ini_panel_entry_docs.mjs` 与
`docs/panel-entry.md` 同步记录和校验新 helper/API/DOM dataset
- 未新增控制按钮;
- 未解析 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_shell_integration_manifest.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_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_shell_integration_manifest_node_smoke=ok
ini_panel_launch_api_manifest_node_smoke=ok
ini_panel_ui_shell_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_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
```
下一步建议:
继续推进 SDK/API surface 与 browser/UI workflow 的交界。下一批建议新增一个只读
`createIniPanelShellSessionHandoffActionPlan()` 或等价 helper把 render-state 的 ready/blocked
状态转成外部 shell 可执行的下一步计划(例如 target page、required methods、blocked reasons、
display rows但仍只描述流程不新增控制按钮不解析 G-code。

View File

@@ -23,6 +23,7 @@ import {
createIniPanelShellIntegrationWorkflowPlan, createIniPanelShellIntegrationWorkflowPlan,
createIniPanelShellSessionHandoffCompatibilityReport, createIniPanelShellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffDisplayViewModel, createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffRenderState,
createIniPanelShellSessionHandoffSnapshot, createIniPanelShellSessionHandoffSnapshot,
createIniPanelShellSessionHandoffSummary, createIniPanelShellSessionHandoffSummary,
createIniPanelShellSessionHandoffSummarySchema, createIniPanelShellSessionHandoffSummarySchema,
@@ -153,12 +154,17 @@ handoff summary.
Use `createIniPanelShellSessionHandoffDisplayViewModel()` or Use `createIniPanelShellSessionHandoffDisplayViewModel()` or
`linuxCncIniPanelLaunchApi.getShellSessionHandoffDisplayViewModel()` when an `linuxCncIniPanelLaunchApi.getShellSessionHandoffDisplayViewModel()` when an
outer shell needs the same diagnostics as stable read-only label/value rows for outer shell needs the same diagnostics as stable read-only label/value rows for
DOM display. The launch page renders those rows in `[data-handoff-status]` and DOM display.
`[data-handoff-rows]` without adding control actions.
Use `createIniPanelShellSessionHandoffSnapshot()` or Use `createIniPanelShellSessionHandoffSnapshot()` or
`linuxCncIniPanelLaunchApi.getShellSessionHandoffSnapshot()` when an outer shell `linuxCncIniPanelLaunchApi.getShellSessionHandoffSnapshot()` when an outer shell
needs one read-only API read that includes readiness, handoff summary, needs one read-only API read that includes readiness, handoff summary,
compatibility report, and display view-model together. compatibility report, and display view-model together.
Use `createIniPanelShellSessionHandoffRenderState()` or
`linuxCncIniPanelLaunchApi.getShellSessionHandoffRenderState()` when an outer
shell needs the snapshot compressed into launch-side DOM state with a status
line, stable rows, and `[data-handoff-shell]` phase/readiness flags. The launch
page renders `[data-handoff-status]` and `[data-handoff-rows]` from this helper
without adding control actions.
The browser workflow smoke The browser workflow smoke
`tests/browser/ini_panel_shell_integration_workflow_smoke.html` verifies the `tests/browser/ini_panel_shell_integration_workflow_smoke.html` verifies the
same external shell handoff: read integration manifest, pass readiness gate, same external shell handoff: read integration manifest, pass readiness gate,

View File

@@ -91,7 +91,7 @@
<a data-entry-id="edit-run" href="./index.html">Open edit and run panel</a> <a data-entry-id="edit-run" href="./index.html">Open edit and run panel</a>
<a data-entry-id="control-view" href="./control-page.html">Open read-only control view</a> <a data-entry-id="control-view" href="./control-page.html">Open read-only control view</a>
</div> </div>
<section class="handoff-status" aria-label="Shell handoff compatibility"> <section class="handoff-status" aria-label="Shell handoff compatibility" data-handoff-shell>
<p data-handoff-status>Checking shell handoff compatibility.</p> <p data-handoff-status>Checking shell handoff compatibility.</p>
<dl data-handoff-rows></dl> <dl data-handoff-rows></dl>
</section> </section>
@@ -114,10 +114,13 @@
link.textContent = linkModel.label; link.textContent = linkModel.label;
link.href = linkModel.href; link.href = linkModel.href;
} }
const handoffDisplay = shellViewModel.shellSessionHandoffDisplayViewModel; const handoffRenderState = shellViewModel.shellSessionHandoffRenderState;
document.querySelector("[data-handoff-status]").textContent = `${handoffDisplay.statusText}: ${handoffDisplay.detailText}`; const handoffShell = document.querySelector("[data-handoff-shell]");
handoffShell.dataset.handoffPhase = handoffRenderState.dataset.handoffPhase;
handoffShell.dataset.handoffReady = handoffRenderState.dataset.handoffReady;
document.querySelector("[data-handoff-status]").textContent = handoffRenderState.statusLine;
const handoffRows = document.querySelector("[data-handoff-rows]"); const handoffRows = document.querySelector("[data-handoff-rows]");
for (const row of handoffDisplay.rows) { for (const row of handoffRenderState.rows) {
const term = document.createElement("dt"); const term = document.createElement("dt");
term.dataset.handoffRow = row.id; term.dataset.handoffRow = row.id;
term.textContent = row.label; term.textContent = row.label;
@@ -140,6 +143,7 @@
getShellSessionHandoffCompatibilityReport: () => shellViewModel.shellSessionHandoffCompatibilityReport, getShellSessionHandoffCompatibilityReport: () => shellViewModel.shellSessionHandoffCompatibilityReport,
getShellSessionHandoffDisplayViewModel: () => shellViewModel.shellSessionHandoffDisplayViewModel, getShellSessionHandoffDisplayViewModel: () => shellViewModel.shellSessionHandoffDisplayViewModel,
getShellSessionHandoffSnapshot: () => shellViewModel.shellSessionHandoffSnapshot, getShellSessionHandoffSnapshot: () => shellViewModel.shellSessionHandoffSnapshot,
getShellSessionHandoffRenderState: () => shellViewModel.shellSessionHandoffRenderState,
getLauncherLinks: () => shellViewModel.launcherLinks, getLauncherLinks: () => shellViewModel.launcherLinks,
getControlPageApiMethods: () => shellViewModel.controlPage.browserApiMethods, getControlPageApiMethods: () => shellViewModel.controlPage.browserApiMethods,
}; };

View File

@@ -132,6 +132,7 @@ export function createIniPanelLaunchApiManifest(entries = getVisibleIniPanelEntr
"getShellSessionHandoffCompatibilityReport", "getShellSessionHandoffCompatibilityReport",
"getShellSessionHandoffDisplayViewModel", "getShellSessionHandoffDisplayViewModel",
"getShellSessionHandoffSnapshot", "getShellSessionHandoffSnapshot",
"getShellSessionHandoffRenderState",
"getLauncherLinks", "getLauncherLinks",
"getControlPageApiMethods", "getControlPageApiMethods",
], ],
@@ -553,6 +554,40 @@ export function createIniPanelShellSessionHandoffSnapshot({
}; };
} }
export function createIniPanelShellSessionHandoffRenderState(
snapshot = createIniPanelShellSessionHandoffSnapshot(),
) {
const displayViewModel = snapshot?.displayViewModel && typeof snapshot.displayViewModel === "object"
? snapshot.displayViewModel
: createIniPanelShellSessionHandoffDisplayViewModel(snapshot?.compatibilityReport);
const rows = Array.isArray(displayViewModel.rows)
? displayViewModel.rows.map(({ id, label, value }) => ({
id,
label,
value: value == null ? "" : String(value),
}))
: [];
const ready = snapshot?.ready === true && displayViewModel.phase === "ready";
const statusText = displayViewModel.statusText ?? (ready ? "Ready" : "Blocked");
const detailText = displayViewModel.detailText ?? "No blocking reasons";
return {
apiName: "ini-panel-shell-session-handoff-render-state",
renderStateVersion: 1,
phase: ready ? "ready" : "blocked",
ready,
title: displayViewModel.title ?? "Shell handoff compatibility",
statusText,
detailText,
statusLine: `${statusText}: ${detailText}`,
rows,
dataset: {
handoffPhase: ready ? "ready" : "blocked",
handoffReady: ready ? "true" : "false",
},
};
}
export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries()) { export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries()) {
const shellIntegrationManifest = createIniPanelShellIntegrationManifest(entries); const shellIntegrationManifest = createIniPanelShellIntegrationManifest(entries);
const shellIntegrationReadiness = createIniPanelShellIntegrationReadiness(shellIntegrationManifest); const shellIntegrationReadiness = createIniPanelShellIntegrationReadiness(shellIntegrationManifest);
@@ -577,6 +612,9 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
compatibilityReport: shellSessionHandoffCompatibilityReport, compatibilityReport: shellSessionHandoffCompatibilityReport,
displayViewModel: shellSessionHandoffDisplayViewModel, displayViewModel: shellSessionHandoffDisplayViewModel,
}); });
const shellSessionHandoffRenderState = createIniPanelShellSessionHandoffRenderState(
shellSessionHandoffSnapshot,
);
return { return {
pages: entries.map(({ id, href, title }) => ({ pages: entries.map(({ id, href, title }) => ({
id, id,
@@ -593,6 +631,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
shellSessionHandoffCompatibilityReport, shellSessionHandoffCompatibilityReport,
shellSessionHandoffDisplayViewModel, shellSessionHandoffDisplayViewModel,
shellSessionHandoffSnapshot, shellSessionHandoffSnapshot,
shellSessionHandoffRenderState,
launchApiSchema: createIniPanelLaunchApiSchema(), launchApiSchema: createIniPanelLaunchApiSchema(),
launchApiManifest: createIniPanelLaunchApiManifest(entries), launchApiManifest: createIniPanelLaunchApiManifest(entries),
isSupportedShellIntegrationManifest: isSupportedIniPanelShellIntegrationManifest, isSupportedShellIntegrationManifest: isSupportedIniPanelShellIntegrationManifest,
@@ -604,6 +643,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
createShellSessionHandoffCompatibilityReport: createIniPanelShellSessionHandoffCompatibilityReport, createShellSessionHandoffCompatibilityReport: createIniPanelShellSessionHandoffCompatibilityReport,
createShellSessionHandoffDisplayViewModel: createIniPanelShellSessionHandoffDisplayViewModel, createShellSessionHandoffDisplayViewModel: createIniPanelShellSessionHandoffDisplayViewModel,
createShellSessionHandoffSnapshot: createIniPanelShellSessionHandoffSnapshot, createShellSessionHandoffSnapshot: createIniPanelShellSessionHandoffSnapshot,
createShellSessionHandoffRenderState: createIniPanelShellSessionHandoffRenderState,
controlPage: { controlPage: {
browserApiSchema: createControlPageBrowserApiSchema(), browserApiSchema: createControlPageBrowserApiSchema(),
browserApiManifest: createControlPageBrowserApiManifest(), browserApiManifest: createControlPageBrowserApiManifest(),

View File

@@ -79,6 +79,7 @@
!launchApi?.getShellSessionHandoffCompatibilityReport || !launchApi?.getShellSessionHandoffCompatibilityReport ||
!launchApi?.getShellSessionHandoffDisplayViewModel || !launchApi?.getShellSessionHandoffDisplayViewModel ||
!launchApi?.getShellSessionHandoffSnapshot || !launchApi?.getShellSessionHandoffSnapshot ||
!launchApi?.getShellSessionHandoffRenderState ||
!launchApi?.getLauncherLinks || !launchApi?.getLauncherLinks ||
!launchApi?.getControlPageApiMethods !launchApi?.getControlPageApiMethods
) { ) {
@@ -118,7 +119,7 @@
); );
assertEqual( assertEqual(
launchApiManifest.methods.join(","), launchApiManifest.methods.join(","),
"isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getShellIntegrationReadiness,getShellSessionHandoffSummarySchema,getShellSessionHandoffSummary,isSupportedShellSessionHandoffSummary,getShellSessionHandoffCompatibilityReport,getShellSessionHandoffDisplayViewModel,getShellSessionHandoffSnapshot,getLauncherLinks,getControlPageApiMethods", "isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getShellIntegrationReadiness,getShellSessionHandoffSummarySchema,getShellSessionHandoffSummary,isSupportedShellSessionHandoffSummary,getShellSessionHandoffCompatibilityReport,getShellSessionHandoffDisplayViewModel,getShellSessionHandoffSnapshot,getShellSessionHandoffRenderState,getLauncherLinks,getControlPageApiMethods",
"launch API manifest methods", "launch API manifest methods",
); );
const shellIntegrationSchema = launchApi.getShellIntegrationSchema(); const shellIntegrationSchema = launchApi.getShellIntegrationSchema();
@@ -129,6 +130,7 @@
const shellSessionHandoffCompatibilityReport = launchApi.getShellSessionHandoffCompatibilityReport(); const shellSessionHandoffCompatibilityReport = launchApi.getShellSessionHandoffCompatibilityReport();
const shellSessionHandoffDisplayViewModel = launchApi.getShellSessionHandoffDisplayViewModel(); const shellSessionHandoffDisplayViewModel = launchApi.getShellSessionHandoffDisplayViewModel();
const shellSessionHandoffSnapshot = launchApi.getShellSessionHandoffSnapshot(); const shellSessionHandoffSnapshot = launchApi.getShellSessionHandoffSnapshot();
const shellSessionHandoffRenderState = launchApi.getShellSessionHandoffRenderState();
assertEqual( assertEqual(
shellIntegrationSchema.manifestVersion, shellIntegrationSchema.manifestVersion,
1, 1,
@@ -224,6 +226,21 @@
true, true,
"shell session handoff snapshot readiness", "shell session handoff snapshot readiness",
); );
assertEqual(
shellSessionHandoffRenderState.renderStateVersion,
1,
"shell session handoff render-state version",
);
assertEqual(
shellSessionHandoffRenderState.ready,
true,
"shell session handoff render-state readiness",
);
assertEqual(
shellSessionHandoffRenderState.statusLine,
"Ready: No blocking reasons",
"shell session handoff render-state status",
);
assertEqual( assertEqual(
JSON.stringify(shellSessionHandoffSnapshot.readiness), JSON.stringify(shellSessionHandoffSnapshot.readiness),
JSON.stringify(shellIntegrationReadiness), JSON.stringify(shellIntegrationReadiness),
@@ -239,11 +256,26 @@
JSON.stringify(shellSessionHandoffDisplayViewModel), JSON.stringify(shellSessionHandoffDisplayViewModel),
"shell session handoff snapshot display object", "shell session handoff snapshot display object",
); );
assertEqual(
JSON.stringify(shellSessionHandoffRenderState.rows),
JSON.stringify(shellSessionHandoffDisplayViewModel.rows),
"shell session handoff render-state rows",
);
assertEqual( assertEqual(
launchDoc.querySelector("[data-handoff-status]").textContent, launchDoc.querySelector("[data-handoff-status]").textContent,
"Ready: No blocking reasons", "Ready: No blocking reasons",
"shell session handoff DOM status", "shell session handoff DOM status",
); );
assertEqual(
launchDoc.querySelector("[data-handoff-shell]").dataset.handoffPhase,
"ready",
"shell session handoff DOM phase",
);
assertEqual(
launchDoc.querySelector("[data-handoff-shell]").dataset.handoffReady,
"true",
"shell session handoff DOM ready",
);
assertEqual( assertEqual(
launchDoc.querySelector('[data-handoff-value="missing-fields"]').textContent, launchDoc.querySelector('[data-handoff-value="missing-fields"]').textContent,
"none", "none",

View File

@@ -69,7 +69,8 @@ TOOL_TABLE = browser-shell-tool.tbl
!launchApi?.isSupportedShellSessionHandoffSummary || !launchApi?.isSupportedShellSessionHandoffSummary ||
!launchApi?.getShellSessionHandoffCompatibilityReport || !launchApi?.getShellSessionHandoffCompatibilityReport ||
!launchApi?.getShellSessionHandoffDisplayViewModel || !launchApi?.getShellSessionHandoffDisplayViewModel ||
!launchApi?.getShellSessionHandoffSnapshot !launchApi?.getShellSessionHandoffSnapshot ||
!launchApi?.getShellSessionHandoffRenderState
) { ) {
throw new Error("launch API namespace did not expose shell integration helpers"); throw new Error("launch API namespace did not expose shell integration helpers");
} }
@@ -81,6 +82,7 @@ TOOL_TABLE = browser-shell-tool.tbl
const compatibilityReport = launchApi.getShellSessionHandoffCompatibilityReport(); const compatibilityReport = launchApi.getShellSessionHandoffCompatibilityReport();
const handoffDisplay = launchApi.getShellSessionHandoffDisplayViewModel(); const handoffDisplay = launchApi.getShellSessionHandoffDisplayViewModel();
const handoffSnapshot = launchApi.getShellSessionHandoffSnapshot(); const handoffSnapshot = launchApi.getShellSessionHandoffSnapshot();
const handoffRenderState = launchApi.getShellSessionHandoffRenderState();
assertEqual(handoffSummarySchema.summaryVersion, 1, "shell handoff summary schema version"); assertEqual(handoffSummarySchema.summaryVersion, 1, "shell handoff summary schema version");
assertEqual( assertEqual(
launchApi.isSupportedShellSessionHandoffSummary(handoffSummary), launchApi.isSupportedShellSessionHandoffSummary(handoffSummary),
@@ -94,6 +96,9 @@ TOOL_TABLE = browser-shell-tool.tbl
assertEqual(handoffDisplay.detailText, "No blocking reasons", "shell handoff display detail"); assertEqual(handoffDisplay.detailText, "No blocking reasons", "shell handoff display detail");
assertEqual(handoffSnapshot.ready, true, "shell handoff snapshot readiness"); assertEqual(handoffSnapshot.ready, true, "shell handoff snapshot readiness");
assertEqual(handoffSnapshot.displayViewModel.statusText, "Ready", "shell handoff snapshot display status"); assertEqual(handoffSnapshot.displayViewModel.statusText, "Ready", "shell handoff snapshot display status");
assertEqual(handoffRenderState.ready, true, "shell handoff render-state readiness");
assertEqual(handoffRenderState.statusLine, "Ready: No blocking reasons", "shell handoff render-state status");
assertEqual(handoffRenderState.rows.length, handoffDisplay.rows.length, "shell handoff render-state rows");
assertEqual(readiness.phase, "ready", "shell integration readiness phase"); assertEqual(readiness.phase, "ready", "shell integration readiness phase");
assertEqual(readiness.ready, true, "shell integration readiness"); assertEqual(readiness.ready, true, "shell integration readiness");
assertEqual(readiness.missing.join(","), "", "shell integration readiness missing checks"); assertEqual(readiness.missing.join(","), "", "shell integration readiness missing checks");

View File

@@ -20,6 +20,7 @@ import {
createIniPanelShellIntegrationWorkflowPlan, createIniPanelShellIntegrationWorkflowPlan,
createIniPanelShellSessionHandoffCompatibilityReport, createIniPanelShellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffDisplayViewModel, createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffRenderState,
createIniPanelShellSessionHandoffSnapshot, createIniPanelShellSessionHandoffSnapshot,
createIniPanelShellSessionHandoffSummary, createIniPanelShellSessionHandoffSummary,
createIniPanelShellSessionHandoffSummarySchema, createIniPanelShellSessionHandoffSummarySchema,
@@ -73,6 +74,7 @@ const requiredShellExports = [
"createIniPanelShellIntegrationWorkflowPlan", "createIniPanelShellIntegrationWorkflowPlan",
"createIniPanelShellSessionHandoffCompatibilityReport", "createIniPanelShellSessionHandoffCompatibilityReport",
"createIniPanelShellSessionHandoffDisplayViewModel", "createIniPanelShellSessionHandoffDisplayViewModel",
"createIniPanelShellSessionHandoffRenderState",
"createIniPanelShellSessionHandoffSnapshot", "createIniPanelShellSessionHandoffSnapshot",
"createIniPanelShellSessionHandoffSummary", "createIniPanelShellSessionHandoffSummary",
"createIniPanelShellSessionHandoffSummarySchema", "createIniPanelShellSessionHandoffSummarySchema",
@@ -184,6 +186,10 @@ assert.deepEqual(
displayViewModel: createIniPanelShellViewModel().shellSessionHandoffDisplayViewModel, displayViewModel: createIniPanelShellViewModel().shellSessionHandoffDisplayViewModel,
}), }),
); );
assert.deepEqual(
createIniPanelShellViewModel().shellSessionHandoffRenderState,
createIniPanelShellSessionHandoffRenderState(createIniPanelShellViewModel().shellSessionHandoffSnapshot),
);
assert.equal(isSupportedIniPanelShellIntegrationManifest(createIniPanelShellViewModel().shellIntegrationManifest), true); assert.equal(isSupportedIniPanelShellIntegrationManifest(createIniPanelShellViewModel().shellIntegrationManifest), true);
assert.deepEqual(createIniPanelShellViewModel().launchApiSchema, createIniPanelLaunchApiSchema()); assert.deepEqual(createIniPanelShellViewModel().launchApiSchema, createIniPanelLaunchApiSchema());
assert.deepEqual(createIniPanelShellViewModel().launchApiManifest, createIniPanelLaunchApiManifest()); assert.deepEqual(createIniPanelShellViewModel().launchApiManifest, createIniPanelLaunchApiManifest());
@@ -240,6 +246,7 @@ assert.match(shellText, /\bexport function createIniPanelShellIntegrationReadine
assert.match(shellText, /\bexport function createIniPanelShellIntegrationWorkflowPlan\b/); assert.match(shellText, /\bexport function createIniPanelShellIntegrationWorkflowPlan\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffCompatibilityReport\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffCompatibilityReport\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffDisplayViewModel\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffDisplayViewModel\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffRenderState\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSnapshot\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSnapshot\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSummary\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSummary\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSummarySchema\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSummarySchema\b/);
@@ -264,6 +271,8 @@ assert.match(launchText, /\bisSupportedShellSessionHandoffSummary\b/);
assert.match(launchText, /\bgetShellSessionHandoffCompatibilityReport\b/); assert.match(launchText, /\bgetShellSessionHandoffCompatibilityReport\b/);
assert.match(launchText, /\bgetShellSessionHandoffDisplayViewModel\b/); assert.match(launchText, /\bgetShellSessionHandoffDisplayViewModel\b/);
assert.match(launchText, /\bgetShellSessionHandoffSnapshot\b/); assert.match(launchText, /\bgetShellSessionHandoffSnapshot\b/);
assert.match(launchText, /\bgetShellSessionHandoffRenderState\b/);
assert.match(launchText, /\bdata-handoff-shell\b/);
assert.match(launchText, /\bdata-handoff-status\b/); assert.match(launchText, /\bdata-handoff-status\b/);
assert.match(launchText, /\bdata-handoff-rows\b/); assert.match(launchText, /\bdata-handoff-rows\b/);
assert.match(launchText, /\bgetControlPageApiMethods\b/); assert.match(launchText, /\bgetControlPageApiMethods\b/);
@@ -286,6 +295,7 @@ assert.match(docText, /\bcreateIniPanelShellIntegrationSchema\b/);
assert.match(docText, /\bcreateIniPanelShellIntegrationWorkflowPlan\b/); assert.match(docText, /\bcreateIniPanelShellIntegrationWorkflowPlan\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffCompatibilityReport\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffCompatibilityReport\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffDisplayViewModel\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffDisplayViewModel\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffRenderState\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffSnapshot\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffSnapshot\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffSummary\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffSummary\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffSummarySchema\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffSummarySchema\b/);
@@ -305,6 +315,8 @@ assert.match(docText, /\blinuxCncIniPanelLaunchApi\.isSupportedShellSessionHando
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffCompatibilityReport\b/); assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffCompatibilityReport\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffDisplayViewModel\b/); assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffDisplayViewModel\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffSnapshot\b/); assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffSnapshot\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffRenderState\b/);
assert.match(docText, /\bdata-handoff-shell\b/);
assert.match(docText, /\bdata-handoff-status\b/); assert.match(docText, /\bdata-handoff-status\b/);
assert.match(docText, /\bdata-handoff-rows\b/); assert.match(docText, /\bdata-handoff-rows\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getControlPageApiMethods\b/); assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getControlPageApiMethods\b/);
@@ -316,6 +328,7 @@ assert.match(shellIntegrationWorkflowSmokeText, /\bisSupportedShellSessionHandof
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffCompatibilityReport\b/); assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffCompatibilityReport\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffDisplayViewModel\b/); assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffDisplayViewModel\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffSnapshot\b/); assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffSnapshot\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffRenderState\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bhandoffSummary\.handoffMethods\.readStatus\b/); assert.match(shellIntegrationWorkflowSmokeText, /\bhandoffSummary\.handoffMethods\.readStatus\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\breadControlPageStatus\b/); assert.match(shellIntegrationWorkflowSmokeText, /\breadControlPageStatus\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bbrowser_ini_shell_integration_workflow_smoke=ok\b/); assert.match(shellIntegrationWorkflowSmokeText, /\bbrowser_ini_shell_integration_workflow_smoke=ok\b/);

View File

@@ -52,6 +52,7 @@ assert.deepEqual(manifest, {
"getShellSessionHandoffCompatibilityReport", "getShellSessionHandoffCompatibilityReport",
"getShellSessionHandoffDisplayViewModel", "getShellSessionHandoffDisplayViewModel",
"getShellSessionHandoffSnapshot", "getShellSessionHandoffSnapshot",
"getShellSessionHandoffRenderState",
"getLauncherLinks", "getLauncherLinks",
"getControlPageApiMethods", "getControlPageApiMethods",
], ],
@@ -158,6 +159,7 @@ assert.match(launchText, /\bisSupportedShellSessionHandoffSummary\b/);
assert.match(launchText, /\bgetShellSessionHandoffCompatibilityReport\b/); assert.match(launchText, /\bgetShellSessionHandoffCompatibilityReport\b/);
assert.match(launchText, /\bgetShellSessionHandoffDisplayViewModel\b/); assert.match(launchText, /\bgetShellSessionHandoffDisplayViewModel\b/);
assert.match(launchText, /\bgetShellSessionHandoffSnapshot\b/); assert.match(launchText, /\bgetShellSessionHandoffSnapshot\b/);
assert.match(launchText, /\bgetShellSessionHandoffRenderState\b/);
assert.match(launchText, /\blinuxCncIniPanelLaunchApi\b/); assert.match(launchText, /\blinuxCncIniPanelLaunchApi\b/);
console.log("ini_panel_launch_api_manifest_node_smoke=ok"); console.log("ini_panel_launch_api_manifest_node_smoke=ok");

View File

@@ -16,6 +16,7 @@ import {
createIniPanelShellIntegrationWorkflowPlan, createIniPanelShellIntegrationWorkflowPlan,
createIniPanelShellSessionHandoffCompatibilityReport, createIniPanelShellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffDisplayViewModel, createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffRenderState,
createIniPanelShellSessionHandoffSnapshot, createIniPanelShellSessionHandoffSnapshot,
createIniPanelShellSessionHandoffSummary, createIniPanelShellSessionHandoffSummary,
createIniPanelShellSessionHandoffSummarySchema, createIniPanelShellSessionHandoffSummarySchema,
@@ -44,6 +45,7 @@ const handoffSnapshot = createIniPanelShellSessionHandoffSnapshot({
compatibilityReport: handoffCompatibilityReport, compatibilityReport: handoffCompatibilityReport,
displayViewModel: handoffDisplayViewModel, displayViewModel: handoffDisplayViewModel,
}); });
const handoffRenderState = createIniPanelShellSessionHandoffRenderState(handoffSnapshot);
assert.deepEqual(schema, { assert.deepEqual(schema, {
apiName: "ini-panel-shell-integration", apiName: "ini-panel-shell-integration",
@@ -99,7 +101,7 @@ assert.deepEqual(readiness, {
counts: { counts: {
pages: 2, pages: 2,
launcherLinks: 2, launcherLinks: 2,
launchMethods: 14, launchMethods: 15,
controlPageMethods: 11, controlPageMethods: 11,
persistenceCapabilities: 3, persistenceCapabilities: 3,
}, },
@@ -161,7 +163,7 @@ assert.deepEqual(handoffSummary, {
counts: { counts: {
pages: 2, pages: 2,
launcherLinks: 2, launcherLinks: 2,
launchMethods: 14, launchMethods: 15,
controlPageMethods: 11, controlPageMethods: 11,
persistenceCapabilities: 3, persistenceCapabilities: 3,
}, },
@@ -310,7 +312,23 @@ assert.deepEqual(handoffSnapshot, {
compatibilityReport: handoffCompatibilityReport, compatibilityReport: handoffCompatibilityReport,
displayViewModel: handoffDisplayViewModel, displayViewModel: handoffDisplayViewModel,
}); });
assert.deepEqual(handoffRenderState, {
apiName: "ini-panel-shell-session-handoff-render-state",
renderStateVersion: 1,
phase: "ready",
ready: true,
title: "Shell handoff compatibility",
statusText: "Ready",
detailText: "No blocking reasons",
statusLine: "Ready: No blocking reasons",
rows: handoffDisplayViewModel.rows,
dataset: {
handoffPhase: "ready",
handoffReady: "true",
},
});
assert.equal(createIniPanelShellSessionHandoffSnapshot().displayViewModel.rows.length, 5); assert.equal(createIniPanelShellSessionHandoffSnapshot().displayViewModel.rows.length, 5);
assert.equal(createIniPanelShellSessionHandoffRenderState().statusLine, "Ready: No blocking reasons");
assert.deepEqual( assert.deepEqual(
createIniPanelShellSessionHandoffDisplayViewModel( createIniPanelShellSessionHandoffDisplayViewModel(
createIniPanelShellSessionHandoffCompatibilityReport({ ...handoffSummary, summaryVersion: 2 }), createIniPanelShellSessionHandoffCompatibilityReport({ ...handoffSummary, summaryVersion: 2 }),
@@ -348,6 +366,55 @@ assert.deepEqual(
createIniPanelShellSessionHandoffCompatibilityReport(null).missingFields, createIniPanelShellSessionHandoffCompatibilityReport(null).missingFields,
handoffSummarySchema.fields, handoffSummarySchema.fields,
); );
assert.deepEqual(
createIniPanelShellSessionHandoffRenderState(createIniPanelShellSessionHandoffSnapshot({
compatibilityReport: createIniPanelShellSessionHandoffCompatibilityReport({
...handoffSummary,
summaryVersion: 2,
}),
})),
{
apiName: "ini-panel-shell-session-handoff-render-state",
renderStateVersion: 1,
phase: "blocked",
ready: false,
title: "Shell handoff compatibility",
statusText: "Blocked",
detailText: "summaryVersion",
statusLine: "Blocked: summaryVersion",
rows: [
{
id: "summary-supported",
label: "Summary schema",
value: "blocked",
},
{
id: "handoff-ready",
label: "Handoff readiness",
value: "blocked",
},
{
id: "missing-fields",
label: "Missing fields",
value: "none",
},
{
id: "mismatch-fields",
label: "Mismatched fields",
value: "summaryVersion",
},
{
id: "blocking-reasons",
label: "Blocking reasons",
value: "none",
},
],
dataset: {
handoffPhase: "blocked",
handoffReady: "false",
},
},
);
const blockedManifest = { const blockedManifest = {
...createIniPanelShellIntegrationManifest(), ...createIniPanelShellIntegrationManifest(),
compatibility: { compatibility: {
@@ -369,7 +436,7 @@ assert.deepEqual(createIniPanelShellIntegrationReadiness(blockedManifest), {
counts: { counts: {
pages: 2, pages: 2,
launcherLinks: 2, launcherLinks: 2,
launchMethods: 14, launchMethods: 15,
controlPageMethods: 11, controlPageMethods: 11,
persistenceCapabilities: 3, persistenceCapabilities: 3,
}, },
@@ -514,6 +581,7 @@ assert.match(shellText, /\bexport function createIniPanelShellIntegrationReadine
assert.match(shellText, /\bexport function createIniPanelShellIntegrationWorkflowPlan\b/); assert.match(shellText, /\bexport function createIniPanelShellIntegrationWorkflowPlan\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffCompatibilityReport\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffCompatibilityReport\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffDisplayViewModel\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffDisplayViewModel\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffRenderState\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSnapshot\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSnapshot\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSummary\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSummary\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSummarySchema\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSummarySchema\b/);
@@ -527,6 +595,7 @@ assert.match(docText, /\bcreateIniPanelShellIntegrationReadiness\b/);
assert.match(docText, /\bcreateIniPanelShellIntegrationWorkflowPlan\b/); assert.match(docText, /\bcreateIniPanelShellIntegrationWorkflowPlan\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffCompatibilityReport\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffCompatibilityReport\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffDisplayViewModel\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffDisplayViewModel\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffRenderState\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffSnapshot\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffSnapshot\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffSummary\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffSummary\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffSummarySchema\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffSummarySchema\b/);

View File

@@ -16,6 +16,7 @@ import {
createIniPanelShellIntegrationWorkflowPlan, createIniPanelShellIntegrationWorkflowPlan,
createIniPanelShellSessionHandoffCompatibilityReport, createIniPanelShellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffDisplayViewModel, createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffRenderState,
createIniPanelShellSessionHandoffSnapshot, createIniPanelShellSessionHandoffSnapshot,
createIniPanelShellSessionHandoffSummary, createIniPanelShellSessionHandoffSummary,
createIniPanelShellSessionHandoffSummarySchema, createIniPanelShellSessionHandoffSummarySchema,
@@ -74,6 +75,7 @@ assert.equal(typeof createIniPanelShellIntegrationSchema, "function");
assert.equal(typeof createIniPanelShellIntegrationWorkflowPlan, "function"); assert.equal(typeof createIniPanelShellIntegrationWorkflowPlan, "function");
assert.equal(typeof createIniPanelShellSessionHandoffCompatibilityReport, "function"); assert.equal(typeof createIniPanelShellSessionHandoffCompatibilityReport, "function");
assert.equal(typeof createIniPanelShellSessionHandoffDisplayViewModel, "function"); assert.equal(typeof createIniPanelShellSessionHandoffDisplayViewModel, "function");
assert.equal(typeof createIniPanelShellSessionHandoffRenderState, "function");
assert.equal(typeof createIniPanelShellSessionHandoffSnapshot, "function"); assert.equal(typeof createIniPanelShellSessionHandoffSnapshot, "function");
assert.equal(typeof createIniPanelShellSessionHandoffSummary, "function"); assert.equal(typeof createIniPanelShellSessionHandoffSummary, "function");
assert.equal(typeof createIniPanelShellSessionHandoffSummarySchema, "function"); assert.equal(typeof createIniPanelShellSessionHandoffSummarySchema, "function");
@@ -161,6 +163,10 @@ assert.deepEqual(
displayViewModel: shellViewModel.shellSessionHandoffDisplayViewModel, displayViewModel: shellViewModel.shellSessionHandoffDisplayViewModel,
}), }),
); );
assert.deepEqual(
shellViewModel.shellSessionHandoffRenderState,
createIniPanelShellSessionHandoffRenderState(shellViewModel.shellSessionHandoffSnapshot),
);
assert.deepEqual(shellViewModel.shellSessionHandoffDisplayViewModel, { assert.deepEqual(shellViewModel.shellSessionHandoffDisplayViewModel, {
phase: "ready", phase: "ready",
title: "Shell handoff compatibility", title: "Shell handoff compatibility",
@@ -194,6 +200,21 @@ assert.deepEqual(shellViewModel.shellSessionHandoffDisplayViewModel, {
}, },
], ],
}); });
assert.deepEqual(shellViewModel.shellSessionHandoffRenderState, {
apiName: "ini-panel-shell-session-handoff-render-state",
renderStateVersion: 1,
phase: "ready",
ready: true,
title: "Shell handoff compatibility",
statusText: "Ready",
detailText: "No blocking reasons",
statusLine: "Ready: No blocking reasons",
rows: shellViewModel.shellSessionHandoffDisplayViewModel.rows,
dataset: {
handoffPhase: "ready",
handoffReady: "true",
},
});
assert.equal( assert.equal(
isSupportedIniPanelShellIntegrationManifest(shellViewModel.shellIntegrationManifest), isSupportedIniPanelShellIntegrationManifest(shellViewModel.shellIntegrationManifest),
true, true,
@@ -238,6 +259,7 @@ assert.equal(
createIniPanelShellSessionHandoffDisplayViewModel, createIniPanelShellSessionHandoffDisplayViewModel,
); );
assert.equal(shellViewModel.createShellSessionHandoffSnapshot, createIniPanelShellSessionHandoffSnapshot); assert.equal(shellViewModel.createShellSessionHandoffSnapshot, createIniPanelShellSessionHandoffSnapshot);
assert.equal(shellViewModel.createShellSessionHandoffRenderState, createIniPanelShellSessionHandoffRenderState);
assert.deepEqual(shellViewModel.controlPage.contract, createIniPanelShellControlPageContract()); assert.deepEqual(shellViewModel.controlPage.contract, createIniPanelShellControlPageContract());
assert.equal(shellViewModel.controlPage.isSupportedBrowserApiManifest, isSupportedIniPanelControlPageApiManifest); assert.equal(shellViewModel.controlPage.isSupportedBrowserApiManifest, isSupportedIniPanelControlPageApiManifest);
assert.equal(shellViewModel.controlPage.loadSessionState, loadMachineSessionForControlPageWorkflow); assert.equal(shellViewModel.controlPage.loadSessionState, loadMachineSessionForControlPageWorkflow);