推进 INI 面板 shell handoff mount DOM renderer
This commit is contained in:
@@ -90,6 +90,7 @@
|
||||
!launchApi?.getShellSessionHandoffPackageMountState ||
|
||||
!launchApi?.getShellSessionHandoffPackageMountDisplayViewModel ||
|
||||
!launchApi?.getShellSessionHandoffPackageMountRenderState ||
|
||||
!launchApi?.renderShellSessionHandoffMountState ||
|
||||
!launchApi?.isSupportedShellSessionHandoffPackage ||
|
||||
!launchApi?.getLauncherLinks ||
|
||||
!launchApi?.getControlPageApiMethods
|
||||
@@ -130,7 +131,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,getShellSessionHandoffPackageMountState,getShellSessionHandoffPackageMountDisplayViewModel,getShellSessionHandoffPackageMountRenderState,isSupportedShellSessionHandoffPackage,getLauncherLinks,getControlPageApiMethods",
|
||||
"isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getShellIntegrationReadiness,getShellSessionHandoffSummarySchema,getShellSessionHandoffSummary,isSupportedShellSessionHandoffSummary,getShellSessionHandoffCompatibilityReport,getShellSessionHandoffDisplayViewModel,getShellSessionHandoffSnapshot,getShellSessionHandoffRenderState,getShellSessionHandoffActionPlan,getShellSessionHandoffChecklist,getShellSessionHandoffPackageSchema,getShellSessionHandoffPackage,getShellSessionHandoffPackageReport,getShellSessionHandoffPackageDisplayViewModel,getShellSessionHandoffPackageRenderState,getShellSessionHandoffPackageMountState,getShellSessionHandoffPackageMountDisplayViewModel,getShellSessionHandoffPackageMountRenderState,renderShellSessionHandoffMountState,isSupportedShellSessionHandoffPackage,getLauncherLinks,getControlPageApiMethods",
|
||||
"launch API manifest methods",
|
||||
);
|
||||
const shellIntegrationSchema = launchApi.getShellIntegrationSchema();
|
||||
|
||||
@@ -44,28 +44,6 @@
|
||||
return frame.contentDocument;
|
||||
}
|
||||
|
||||
function renderExternalShellMountState(renderState) {
|
||||
const mountNode = document.querySelector("[data-external-shell-mount]");
|
||||
const statusNode = document.querySelector("[data-external-shell-mount-status]");
|
||||
const rowsNode = document.querySelector("[data-external-shell-mount-rows]");
|
||||
mountNode.dataset.handoffPhase = renderState.dataset.handoffPhase;
|
||||
mountNode.dataset.handoffReady = renderState.dataset.handoffReady;
|
||||
mountNode.dataset.handoffScope = renderState.dataset.handoffScope;
|
||||
statusNode.textContent = renderState.statusLine;
|
||||
rowsNode.replaceChildren();
|
||||
for (const row of renderState.rows) {
|
||||
const term = document.createElement("dt");
|
||||
term.dataset.externalMountRow = row.id;
|
||||
term.dataset.externalMountStatus = row.status;
|
||||
term.textContent = row.label;
|
||||
const detail = document.createElement("dd");
|
||||
detail.dataset.externalMountValue = row.id;
|
||||
detail.dataset.externalMountStatus = row.status;
|
||||
detail.textContent = row.value;
|
||||
rowsNode.append(term, detail);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const iniText = `[EMC]
|
||||
MACHINE = browser-shell-integration
|
||||
@@ -107,6 +85,7 @@ TOOL_TABLE = browser-shell-tool.tbl
|
||||
!launchApi?.getShellSessionHandoffPackageMountState ||
|
||||
!launchApi?.getShellSessionHandoffPackageMountDisplayViewModel ||
|
||||
!launchApi?.getShellSessionHandoffPackageMountRenderState ||
|
||||
!launchApi?.renderShellSessionHandoffMountState ||
|
||||
!launchApi?.isSupportedShellSessionHandoffPackage
|
||||
) {
|
||||
throw new Error("launch API namespace did not expose shell integration helpers");
|
||||
@@ -130,7 +109,16 @@ TOOL_TABLE = browser-shell-tool.tbl
|
||||
const handoffPackageMountState = launchApi.getShellSessionHandoffPackageMountState();
|
||||
const handoffPackageMountDisplay = launchApi.getShellSessionHandoffPackageMountDisplayViewModel();
|
||||
const handoffPackageMountRenderState = launchApi.getShellSessionHandoffPackageMountRenderState();
|
||||
renderExternalShellMountState(handoffPackageMountRenderState);
|
||||
const waitingMountRenderResult = launchApi.renderShellSessionHandoffMountState(
|
||||
handoffPackageMountRenderState,
|
||||
{
|
||||
documentRef: document,
|
||||
mountNode: document.querySelector("[data-external-shell-mount]"),
|
||||
statusNode: document.querySelector("[data-external-shell-mount-status]"),
|
||||
rowsNode: document.querySelector("[data-external-shell-mount-rows]"),
|
||||
rowDatasetPrefix: "externalMount",
|
||||
},
|
||||
);
|
||||
assertEqual(handoffSummarySchema.summaryVersion, 1, "shell handoff summary schema version");
|
||||
assertEqual(
|
||||
launchApi.isSupportedShellSessionHandoffSummary(handoffSummary),
|
||||
@@ -195,6 +183,8 @@ TOOL_TABLE = browser-shell-tool.tbl
|
||||
assertEqual(handoffPackageMountState.sessionLoadState.phase, "waiting-panel", "shell handoff package mount-state default session");
|
||||
assertEqual(handoffPackageMountDisplay.detailText, "session-load-state", "shell handoff package mount display detail");
|
||||
assertEqual(handoffPackageMountRenderState.statusLine, "Blocked: session-load-state", "shell handoff package mount render-state status");
|
||||
assertEqual(waitingMountRenderResult.rendered, true, "external shell waiting mount render result");
|
||||
assertEqual(waitingMountRenderResult.rowCount, 5, "external shell waiting mount row count");
|
||||
assertEqual(
|
||||
document.querySelector("[data-external-shell-mount-status]").textContent,
|
||||
"Blocked: session-load-state",
|
||||
@@ -287,11 +277,22 @@ TOOL_TABLE = browser-shell-tool.tbl
|
||||
);
|
||||
const readyMountDisplay = launchApi.getShellSessionHandoffPackageMountDisplayViewModel(readyMountState);
|
||||
const readyMountRenderState = launchApi.getShellSessionHandoffPackageMountRenderState(readyMountState);
|
||||
renderExternalShellMountState(readyMountRenderState);
|
||||
const readyMountRenderResult = launchApi.renderShellSessionHandoffMountState(
|
||||
readyMountRenderState,
|
||||
{
|
||||
documentRef: document,
|
||||
mountNode: document.querySelector("[data-external-shell-mount]"),
|
||||
statusNode: document.querySelector("[data-external-shell-mount-status]"),
|
||||
rowsNode: document.querySelector("[data-external-shell-mount-rows]"),
|
||||
rowDatasetPrefix: "externalMount",
|
||||
},
|
||||
);
|
||||
assertEqual(readyMountState.ready, true, "shell handoff package mount-state readiness");
|
||||
assertEqual(readyMountState.sessionLoadState.phase, "ready", "shell handoff package mount-state ready session");
|
||||
assertEqual(readyMountDisplay.detailText, "No blocking reasons", "shell handoff package ready mount display");
|
||||
assertEqual(readyMountRenderState.statusLine, "Ready: No blocking reasons", "shell handoff package ready mount render-state");
|
||||
assertEqual(readyMountRenderResult.rendered, true, "external shell ready mount render result");
|
||||
assertEqual(readyMountRenderResult.dataset.handoffReady, "true", "external shell ready mount render dataset");
|
||||
assertEqual(
|
||||
document.querySelector("[data-external-shell-mount-status]").textContent,
|
||||
"Ready: No blocking reasons",
|
||||
|
||||
Reference in New Issue
Block a user