推进 INI 面板 shell handoff package mount-state

This commit is contained in:
2026-06-15 11:16:35 +08:00
parent 1d06fd4cd4
commit f548f24fb8
10 changed files with 427 additions and 4 deletions

View File

@@ -27,6 +27,7 @@ import {
createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffPackage,
createIniPanelShellSessionHandoffPackageDisplayViewModel,
createIniPanelShellSessionHandoffPackageMountState,
createIniPanelShellSessionHandoffPackageReport,
createIniPanelShellSessionHandoffPackageRenderState,
createIniPanelShellSessionHandoffPackageSchema,
@@ -210,6 +211,11 @@ outer shell needs the package display view-model compressed into launch-side
DOM state. The launch page renders `[data-handoff-status]` and
`[data-handoff-rows]` from the package render-state so the first page shows
package-level schema/report status.
Use `createIniPanelShellSessionHandoffPackageMountState()` or
`linuxCncIniPanelLaunchApi.getShellSessionHandoffPackageMountState()` when an
outer shell needs one read-only mount-state that combines package render-state,
the control-page target, required readonly methods, and the current
control-page session readiness snapshot.
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,

View File

@@ -152,6 +152,15 @@
getShellSessionHandoffPackageReport: () => shellViewModel.shellSessionHandoffPackageReport,
getShellSessionHandoffPackageDisplayViewModel: () => shellViewModel.shellSessionHandoffPackageDisplayViewModel,
getShellSessionHandoffPackageRenderState: () => shellViewModel.shellSessionHandoffPackageRenderState,
getShellSessionHandoffPackageMountState: (sessionLoadState) => (
sessionLoadState
? shellViewModel.createShellSessionHandoffPackageMountState({
handoffPackage: shellViewModel.shellSessionHandoffPackage,
packageRenderState: shellViewModel.shellSessionHandoffPackageRenderState,
sessionLoadState,
})
: shellViewModel.shellSessionHandoffPackageMountState
),
isSupportedShellSessionHandoffPackage: shellViewModel.isSupportedShellSessionHandoffPackage,
getLauncherLinks: () => shellViewModel.launcherLinks,
getControlPageApiMethods: () => shellViewModel.controlPage.browserApiMethods,

View File

@@ -140,6 +140,7 @@ export function createIniPanelLaunchApiManifest(entries = getVisibleIniPanelEntr
"getShellSessionHandoffPackageReport",
"getShellSessionHandoffPackageDisplayViewModel",
"getShellSessionHandoffPackageRenderState",
"getShellSessionHandoffPackageMountState",
"isSupportedShellSessionHandoffPackage",
"getLauncherLinks",
"getControlPageApiMethods",
@@ -938,6 +939,85 @@ export function createIniPanelShellSessionHandoffPackageRenderState(
};
}
export function createIniPanelShellSessionHandoffPackageMountState({
handoffPackage = createIniPanelShellSessionHandoffPackage(),
packageRenderState = createIniPanelShellSessionHandoffPackageRenderState(),
sessionLoadState = createControlPageSessionLoadState({ phase: "waiting-panel" }),
} = {}) {
const actionPlan = handoffPackage?.actionPlan && typeof handoffPackage.actionPlan === "object"
? handoffPackage.actionPlan
: {};
const requiredMethods = actionPlan.requiredMethods && typeof actionPlan.requiredMethods === "object"
? actionPlan.requiredMethods
: {};
const targetPage = actionPlan.targetPage ?? null;
const blockingReasons = [
...(Array.isArray(actionPlan.blockingReasons) ? actionPlan.blockingReasons : []),
...(sessionLoadState?.phase === "error" ? ["controlPageSessionError"] : []),
];
const packageReady = handoffPackage?.ready === true && packageRenderState?.ready === true;
const targetReady = Boolean(targetPage?.href);
const methodsReady = Boolean(requiredMethods.loadSessionState && requiredMethods.readStatus);
const sessionReady = sessionLoadState?.phase === "ready";
const ready = packageReady && targetReady && methodsReady && sessionReady && blockingReasons.length === 0;
return {
apiName: "ini-panel-shell-session-handoff-package-mount-state",
mountStateVersion: 1,
phase: ready ? "ready" : "blocked",
ready,
packageReady,
targetReady,
methodsReady,
sessionReady,
statusLine: ready
? "Ready: Control page session mounted"
: `Blocked: ${blockingReasons.length === 0 ? sessionLoadState?.phase ?? "waiting-panel" : blockingReasons.join(", ")}`,
packageRenderState,
targetPage,
requiredMethods: {
loadSessionState: requiredMethods.loadSessionState ?? null,
readStatus: requiredMethods.readStatus ?? null,
},
sessionLoadState,
blockingReasons,
checks: [
{
id: "package-render-state",
label: "Package render state",
status: packageReady ? "pass" : "blocked",
value: packageRenderState?.statusLine ?? "missing",
},
{
id: "target-page",
label: "Control target",
status: targetReady ? "pass" : "blocked",
value: targetPage?.href ?? "missing",
},
{
id: "required-methods",
label: "Readonly methods",
status: methodsReady ? "pass" : "blocked",
value: methodsReady
? `${requiredMethods.loadSessionState}, ${requiredMethods.readStatus}`
: "missing",
},
{
id: "session-load-state",
label: "Session load state",
status: sessionReady ? "pass" : "blocked",
value: sessionLoadState?.phase ?? "missing",
},
{
id: "blocking-reasons",
label: "Blocking reasons",
status: blockingReasons.length === 0 ? "pass" : "blocked",
value: blockingReasons.length === 0 ? "none" : blockingReasons.join(", "),
},
],
};
}
export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries()) {
const shellIntegrationManifest = createIniPanelShellIntegrationManifest(entries);
const shellIntegrationReadiness = createIniPanelShellIntegrationReadiness(shellIntegrationManifest);
@@ -991,6 +1071,10 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
const shellSessionHandoffPackageRenderState = createIniPanelShellSessionHandoffPackageRenderState(
shellSessionHandoffPackageDisplayViewModel,
);
const shellSessionHandoffPackageMountState = createIniPanelShellSessionHandoffPackageMountState({
handoffPackage: shellSessionHandoffPackage,
packageRenderState: shellSessionHandoffPackageRenderState,
});
return {
pages: entries.map(({ id, href, title }) => ({
id,
@@ -1015,6 +1099,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
shellSessionHandoffPackageReport,
shellSessionHandoffPackageDisplayViewModel,
shellSessionHandoffPackageRenderState,
shellSessionHandoffPackageMountState,
launchApiSchema: createIniPanelLaunchApiSchema(),
launchApiManifest: createIniPanelLaunchApiManifest(entries),
isSupportedShellIntegrationManifest: isSupportedIniPanelShellIntegrationManifest,
@@ -1034,6 +1119,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
createShellSessionHandoffPackageReport: createIniPanelShellSessionHandoffPackageReport,
createShellSessionHandoffPackageDisplayViewModel: createIniPanelShellSessionHandoffPackageDisplayViewModel,
createShellSessionHandoffPackageRenderState: createIniPanelShellSessionHandoffPackageRenderState,
createShellSessionHandoffPackageMountState: createIniPanelShellSessionHandoffPackageMountState,
isSupportedShellSessionHandoffPackage: isSupportedIniPanelShellSessionHandoffPackage,
controlPage: {
browserApiSchema: createControlPageBrowserApiSchema(),

View File

@@ -87,6 +87,7 @@
!launchApi?.getShellSessionHandoffPackageReport ||
!launchApi?.getShellSessionHandoffPackageDisplayViewModel ||
!launchApi?.getShellSessionHandoffPackageRenderState ||
!launchApi?.getShellSessionHandoffPackageMountState ||
!launchApi?.isSupportedShellSessionHandoffPackage ||
!launchApi?.getLauncherLinks ||
!launchApi?.getControlPageApiMethods
@@ -127,7 +128,7 @@
);
assertEqual(
launchApiManifest.methods.join(","),
"isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getShellIntegrationReadiness,getShellSessionHandoffSummarySchema,getShellSessionHandoffSummary,isSupportedShellSessionHandoffSummary,getShellSessionHandoffCompatibilityReport,getShellSessionHandoffDisplayViewModel,getShellSessionHandoffSnapshot,getShellSessionHandoffRenderState,getShellSessionHandoffActionPlan,getShellSessionHandoffChecklist,getShellSessionHandoffPackageSchema,getShellSessionHandoffPackage,getShellSessionHandoffPackageReport,getShellSessionHandoffPackageDisplayViewModel,getShellSessionHandoffPackageRenderState,isSupportedShellSessionHandoffPackage,getLauncherLinks,getControlPageApiMethods",
"isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getShellIntegrationReadiness,getShellSessionHandoffSummarySchema,getShellSessionHandoffSummary,isSupportedShellSessionHandoffSummary,getShellSessionHandoffCompatibilityReport,getShellSessionHandoffDisplayViewModel,getShellSessionHandoffSnapshot,getShellSessionHandoffRenderState,getShellSessionHandoffActionPlan,getShellSessionHandoffChecklist,getShellSessionHandoffPackageSchema,getShellSessionHandoffPackage,getShellSessionHandoffPackageReport,getShellSessionHandoffPackageDisplayViewModel,getShellSessionHandoffPackageRenderState,getShellSessionHandoffPackageMountState,isSupportedShellSessionHandoffPackage,getLauncherLinks,getControlPageApiMethods",
"launch API manifest methods",
);
const shellIntegrationSchema = launchApi.getShellIntegrationSchema();
@@ -146,6 +147,7 @@
const shellSessionHandoffPackageReport = launchApi.getShellSessionHandoffPackageReport();
const shellSessionHandoffPackageDisplayViewModel = launchApi.getShellSessionHandoffPackageDisplayViewModel();
const shellSessionHandoffPackageRenderState = launchApi.getShellSessionHandoffPackageRenderState();
const shellSessionHandoffPackageMountState = launchApi.getShellSessionHandoffPackageMountState();
assertEqual(
shellIntegrationSchema.manifestVersion,
1,
@@ -356,6 +358,31 @@
shellSessionHandoffPackageDisplayViewModel.rows.length,
"shell session handoff package render-state rows",
);
assertEqual(
shellSessionHandoffPackageMountState.mountStateVersion,
1,
"shell session handoff package mount-state version",
);
assertEqual(
shellSessionHandoffPackageMountState.packageReady,
true,
"shell session handoff package mount-state package readiness",
);
assertEqual(
shellSessionHandoffPackageMountState.targetPage.href,
"./control-page.html",
"shell session handoff package mount-state target",
);
assertEqual(
shellSessionHandoffPackageMountState.requiredMethods.readStatus,
"readControlPageStatus",
"shell session handoff package mount-state read method",
);
assertEqual(
shellSessionHandoffPackageMountState.sessionLoadState.phase,
"waiting-panel",
"shell session handoff package mount-state default session",
);
assertEqual(
shellSessionHandoffPackage.ready,
true,

View File

@@ -78,6 +78,7 @@ TOOL_TABLE = browser-shell-tool.tbl
!launchApi?.getShellSessionHandoffPackageReport ||
!launchApi?.getShellSessionHandoffPackageDisplayViewModel ||
!launchApi?.getShellSessionHandoffPackageRenderState ||
!launchApi?.getShellSessionHandoffPackageMountState ||
!launchApi?.isSupportedShellSessionHandoffPackage
) {
throw new Error("launch API namespace did not expose shell integration helpers");
@@ -98,6 +99,7 @@ TOOL_TABLE = browser-shell-tool.tbl
const handoffPackageReport = launchApi.getShellSessionHandoffPackageReport();
const handoffPackageDisplay = launchApi.getShellSessionHandoffPackageDisplayViewModel();
const handoffPackageRenderState = launchApi.getShellSessionHandoffPackageRenderState();
const handoffPackageMountState = launchApi.getShellSessionHandoffPackageMountState();
assertEqual(handoffSummarySchema.summaryVersion, 1, "shell handoff summary schema version");
assertEqual(
launchApi.isSupportedShellSessionHandoffSummary(handoffSummary),
@@ -157,6 +159,9 @@ TOOL_TABLE = browser-shell-tool.tbl
handoffPackageDisplay.rows.length,
"shell handoff package render-state rows",
);
assertEqual(handoffPackageMountState.packageReady, true, "shell handoff package mount-state package readiness");
assertEqual(handoffPackageMountState.targetPage.href, "./control-page.html", "shell handoff package mount-state target");
assertEqual(handoffPackageMountState.sessionLoadState.phase, "waiting-panel", "shell handoff package mount-state default session");
assertEqual(handoffPackage.checklist.ready, handoffChecklist.ready, "shell handoff package checklist");
assertEqual(
handoffPackage.actionPlan.nextSteps.map(({ id }) => id).join(","),
@@ -229,6 +234,11 @@ TOOL_TABLE = browser-shell-tool.tbl
"ready",
"shell integration control-page session readiness",
);
const readyMountState = launchApi.getShellSessionHandoffPackageMountState(
controlPageApi[handoffSummary.handoffMethods.loadSessionState](),
);
assertEqual(readyMountState.ready, true, "shell handoff package mount-state readiness");
assertEqual(readyMountState.sessionLoadState.phase, "ready", "shell handoff package mount-state ready session");
assertEqual(
controlPageApi[handoffSummary.handoffMethods.readStatus]().status.lastAction,
null,

View File

@@ -24,6 +24,7 @@ import {
createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffPackage,
createIniPanelShellSessionHandoffPackageDisplayViewModel,
createIniPanelShellSessionHandoffPackageMountState,
createIniPanelShellSessionHandoffPackageReport,
createIniPanelShellSessionHandoffPackageRenderState,
createIniPanelShellSessionHandoffPackageSchema,
@@ -86,6 +87,7 @@ const requiredShellExports = [
"createIniPanelShellSessionHandoffDisplayViewModel",
"createIniPanelShellSessionHandoffPackage",
"createIniPanelShellSessionHandoffPackageDisplayViewModel",
"createIniPanelShellSessionHandoffPackageMountState",
"createIniPanelShellSessionHandoffPackageReport",
"createIniPanelShellSessionHandoffPackageRenderState",
"createIniPanelShellSessionHandoffPackageSchema",
@@ -252,6 +254,13 @@ assert.deepEqual(
createIniPanelShellViewModel().shellSessionHandoffPackageDisplayViewModel,
),
);
assert.deepEqual(
createIniPanelShellViewModel().shellSessionHandoffPackageMountState,
createIniPanelShellSessionHandoffPackageMountState({
handoffPackage: createIniPanelShellViewModel().shellSessionHandoffPackage,
packageRenderState: createIniPanelShellViewModel().shellSessionHandoffPackageRenderState,
}),
);
assert.equal(isSupportedIniPanelShellSessionHandoffPackage(createIniPanelShellViewModel().shellSessionHandoffPackage), true);
assert.equal(isSupportedIniPanelShellIntegrationManifest(createIniPanelShellViewModel().shellIntegrationManifest), true);
assert.deepEqual(createIniPanelShellViewModel().launchApiSchema, createIniPanelLaunchApiSchema());

View File

@@ -60,6 +60,7 @@ assert.deepEqual(manifest, {
"getShellSessionHandoffPackageReport",
"getShellSessionHandoffPackageDisplayViewModel",
"getShellSessionHandoffPackageRenderState",
"getShellSessionHandoffPackageMountState",
"isSupportedShellSessionHandoffPackage",
"getLauncherLinks",
"getControlPageApiMethods",
@@ -175,6 +176,7 @@ assert.match(launchText, /\bgetShellSessionHandoffPackage\b/);
assert.match(launchText, /\bgetShellSessionHandoffPackageReport\b/);
assert.match(launchText, /\bgetShellSessionHandoffPackageDisplayViewModel\b/);
assert.match(launchText, /\bgetShellSessionHandoffPackageRenderState\b/);
assert.match(launchText, /\bgetShellSessionHandoffPackageMountState\b/);
assert.match(launchText, /\bisSupportedShellSessionHandoffPackage\b/);
assert.match(launchText, /\blinuxCncIniPanelLaunchApi\b/);

View File

@@ -20,6 +20,7 @@ import {
createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffPackage,
createIniPanelShellSessionHandoffPackageDisplayViewModel,
createIniPanelShellSessionHandoffPackageMountState,
createIniPanelShellSessionHandoffPackageReport,
createIniPanelShellSessionHandoffPackageRenderState,
createIniPanelShellSessionHandoffPackageSchema,
@@ -27,6 +28,7 @@ import {
createIniPanelShellSessionHandoffSnapshot,
createIniPanelShellSessionHandoffSummary,
createIniPanelShellSessionHandoffSummarySchema,
createControlPageSessionLoadState,
getVisibleIniPanelEntries,
isSupportedIniPanelShellIntegrationManifest,
isSupportedIniPanelShellSessionHandoffPackage,
@@ -79,6 +81,10 @@ const handoffPackageDisplayViewModel = createIniPanelShellSessionHandoffPackageD
const handoffPackageRenderState = createIniPanelShellSessionHandoffPackageRenderState(
handoffPackageDisplayViewModel,
);
const handoffPackageMountState = createIniPanelShellSessionHandoffPackageMountState({
handoffPackage,
packageRenderState: handoffPackageRenderState,
});
assert.deepEqual(schema, {
apiName: "ini-panel-shell-integration",
@@ -134,7 +140,7 @@ assert.deepEqual(readiness, {
counts: {
pages: 2,
launcherLinks: 2,
launchMethods: 23,
launchMethods: 24,
controlPageMethods: 11,
persistenceCapabilities: 3,
},
@@ -196,7 +202,7 @@ assert.deepEqual(handoffSummary, {
counts: {
pages: 2,
launcherLinks: 2,
launchMethods: 23,
launchMethods: 24,
controlPageMethods: 11,
persistenceCapabilities: 3,
},
@@ -575,6 +581,100 @@ assert.deepEqual(handoffPackageRenderState, {
handoffScope: "package",
},
});
assert.deepEqual(handoffPackageMountState, {
apiName: "ini-panel-shell-session-handoff-package-mount-state",
mountStateVersion: 1,
phase: "blocked",
ready: false,
packageReady: true,
targetReady: true,
methodsReady: true,
sessionReady: false,
statusLine: "Blocked: waiting-panel",
packageRenderState: handoffPackageRenderState,
targetPage: {
entryId: "control-view",
href: "./control-page.html",
},
requiredMethods: {
loadSessionState: "loadControlPageSessionState",
readStatus: "readControlPageStatus",
},
sessionLoadState: createControlPageSessionLoadState({ phase: "waiting-panel" }),
blockingReasons: [],
checks: [
{
id: "package-render-state",
label: "Package render state",
status: "pass",
value: "Ready: No blocking reasons",
},
{
id: "target-page",
label: "Control target",
status: "pass",
value: "./control-page.html",
},
{
id: "required-methods",
label: "Readonly methods",
status: "pass",
value: "loadControlPageSessionState, readControlPageStatus",
},
{
id: "session-load-state",
label: "Session load state",
status: "blocked",
value: "waiting-panel",
},
{
id: "blocking-reasons",
label: "Blocking reasons",
status: "pass",
value: "none",
},
],
});
assert.deepEqual(
createIniPanelShellSessionHandoffPackageMountState({
handoffPackage,
packageRenderState: handoffPackageRenderState,
sessionLoadState: createControlPageSessionLoadState({
phase: "ready",
panelReady: true,
apiReady: true,
controlViewReady: true,
controlView: { status: { runStatus: "not-run" } },
}),
}).checks.map(({ id, status, value }) => ({ id, status, value })),
[
{
id: "package-render-state",
status: "pass",
value: "Ready: No blocking reasons",
},
{
id: "target-page",
status: "pass",
value: "./control-page.html",
},
{
id: "required-methods",
status: "pass",
value: "loadControlPageSessionState, readControlPageStatus",
},
{
id: "session-load-state",
status: "pass",
value: "ready",
},
{
id: "blocking-reasons",
status: "pass",
value: "none",
},
],
);
assert.equal(isSupportedIniPanelShellSessionHandoffPackage(handoffPackage), true);
assert.equal(
isSupportedIniPanelShellSessionHandoffPackage({ ...handoffPackage, packageVersion: 2 }),
@@ -673,6 +773,16 @@ assert.deepEqual(
},
},
);
assert.deepEqual(
createIniPanelShellSessionHandoffPackageMountState({
handoffPackage: { ...handoffPackage, ready: false },
packageRenderState: createIniPanelShellSessionHandoffPackageRenderState(createIniPanelShellSessionHandoffPackageDisplayViewModel(
createIniPanelShellSessionHandoffPackageReport({ ...handoffPackage, packageVersion: 2 }),
)),
sessionLoadState: createControlPageSessionLoadState({ phase: "error", error: "boom" }),
}).blockingReasons,
["controlPageSessionError"],
);
assert.deepEqual(
createIniPanelShellSessionHandoffPackageReport(missingManifestField).missingManifestFields,
["controlPageMethods"],
@@ -904,7 +1014,7 @@ assert.deepEqual(createIniPanelShellIntegrationReadiness(blockedManifest), {
counts: {
pages: 2,
launcherLinks: 2,
launchMethods: 23,
launchMethods: 24,
controlPageMethods: 11,
persistenceCapabilities: 3,
},
@@ -1070,6 +1180,7 @@ assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffComp
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffDisplayViewModel\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackage\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackageDisplayViewModel\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackageMountState\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackageReport\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackageRenderState\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackageSchema\b/);
@@ -1092,6 +1203,7 @@ assert.match(docText, /\bcreateIniPanelShellSessionHandoffCompatibilityReport\b/
assert.match(docText, /\bcreateIniPanelShellSessionHandoffDisplayViewModel\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackage\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackageDisplayViewModel\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackageMountState\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackageReport\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackageRenderState\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackageSchema\b/);

View File

@@ -20,6 +20,7 @@ import {
createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffPackage,
createIniPanelShellSessionHandoffPackageDisplayViewModel,
createIniPanelShellSessionHandoffPackageMountState,
createIniPanelShellSessionHandoffPackageReport,
createIniPanelShellSessionHandoffPackageRenderState,
createIniPanelShellSessionHandoffPackageSchema,
@@ -87,6 +88,7 @@ assert.equal(typeof createIniPanelShellSessionHandoffCompatibilityReport, "funct
assert.equal(typeof createIniPanelShellSessionHandoffDisplayViewModel, "function");
assert.equal(typeof createIniPanelShellSessionHandoffPackage, "function");
assert.equal(typeof createIniPanelShellSessionHandoffPackageDisplayViewModel, "function");
assert.equal(typeof createIniPanelShellSessionHandoffPackageMountState, "function");
assert.equal(typeof createIniPanelShellSessionHandoffPackageReport, "function");
assert.equal(typeof createIniPanelShellSessionHandoffPackageRenderState, "function");
assert.equal(typeof createIniPanelShellSessionHandoffPackageSchema, "function");
@@ -222,6 +224,13 @@ assert.deepEqual(
shellViewModel.shellSessionHandoffPackageRenderState,
createIniPanelShellSessionHandoffPackageRenderState(shellViewModel.shellSessionHandoffPackageDisplayViewModel),
);
assert.deepEqual(
shellViewModel.shellSessionHandoffPackageMountState,
createIniPanelShellSessionHandoffPackageMountState({
handoffPackage: shellViewModel.shellSessionHandoffPackage,
packageRenderState: shellViewModel.shellSessionHandoffPackageRenderState,
}),
);
assert.equal(isSupportedIniPanelShellSessionHandoffPackage(shellViewModel.shellSessionHandoffPackage), true);
assert.deepEqual(shellViewModel.shellSessionHandoffDisplayViewModel, {
phase: "ready",
@@ -464,6 +473,74 @@ assert.deepEqual(shellViewModel.shellSessionHandoffPackageRenderState, {
handoffScope: "package",
},
});
assert.deepEqual(shellViewModel.shellSessionHandoffPackageMountState, {
apiName: "ini-panel-shell-session-handoff-package-mount-state",
mountStateVersion: 1,
phase: "blocked",
ready: false,
packageReady: true,
targetReady: true,
methodsReady: true,
sessionReady: false,
statusLine: "Blocked: waiting-panel",
packageRenderState: shellViewModel.shellSessionHandoffPackageRenderState,
targetPage: {
entryId: "control-view",
href: "./control-page.html",
},
requiredMethods: {
loadSessionState: "loadControlPageSessionState",
readStatus: "readControlPageStatus",
},
sessionLoadState: createControlPageSessionLoadState({ phase: "waiting-panel" }),
blockingReasons: [],
checks: [
{
id: "package-render-state",
label: "Package render state",
status: "pass",
value: "Ready: No blocking reasons",
},
{
id: "target-page",
label: "Control target",
status: "pass",
value: "./control-page.html",
},
{
id: "required-methods",
label: "Readonly methods",
status: "pass",
value: "loadControlPageSessionState, readControlPageStatus",
},
{
id: "session-load-state",
label: "Session load state",
status: "blocked",
value: "waiting-panel",
},
{
id: "blocking-reasons",
label: "Blocking reasons",
status: "pass",
value: "none",
},
],
});
assert.equal(
createIniPanelShellSessionHandoffPackageMountState({
handoffPackage: shellViewModel.shellSessionHandoffPackage,
packageRenderState: shellViewModel.shellSessionHandoffPackageRenderState,
sessionLoadState: createControlPageSessionLoadState({
phase: "ready",
panelReady: true,
apiReady: true,
controlViewReady: true,
controlView: { status: { runStatus: "not-run" } },
}),
}).ready,
true,
);
assert.equal(
isSupportedIniPanelShellIntegrationManifest(shellViewModel.shellIntegrationManifest),
true,
@@ -520,6 +597,10 @@ assert.equal(
shellViewModel.createShellSessionHandoffPackageRenderState,
createIniPanelShellSessionHandoffPackageRenderState,
);
assert.equal(
shellViewModel.createShellSessionHandoffPackageMountState,
createIniPanelShellSessionHandoffPackageMountState,
);
assert.equal(shellViewModel.createShellSessionHandoffPackageReport, createIniPanelShellSessionHandoffPackageReport);
assert.equal(shellViewModel.createShellSessionHandoffPackageSchema, createIniPanelShellSessionHandoffPackageSchema);
assert.equal(shellViewModel.isSupportedShellSessionHandoffPackage, isSupportedIniPanelShellSessionHandoffPackage);