推进 INI 面板 workflow overview embedding contract
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user