diff --git a/ui/src/e2e/execution-settings-progress.test-support.ts b/ui/src/e2e/execution-settings-progress.test-support.ts
index ec6a8cb821..64f751a717 100644
--- a/ui/src/e2e/execution-settings-progress.test-support.ts
+++ b/ui/src/e2e/execution-settings-progress.test-support.ts
@@ -204,6 +204,83 @@ function currentLocationLayoutBox(card: Locator) {
});
}
+async function assertLocationCardAlignment(component: Locator) {
+ await settledPanelBox(component, "settings");
+ const layout = await component.locator(".location-targets").evaluate((targets) => {
+ const basic = targets.querySelector("[data-target='platform_server']")!;
+ const { x, y, width, height } = basic.getBoundingClientRect();
+ const vms = Array.from(targets.querySelectorAll("[data-saved-vm]"), (vm) => {
+ const bounds = vm.getBoundingClientRect();
+ const footer = vm.querySelector(".saved-vm-details")!.getBoundingClientRect();
+ const configure = vm.querySelector("[data-configure-vm]")!.getBoundingClientRect();
+ const forget = vm.querySelector("[data-forget-vm]")!.getBoundingClientRect();
+ return {
+ x: bounds.x,
+ y: bounds.y,
+ width: bounds.width,
+ height: bounds.height,
+ footerBottom: footer.bottom,
+ configureY: configure.y,
+ configureHeight: configure.height,
+ configureBottom: configure.bottom,
+ forgetY: forget.y,
+ forgetHeight: forget.height,
+ };
+ });
+ const scrollport = targets.closest("main")!.getBoundingClientRect();
+ return {
+ basic: { x, y, width, height },
+ vms,
+ targets: {
+ x: targets.getBoundingClientRect().x,
+ y: targets.getBoundingClientRect().y,
+ width: targets.clientWidth,
+ },
+ scrollport: { top: scrollport.top, bottom: scrollport.bottom },
+ overflow: targets.scrollWidth > targets.clientWidth + 1,
+ };
+ });
+ expect(layout.overflow).toBe(false);
+ expect(Math.abs(layout.basic.x - layout.targets.x)).toBeLessThan(1);
+ expect(Math.abs(layout.basic.y - layout.targets.y)).toBeLessThan(1);
+ if (!layout.vms.length) {
+ expect(Math.abs(layout.basic.width - layout.targets.width)).toBeLessThan(1);
+ }
+ for (const card of [layout.basic, ...layout.vms]) {
+ for (const coordinate of ["y", "width", "height"] as const) {
+ expect(
+ Math.abs(card[coordinate] - layout.basic[coordinate]),
+ `Location card ${coordinate}`,
+ ).toBeLessThan(1);
+ }
+ expect(card.y).toBeGreaterThanOrEqual(layout.scrollport.top);
+ expect(card.y + card.height).toBeLessThanOrEqual(layout.scrollport.bottom);
+ }
+ for (const [index, vm] of layout.vms.entries()) {
+ const previous = index === 0 ? layout.basic : layout.vms[index - 1]!;
+ expect(vm.x).toBeGreaterThan(previous.x + previous.width);
+ expect(vm.x + vm.width).toBeLessThanOrEqual(layout.targets.x + layout.targets.width + 1);
+ expect(Math.abs(vm.configureY - vm.forgetY)).toBeLessThan(1);
+ expect(Math.abs(vm.configureHeight - vm.forgetHeight)).toBeLessThan(1);
+ expect(vm.configureY).toBeGreaterThanOrEqual(vm.y);
+ expect(vm.configureBottom).toBeLessThanOrEqual(vm.y + vm.height);
+ expect(vm.footerBottom).toBeLessThanOrEqual(vm.y + vm.height);
+ for (const coordinate of [
+ "footerBottom",
+ "configureY",
+ "configureHeight",
+ "configureBottom",
+ ] as const) {
+ expect(
+ Math.abs(vm[coordinate] - layout.vms[0]![coordinate]),
+ `VM actions ${coordinate}`,
+ ).toBeLessThan(1);
+ }
+ }
+ const last = layout.vms.at(-1) ?? layout.basic;
+ expect(Math.abs(last.x + last.width - layout.targets.x - layout.targets.width)).toBeLessThan(1);
+}
+
export async function runExecutionProgressCase({
browser,
server,
@@ -243,6 +320,13 @@ export async function runExecutionProgressCase({
reducedMotion: reducedMotion ? "reduce" : "no-preference",
serviceWorkers: "block",
viewport: { width: 1440, height: 1000 },
+ recordVideo:
+ process.env.OPENCLAW_CAPTURE_UI_PROOF === "1" && family === "platformclaw"
+ ? {
+ dir: ".artifacts/control-ui-e2e/coding-agent-settings/multi-vm-video",
+ size: { width: 1440, height: 1000 },
+ }
+ : undefined,
});
const page = await context.newPage();
const labels = [
@@ -365,12 +449,14 @@ export async function runExecutionProgressCase({
const currentLocation = component.locator("[data-current-location]");
const currentTarget = currentLocation.locator("[data-current-target]");
await expect.poll(() => currentTarget.textContent()).toContain(basic);
- expect((await badge.textContent())?.trim()).toBe(copy.workLocation);
+ expect((await badge.locator(".label").textContent())?.trim()).toBe(copy.workLocation);
await badge.click();
await expect
.poll(() => component.getByRole("dialog", { name: copy.settings, exact: true }).isVisible())
.toBe(true);
await captureDialogIdentity(component, "settings");
+ await assertLocationCardAlignment(component);
+ await screenshot(page, `multi-vm-${family}-${mode}-empty.png`);
expect(
await currentLocation.locator("[data-target='platform_server']").getAttribute("aria-pressed"),
).toBe("true");
@@ -419,7 +505,7 @@ export async function runExecutionProgressCase({
.poll(() => upper.locator("[data-progress-panel]").getAttribute("data-phase"))
.toBe("error");
expect(await currentTarget.textContent()).toContain(from);
- expect((await badge.textContent())?.trim()).toBe(copy.workLocation);
+ expect((await badge.locator(".label").textContent())?.trim()).toBe(copy.workLocation);
expect(
await upper.getByRole("heading", { name: copy.failure, exact: true }).isVisible(),
).toBe(true);
@@ -443,13 +529,17 @@ export async function runExecutionProgressCase({
).toBe(true);
await assertExecutionProgressLayout(component);
expect(await badge.getAttribute("aria-busy")).toBe("false");
- expect((await badge.textContent())?.trim()).toBe(copy.workLocation);
+ expect((await badge.locator(".label").textContent())?.trim()).toBe(copy.workLocation);
await screenshot(page, `multi-vm-${family}-${mode}-${requests.length}.png`);
await expect
.poll(() => upper.locator("dialog").evaluate((node) => (node as HTMLDialogElement).open))
.toBe(false);
await assertDialogIdentity(component, "settings");
await assertDialogIdentity(component, "progress", false);
+ await assertLocationCardAlignment(component);
+ if (registration) {
+ await screenshot(page, `multi-vm-${family}-${mode}-registered-${saved.length}.png`);
+ }
expect(
await component.locator("[data-settings-modal] main").evaluate((node) => node.scrollTop),
).toBe(0);
@@ -499,8 +589,9 @@ export async function runExecutionProgressCase({
for (const destination of [0, 1, 2, 0, -1, 1]) {
await switchTo(destination);
}
- // Preserve desktop matrix proof and narrow-screen switching without repeating the full matrix.
- await page.setViewportSize({ width: 390, height: 844 });
+ // Keep failure/retry proof on the same desktop row as the direct switches.
+ await assertLocationCardAlignment(component);
+ await screenshot(page, `multi-vm-${family}-${mode}-desktop-row.png`);
failNextSwitch = family === "platformclaw";
for (const destination of [0, -1]) {
await switchTo(destination);
diff --git a/ui/src/e2e/platformclaw-adapter.e2e.test.ts b/ui/src/e2e/platformclaw-adapter.e2e.test.ts
index c25196995d..160c2a0b4b 100644
--- a/ui/src/e2e/platformclaw-adapter.e2e.test.ts
+++ b/ui/src/e2e/platformclaw-adapter.e2e.test.ts
@@ -332,7 +332,7 @@ describeControlUiE2e("PlatformClaw Control UI adapter mocked Gateway E2E", () =>
});
await page.goto(`${server.baseUrl}platformclaw/app/chat`);
- const quickActions = page.locator("platformclaw-quick-actions:not([location-only])");
+ const quickActions = page.locator("platformclaw-quick-actions");
await expect.poll(() => quickActions.isVisible()).toBe(true);
await expect
.poll(() => quickActions.getByRole("button", { name: "VOC" }).isVisible())
diff --git a/ui/src/e2e/platformclaw-execution-settings.e2e.test.ts b/ui/src/e2e/platformclaw-execution-settings.e2e.test.ts
index acff68bd4d..527ee06cc3 100644
--- a/ui/src/e2e/platformclaw-execution-settings.e2e.test.ts
+++ b/ui/src/e2e/platformclaw-execution-settings.e2e.test.ts
@@ -517,7 +517,7 @@ suite("PlatformClaw coding agent settings", () => {
await expect
.poll(() => component.locator("[data-current-target]").textContent())
.toContain("Development VM");
- expect((await component.locator("[data-action='open']").textContent())?.trim()).toBe(
+ expect((await component.locator("[data-action='open'] .label").textContent())?.trim()).toBe(
"Work location",
);
await component.locator("[data-target='platform_server']").click();
diff --git a/ui/src/e2e/platformclaw-selected-location.e2e.test.ts b/ui/src/e2e/platformclaw-selected-location.e2e.test.ts
index b1b85e2685..9801e9f9a8 100644
--- a/ui/src/e2e/platformclaw-selected-location.e2e.test.ts
+++ b/ui/src/e2e/platformclaw-selected-location.e2e.test.ts
@@ -1,3 +1,5 @@
+import { mkdir } from "node:fs/promises";
+import path from "node:path";
import type { Locator, Page, Route } from "playwright";
import { expect, it } from "vitest";
import type { ExecutionSettings } from "../platformclaw/execution-settings-view.ts";
@@ -11,8 +13,10 @@ import { createControlUiE2eSuite } from "./control-ui-e2e-suite.test-support.ts"
const suite = createControlUiE2eSuite({
name: "PlatformClaw selected personal work location",
- unavailableMessage: (path) => `Chromium cannot start at ${path}.`,
+ unavailableMessage: (executablePath) => `Chromium cannot start at ${executablePath}.`,
});
+const captureProof = process.env.OPENCLAW_CAPTURE_UI_PROOF === "1";
+const proofDir = ".artifacts/control-ui-e2e/coding-agent-settings/selected-location";
const settings: ExecutionSettings = {
activeTarget: "platform_server",
@@ -22,7 +26,7 @@ const settings: ExecutionSettings = {
accountId: "person.one",
availableVms: [
{ id: "synthetic-vm-one", label: "Build VM" },
- { id: "synthetic-vm-two", label: "Test VM" },
+ { id: "synthetic-vm-two", label: "Test VM with a deliberately long environment name" },
],
savedVms: [
{
@@ -37,7 +41,7 @@ const settings: ExecutionSettings = {
{
id: "connection-two",
vmHostId: "synthetic-vm-two",
- vmLabel: "Test VM",
+ vmLabel: "Test VM with a deliberately long environment name",
safeConnectLabel: "Synthetic connector",
linuxAccount: "person.one",
status: "ready",
@@ -74,19 +78,18 @@ function savedVmsForTarget(
suite.define(() => {
it.each(["platform_server", "assigned_vm"] as const)(
- "keeps the member's selected %s visible on mobile and preserves the draft when switching",
+ "keeps the selected %s inside the work-location button and preserves the draft when switching",
async (target) => {
const context = await suite.newBrowserContext({
locale: "en-US",
viewport: { width: 390, height: 844 },
serviceWorkers: "block",
- recordVideo:
- process.env.OPENCLAW_CAPTURE_UI_PROOF === "1"
- ? {
- dir: ".artifacts/control-ui-e2e/selected-location",
- size: { width: 390, height: 844 },
- }
- : undefined,
+ recordVideo: captureProof
+ ? {
+ dir: path.join(proofDir, "video"),
+ size: { width: 390, height: 844 },
+ }
+ : undefined,
});
const page = await context.newPage();
let current: ExecutionSettings = {
@@ -162,33 +165,69 @@ suite.define(() => {
};
try {
const gateway = await openChat(page);
- const indicator = page
- .locator("platformclaw-quick-actions[location-only]")
- .getByRole("status");
- const assertLocation = async (status: Locator, label: string, width: number) => {
+ const composer = page.locator(".agent-chat__composer-combobox textarea");
+ await composer.fill("Keep this draft while checking work location");
+ await page
+ .locator(".topbar-nav-toggle:visible, .chat-pane__nav-toggle:visible")
+ .first()
+ .click();
+ const mobileLauncher = page
+ .locator("platformclaw-quick-actions")
+ .getByRole("button", { name: "Open work location settings", exact: true });
+ const capture = async (targetPage: Page, stage: string) => {
+ if (captureProof) {
+ await mkdir(proofDir, { recursive: true });
+ await targetPage.screenshot({
+ animations: "disabled",
+ path: path.join(proofDir, `${target}-${stage}.png`),
+ });
+ }
+ };
+ const assertLocation = async (button: Locator, label: string, width: number) => {
+ const status = button.locator("[data-location-status][role='status']");
const selected = `Selected location: ${label}`;
+ await expect.poll(() => button.isVisible()).toBe(true);
+ expect((await button.locator(".label").textContent())?.trim()).toBe("Work location");
await expect.poll(() => status.getAttribute("aria-label")).toBe(selected);
await expect.poll(async () => (await status.textContent())?.trim()).toBe(selected);
expect(await status.getAttribute("title")).toContain(`${selected}.`);
const bounds = await status.boundingBox();
+ const buttonBounds = await button.boundingBox();
expect(bounds).not.toBeNull();
+ expect(buttonBounds).not.toBeNull();
expect(bounds!.x).toBeGreaterThanOrEqual(0);
expect(bounds!.x + bounds!.width).toBeLessThanOrEqual(width);
+ expect(bounds!.x).toBeGreaterThanOrEqual(buttonBounds!.x);
+ expect(bounds!.x + bounds!.width).toBeLessThanOrEqual(
+ buttonBounds!.x + buttonBounds!.width,
+ );
+ expect(bounds!.y).toBeGreaterThanOrEqual(buttonBounds!.y);
+ expect(bounds!.y + bounds!.height).toBeLessThanOrEqual(
+ buttonBounds!.y + buttonBounds!.height,
+ );
};
await assertLocation(
- indicator,
+ mobileLauncher,
target === "platform_server" ? "Basic server" : "Build VM",
390,
);
- const composer = page.locator(".agent-chat__composer-combobox textarea");
- await composer.fill("Keep this draft while checking work location");
+ expect(await page.locator("platformclaw-quick-actions[location-only]").count()).toBe(0);
+ await capture(page, "mobile-initial");
const secondPage = await context.newPage();
await secondPage.setViewportSize({ width: 1440, height: 900 });
const secondGateway = await openChat(secondPage);
const launcher = secondPage
- .locator("platformclaw-quick-actions:not([location-only])")
+ .locator("platformclaw-quick-actions")
.getByRole("button", { name: "Open work location settings", exact: true });
- expect((await launcher.textContent())?.trim()).toBe("Work location");
+ await assertLocation(
+ launcher,
+ target === "platform_server" ? "Basic server" : "Build VM",
+ 1440,
+ );
+ expect(await secondPage.locator("platformclaw-quick-actions[location-only]").count()).toBe(
+ 0,
+ );
+ await capture(secondPage, "desktop-initial");
await launcher.click();
const dialog = secondPage.getByRole("dialog", {
name: "Work environment settings",
@@ -196,9 +235,7 @@ suite.define(() => {
});
await dialog.waitFor();
const component = secondPage.locator("platformclaw-execution-settings");
- const secondIndicator = secondPage
- .locator("platformclaw-quick-actions[location-only]")
- .getByRole("status");
+ expect(await component.locator("[data-action='open']").count()).toBe(0);
for (const change of expectedChanges) {
await secondPage.bringToFront();
// Saved VM selection must identify the registration, not the shared assigned_vm target.
@@ -212,7 +249,7 @@ suite.define(() => {
const label = change.connectionId
? settings.savedVms.find((vm) => vm.id === change.connectionId)!.vmLabel
: "Basic server";
- await assertLocation(secondIndicator, label, 1440);
+ await assertLocation(launcher, label, 1440);
await expect
.poll(() =>
component
@@ -220,11 +257,17 @@ suite.define(() => {
.evaluate((node) => (node as HTMLDialogElement).open),
)
.toBe(false);
- expect((await launcher.textContent())?.trim()).toBe("Work location");
+ expect((await launcher.locator(".label").textContent())?.trim()).toBe("Work location");
await page.bringToFront();
- await assertLocation(indicator, label, 390);
+ await assertLocation(mobileLauncher, label, 390);
+ await capture(page, `mobile-switch-${changes.length}`);
expect(await composer.inputValue()).toBe("Keep this draft while checking work location");
}
+ await secondPage.bringToFront();
+ await component.locator("[data-action='close']").click();
+ await dialog.waitFor({ state: "hidden" });
+ await assertLocation(launcher, settings.savedVms[1]!.vmLabel, 1440);
+ await capture(secondPage, "desktop-final");
expect(changes).toEqual(expectedChanges);
expect(await gateway.getRequests("chat.send")).toHaveLength(0);
expect(await gateway.getRequests("sessions.patch")).toHaveLength(0);
diff --git a/ui/src/e2e/platformclaw-settings-footer.e2e.test.ts b/ui/src/e2e/platformclaw-settings-footer.e2e.test.ts
index b7660ad89c..e7ad297e18 100644
--- a/ui/src/e2e/platformclaw-settings-footer.e2e.test.ts
+++ b/ui/src/e2e/platformclaw-settings-footer.e2e.test.ts
@@ -21,6 +21,7 @@ const proofDir = path.join(
process.cwd(),
".artifacts",
"control-ui-e2e",
+ "coding-agent-settings",
"platformclaw-settings-footer",
);
@@ -115,6 +116,7 @@ describeControlUiE2e("PlatformClaw settings footer quick actions", () => {
},
],
credentialStatus: "current",
+ credentialRevision: 1,
targetRevision: 3,
};
@@ -168,8 +170,16 @@ describeControlUiE2e("PlatformClaw settings footer quick actions", () => {
});
await expect.poll(() => workLocationButton.isVisible()).toBe(true);
await expect
- .poll(async () => (await workLocationButton.textContent())?.trim())
+ .poll(async () => (await workLocationButton.locator(".label").textContent())?.trim())
.toBe("Work location");
+ const selectedLocation = workLocationButton.locator("[data-location-status][role='status']");
+ await expect
+ .poll(async () => (await selectedLocation.textContent())?.trim())
+ .toBe("Selected location: Development VM");
+ expect(await selectedLocation.getAttribute("aria-label")).toBe(
+ "Selected location: Development VM",
+ );
+ expect(await quickActions.locator("[data-action='work-location']").count()).toBe(1);
const workLabelLineCount = await workLocationButton
.locator(".label")
.evaluate((element) => element.getClientRects().length);
@@ -185,11 +195,18 @@ describeControlUiE2e("PlatformClaw settings footer quick actions", () => {
.locator("[data-target='assigned_vm']")
.getAttribute("aria-pressed"),
).toBe("true");
- expect((await workLocationButton.textContent())?.trim()).toBe("Work location");
+ expect((await workLocationButton.locator(".label").textContent())?.trim()).toBe(
+ "Work location",
+ );
+ expect(await executionSettingsPanel.locator("[data-action='open']").count()).toBe(0);
await executionSettingsPanel.locator("[data-action='close']").click();
await executionSettingsPanel
.getByRole("dialog", { name: "Work environment settings", exact: true })
.waitFor({ state: "hidden" });
+ expect(await workLocationButton.isVisible()).toBe(true);
+ expect((await selectedLocation.textContent())?.trim()).toBe(
+ "Selected location: Development VM",
+ );
expect(await quickActions.locator("platformclaw-vm-administration").count()).toBe(0);
expect(await quickActions.locator("platformclaw-announcement-administration").count()).toBe(
diff --git a/ui/src/platformclaw/control-ui-adapter.test.ts b/ui/src/platformclaw/control-ui-adapter.test.ts
index 7bf0655c7c..ca4f430d74 100644
--- a/ui/src/platformclaw/control-ui-adapter.test.ts
+++ b/ui/src/platformclaw/control-ui-adapter.test.ts
@@ -160,6 +160,10 @@ describe("PlatformClawControlUiAdapter", () => {
expect(options.chatWorkingTip).toEqual(expect.any(Function));
expect(options.shellSession?.renderMainBanner).toEqual(expect.any(Function));
expect(options.shellSession?.renderPageHeaderAccessory).toEqual(expect.any(Function));
+ const header = document.createElement("div");
+ render(options.shellSession?.renderPageHeaderAccessory?.("chat", undefined), header);
+ expect(header.querySelector("platformclaw-page-help-trigger")).not.toBeNull();
+ expect(header.querySelector("platformclaw-quick-actions")).toBeNull();
const organizationTitle = options.navigation?.routeCopy?.organization?.title;
expect(typeof organizationTitle === "function" ? organizationTitle() : organizationTitle).toBe(
"Organization",
diff --git a/ui/src/platformclaw/control-ui-adapter.ts b/ui/src/platformclaw/control-ui-adapter.ts
index 700e09e0f9..53cd697208 100644
--- a/ui/src/platformclaw/control-ui-adapter.ts
+++ b/ui/src/platformclaw/control-ui-adapter.ts
@@ -164,20 +164,6 @@ export class PlatformClawControlUiAdapter {
() =>
html`
${t("platformClaw.quickActions.unavailable")}
`,
);
- // This is the selected personal profile, not the pinned location of an active run.
- const selectedLocation = quickActionsReady
- .then(
- () => html` `,
- )
- .catch(
- () => html`${t("platformClaw.execution.locationUnknown")} `,
- );
const joinPrompt = Promise.all([
import("./organization-join-prompt.ts"),
loadPlatformClawLocale(),
@@ -239,10 +225,7 @@ export class PlatformClawControlUiAdapter {
>${until(joinPrompt, nothing)}${until(vmRecovery, nothing)}
`,
- renderPageHeaderAccessory: (routeId, routeLocation) => html`
- ${renderPageHelpTrigger(routeId, routeLocation)}
- ${routeId === "chat" ? until(selectedLocation, nothing) : nothing}
- `,
+ renderPageHeaderAccessory: renderPageHelpTrigger,
renderPageOverlay: (routeId, routeLocation) => {
credentialFlow.visit(routeId);
const currentLocation = routeLocation ?? new URL(this.location.href);
diff --git a/ui/src/platformclaw/execution-location-status.ts b/ui/src/platformclaw/execution-location-status.ts
new file mode 100644
index 0000000000..bc9e7a7899
--- /dev/null
+++ b/ui/src/platformclaw/execution-location-status.ts
@@ -0,0 +1,84 @@
+import { css, html } from "lit";
+import type { ExecutionSettings } from "./execution-settings-view.ts";
+import { platformClawT as t } from "./i18n.ts";
+
+export const executionLocationStatusStyles = css`
+ .location-launcher-copy {
+ display: grid;
+ min-width: 0;
+ gap: 1px;
+ }
+ .location-status {
+ display: flex;
+ min-width: 0;
+ align-items: center;
+ gap: 5px;
+ color: var(--muted);
+ font-size: 11px;
+ }
+ .location-status-label {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+ .location-launcher-copy > .label {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+ .execution-dot {
+ width: 6px;
+ height: 6px;
+ flex: none;
+ border-radius: var(--radius-full);
+ background: var(--ok);
+ }
+ .location-status[data-state="loading"] .execution-dot {
+ background: var(--muted);
+ }
+ .location-status[data-state="warning"] .execution-dot,
+ .location-status[data-state="unavailable"] .execution-dot {
+ background: var(--warn);
+ }
+`;
+
+export function renderExecutionLocationStatus(
+ settings: ExecutionSettings | null | undefined,
+ loading: boolean,
+) {
+ const vmNeedsConnection =
+ !loading &&
+ settings?.activeTarget === "assigned_vm" &&
+ (settings.assignment?.status !== "ready" || settings.credentialStatus !== "current");
+ const status = loading
+ ? "loading"
+ : !settings
+ ? "unavailable"
+ : vmNeedsConnection
+ ? "warning"
+ : "ready";
+ const target = loading
+ ? t("common.loading")
+ : !settings
+ ? t("platformClaw.execution.locationUnknown")
+ : settings.activeTarget === "assigned_vm"
+ ? (settings.assignment?.vmLabel ?? t("platformClaw.execution.vm"))
+ : t("platformClaw.execution.basic");
+ const label = t("platformClaw.execution.selectedLocation", { target });
+ const detail = vmNeedsConnection
+ ? `${label} · ${t("platformClaw.execution.connectionRequired")}`
+ : label;
+ return html`
+ ${detail}
+ `;
+}
diff --git a/ui/src/platformclaw/execution-location-view.ts b/ui/src/platformclaw/execution-location-view.ts
index a449963b48..e0ed41733b 100644
--- a/ui/src/platformclaw/execution-location-view.ts
+++ b/ui/src/platformclaw/execution-location-view.ts
@@ -71,55 +71,59 @@ function renderCurrentLocation(settings: ExecutionSettings, busy: boolean) {
>${settings.activeTarget === "platform_server" ? "✓" : ""}
- ${settings.savedVms.map((vm) => {
- const active =
- settings.activeTarget === "assigned_vm" &&
- settings.assignment?.vmHostId === vm.vmHostId &&
- settings.assignment.linuxAccount === vm.linuxAccount;
- // Both captions reserve their wrapped size so changing the active VM
- // cannot resize the tile; only the current caption is visible and accessible.
- return html`
-
- ${vmIcon}${vm.vmLabel}
- ${t("platformClaw.execution.currentlyActive")} ${t(
- vm.status === "ready"
- ? "platformClaw.execution.connectionReady"
- : vm.status === "unavailable"
- ? "platformClaw.execution.connectionUnavailable"
- : "platformClaw.execution.reauthenticationRequired",
- )}
- ${active ? "✓" : ""}
-
-
- ${vm.linuxAccount} · ${vm.safeConnectLabel}
-
- ${t("platformClaw.execution.connectionSettings")}
-
-
- ${t("platformClaw.execution.forgetVm")}
-
-
- `;
- })}
+ ${settings.savedVms.length
+ ? html`
+ ${settings.savedVms.map((vm) => {
+ const active =
+ settings.activeTarget === "assigned_vm" &&
+ settings.assignment?.vmHostId === vm.vmHostId &&
+ settings.assignment.linuxAccount === vm.linuxAccount;
+ // Both captions reserve their wrapped size so changing the active VM
+ // cannot resize the tile; only the current caption is visible and accessible.
+ return html`
+
+ ${vmIcon}${vm.vmLabel}
+ ${t("platformClaw.execution.currentlyActive")} ${t(
+ vm.status === "ready"
+ ? "platformClaw.execution.connectionReady"
+ : vm.status === "unavailable"
+ ? "platformClaw.execution.connectionUnavailable"
+ : "platformClaw.execution.reauthenticationRequired",
+ )}
+ ${active ? "✓" : ""}
+
+
+ ${vm.linuxAccount} · ${vm.safeConnectLabel}
+
+ ${t("platformClaw.execution.connectionSettings")}
+
+
+ ${t("platformClaw.execution.forgetVm")}
+
+
+ `;
+ })}
+
`
+ : nothing}
${t("platformClaw.execution.availableVms")}
@@ -320,10 +324,10 @@ export function renderExecutionLocation(options: LocationOptions) {
}
export const executionLocationStyles = `
- .saved-vm{min-width:0;display:grid;gap:7px;border:1px solid var(--border);border-radius:var(--radius-md);padding:8px}.saved-vm .location-tile{width:100%;height:auto;min-height:62px}.location-copy{display:grid;gap:4px;min-width:0}.location-copy strong{overflow-wrap:anywhere}.location-copy small{font-size:11px;color:var(--muted)}.saved-vm-details{display:flex;flex-wrap:wrap;gap:6px;align-items:center}.saved-vm-details>span{flex:1 1 100%;font-size:11px;overflow-wrap:anywhere;color:var(--muted)}.saved-vm-details .button{font-size:11px;padding:5px 8px}.available-vms{display:flex;flex-wrap:wrap;gap:8px}.available-vms h4{flex:1 1 100%;margin:6px 0 0;font-size:12px;color:var(--muted)}.available-vm{display:flex;align-items:center;gap:7px;max-width:100%;text-align:start}.available-vm>svg{width:18px;height:18px;flex:none}.available-vm>span{overflow-wrap:anywhere}.available-vm>span:last-child{font-size:11px;color:var(--muted)}
+ .saved-vm{min-width:0;display:grid;grid-template-rows:1fr auto;gap:7px;border:1px solid var(--border);border-radius:var(--radius-md);padding:8px}.saved-vm .location-tile{width:100%;height:auto;min-height:62px}.location-copy{display:grid;gap:4px;min-width:0}.location-copy strong{overflow-wrap:anywhere}.location-copy small{font-size:11px;color:var(--muted)}.saved-vm-details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;align-items:stretch}.saved-vm-details>span{grid-column:1/-1;font-size:11px;overflow-wrap:anywhere;color:var(--muted)}.saved-vm-details .button{min-width:0;font-size:11px;padding:5px 8px}.available-vms{display:flex;flex-wrap:wrap;gap:8px}.available-vms h4{flex:1 1 100%;margin:6px 0 0;font-size:12px;color:var(--muted)}.available-vm{display:flex;align-items:center;gap:7px;max-width:100%;text-align:start}.available-vm>svg{width:18px;height:18px;flex:none}.available-vm>span{overflow-wrap:anywhere}.available-vm>span:last-child{font-size:11px;color:var(--muted)}
.location-state{display:grid}.location-state>span{grid-area:1/1;min-width:0}.location-state>[aria-hidden="true"]{visibility:hidden}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
- .current-location-card{display:grid;gap:10px}.location-targets{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
+ .current-location-card{display:grid;gap:10px;min-width:0}.location-targets{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(190px,1fr);gap:10px;overflow-x:auto}.location-targets>.location-tile{height:auto;min-height:62px}.saved-vms{display:contents}
.location-tile{display:grid;grid-template-columns:28px minmax(0,1fr) 16px;align-items:center;gap:9px;height:62px;min-width:0;padding:10px 12px;text-align:start;border:1px solid var(--border-strong);border-radius:var(--radius-md);background:var(--card);color:var(--text);cursor:pointer}
.location-tile>svg{width:27px;height:27px;color:var(--muted)}.location-tile strong{font-size:13px;line-height:1.3}.location-selected{color:var(--ok);font-weight:700}.location-tile[aria-pressed="true"]{border-color:var(--ok);background:color-mix(in srgb,var(--ok) 7%,var(--card));cursor:default}.location-tile[aria-pressed="true"]>svg{color:var(--ok)}.location-tile:disabled[aria-pressed="false"]{opacity:.5;cursor:not-allowed}.location-tile:hover:not(:disabled){background:var(--bg-hover)}.location-tile:focus-visible{outline:none;box-shadow:var(--focus-ring)}.location-boundary{font-size:12px;line-height:1.4;margin:0}
.vm-connection-card{display:grid;gap:14px}.vm-card-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.vm-edit{display:inline-flex;align-items:center;gap:5px;padding:5px 8px;font-size:12px}.vm-edit>svg{width:14px;height:14px}.vm-summary{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-bottom:12px;border-bottom:1px solid var(--border)}.vm-summary>div{display:grid;gap:3px}.vm-summary .muted{margin:0;font-size:12px}.vm-connection-state{font-size:12px;color:var(--warn)}.vm-connection-state[data-ready="true"]{color:var(--ok)}
diff --git a/ui/src/platformclaw/execution-settings-progress.test.ts b/ui/src/platformclaw/execution-settings-progress.test.ts
index b2dfd59dd9..a978e5bf50 100644
--- a/ui/src/platformclaw/execution-settings-progress.test.ts
+++ b/ui/src/platformclaw/execution-settings-progress.test.ts
@@ -163,7 +163,9 @@ describe("PlatformClaw layered execution progress", () => {
expect(root.querySelector("[data-settings-modal]")).toBe(settings.modal);
expect(settings.modal.querySelector("[data-target='platform_server']")).toBe(basicTile);
expectCurrentExecutionLocation(settings.modal, "platform_server", "Basic server");
- expect(root.querySelector("[data-action='open']")?.textContent?.trim()).toBe("Work location");
+ expect(root.querySelector("[data-action='open'] .label")?.textContent?.trim()).toBe(
+ "Work location",
+ );
expect(fetchImpl.mock.calls[1]).toEqual([
"/platformclaw/api/execution/target",
expect.objectContaining({
diff --git a/ui/src/platformclaw/execution-settings-shell.ts b/ui/src/platformclaw/execution-settings-shell.ts
index af8836c428..5b731c58ce 100644
--- a/ui/src/platformclaw/execution-settings-shell.ts
+++ b/ui/src/platformclaw/execution-settings-shell.ts
@@ -2,6 +2,10 @@ import { html, nothing, svg } from "lit";
import { unsafeHTML } from "lit/directives/unsafe-html.js";
import { strokeIcon } from "../components/icons-tools.ts";
import { icons } from "../components/icons.ts";
+import {
+ executionLocationStatusStyles,
+ renderExecutionLocationStatus,
+} from "./execution-location-status.ts";
import {
executionServerIcon,
executionLocationStyles,
@@ -39,6 +43,7 @@ type SettingsShellOptions = {
message: string;
messageKind: "info" | "error";
canRetryProgress: boolean;
+ hideLauncher: boolean;
};
const checkIcon = strokeIcon(svg`
`);
@@ -226,7 +231,8 @@ const shellStyles = `
.badge>svg{width:16px;height:16px;flex:none}
.panel main,.panel .tab-panel{align-content:start}
.header-actions{display:flex;align-items:center;gap:8px}.refresh-icon{display:grid;place-items:center;width:30px;height:30px;border:0;border-radius:var(--radius-md);background:transparent;color:var(--muted);cursor:pointer}.refresh-icon>svg{width:17px;height:17px}.refresh-icon:hover:not(:disabled){background:var(--bg-hover)}.refresh-icon:focus-visible{outline:none;box-shadow:var(--focus-ring)}.refresh-icon:disabled{opacity:.5;cursor:not-allowed}
- .panel[data-settings-panel]{height:min(720px,calc(100dvh - 48px));grid-template-rows:auto auto minmax(0,1fr) auto}
+ .modal{--openclaw-modal-width:min(var(--execution-settings-width,680px),calc(100vw - 32px))}
+ .panel[data-settings-panel]{width:100%;height:min(720px,calc(100dvh - 48px));grid-template-rows:auto auto minmax(0,1fr) auto}
.settings-content{display:contents;border:0;padding:0;margin:0;min-width:0}
.progress-modal{--openclaw-modal-width:min(440px,calc(100vw - 32px));--openclaw-modal-max-height:calc(100dvh - 32px);--openclaw-modal-backdrop-filter:none;--wa-color-overlay-modal:transparent;--wa-transition-normal:160ms}
.progress-panel{position:relative;display:grid;grid-template-rows:60px auto 40px auto auto;align-content:start;gap:8px;box-sizing:border-box;width:100%;height:min(312px,calc(90dvh - 32px));max-height:calc(100dvh - 32px);overflow:auto;padding:18px;border:1px solid var(--border-strong);border-radius:var(--radius-xl);background:var(--bg-elevated);color:var(--text);box-shadow:var(--shadow-xl)}
@@ -293,19 +299,27 @@ export function renderExecutionSettingsShell(options: SettingsShellOptions) {
return html`${unsafeHTML(renderExecutionSettingsStyles(warn))}
-
- ${busyMessage ? html` ` : icons.monitor}
- ${busyMessage || t("platformClaw.execution.workLocation")}
-
+ ${options.hideLauncher
+ ? nothing
+ : html`
+ ${busyMessage ? html` ` : icons.monitor}
+ ${busyMessage || t("platformClaw.execution.workLocation")} ${renderExecutionLocationStatus(options.settings, options.loading)}
+ `}
diff --git a/ui/src/platformclaw/execution-settings-view.ts b/ui/src/platformclaw/execution-settings-view.ts
index f3911edcda..9ececedef3 100644
--- a/ui/src/platformclaw/execution-settings-view.ts
+++ b/ui/src/platformclaw/execution-settings-view.ts
@@ -350,11 +350,6 @@ export function executionStatusView(
fallbackMessage: string,
fallbackKind: "info" | "error",
) {
- const badgeLabel = settings
- ? settings.activeTarget === "assigned_vm"
- ? (settings.assignment?.vmLabel ?? t("platformClaw.execution.vm"))
- : t("platformClaw.execution.basic")
- : t("platformClaw.execution.workLocation");
const busyMessage = executionBusyMessage(activity);
let message = busyMessage || fallbackMessage;
if (activity.kind === "success") {
@@ -389,7 +384,7 @@ export function executionStatusView(
!settings ||
settings.assignment?.status === "connection_required" ||
settings.credentialStatus === "update_required";
- return { badgeLabel, busyMessage, message, messageKind, warn };
+ return { busyMessage, message, messageKind, warn };
}
export type ExecutionCodingAgentView = {
diff --git a/ui/src/platformclaw/execution-settings.test.ts b/ui/src/platformclaw/execution-settings.test.ts
index e26381bacd..d1333714a7 100644
--- a/ui/src/platformclaw/execution-settings.test.ts
+++ b/ui/src/platformclaw/execution-settings.test.ts
@@ -39,7 +39,12 @@ describe("PlatformClaw execution settings", () => {
const unsubscribe = subscribeToPlatformClawExecutionTargetChanges(window, listener, () => {});
try {
const root = await mountExecutionSettings(fetchImpl);
- expect(root.querySelector("[data-action='open']")?.textContent?.trim()).toBe("Work location");
+ expect(root.querySelector("[data-action='open'] .label")?.textContent?.trim()).toBe(
+ "Work location",
+ );
+ expect(
+ root.querySelector("[data-action='open'] [data-location-status]")?.textContent,
+ ).toContain("Selected location: Basic server");
const switchButton = root.querySelector("[data-target='assigned_vm']")!;
switchButton.click();
switchButton.click();
@@ -65,9 +70,12 @@ describe("PlatformClaw execution settings", () => {
t("platformClaw.execution.switching", { target: "Development VM" }),
);
expect(root.querySelector("[data-action='open']")?.getAttribute("aria-busy")).toBe("true");
- expect(root.querySelector("[data-action='open']")?.textContent?.trim()).toBe(
+ expect(root.querySelector("[data-action='open'] .label")?.textContent?.trim()).toBe(
t("platformClaw.execution.switching", { target: "Development VM" }),
);
+ expect(
+ root.querySelector("[data-action='open'] [data-location-status]")?.textContent,
+ ).toContain("Selected location: Basic server");
expect(listener).not.toHaveBeenCalled();
target.resolve(executionSettingsResponse(changedSettings));
@@ -75,7 +83,12 @@ describe("PlatformClaw execution settings", () => {
await vi.waitFor(() => expect(listener).toHaveBeenCalledOnce());
expect(root.querySelector("[data-current-target]")?.textContent).toContain("Development VM");
expect(root.querySelector("[data-action='open']")?.getAttribute("aria-busy")).toBe("false");
- expect(root.querySelector("[data-action='open']")?.textContent?.trim()).toBe("Work location");
+ expect(root.querySelector("[data-action='open'] .label")?.textContent?.trim()).toBe(
+ "Work location",
+ );
+ expect(
+ root.querySelector("[data-action='open'] [data-location-status]")?.textContent,
+ ).toContain("Selected location: Development VM");
} finally {
unsubscribe();
}
@@ -154,7 +167,7 @@ describe("PlatformClaw execution settings", () => {
);
expect(root.querySelector("input[name='password']")?.value).toBe("");
expect(root.querySelector("[data-action='open']")?.getAttribute("aria-busy")).toBe("true");
- expect(root.querySelector("[data-action='open']")?.textContent?.trim()).toBe(
+ expect(root.querySelector("[data-action='open'] .label")?.textContent?.trim()).toBe(
t("platformClaw.execution.connecting"),
);
expect(listener).not.toHaveBeenCalled();
@@ -173,7 +186,9 @@ describe("PlatformClaw execution settings", () => {
expect(executionProgressState(root, "connection")).toBe("complete");
expect(root.querySelector("[data-current-target]")?.textContent).toContain("Development VM");
expect(root.querySelector("[data-action='open']")?.getAttribute("aria-busy")).toBe("false");
- expect(root.querySelector("[data-action='open']")?.textContent?.trim()).toBe("Work location");
+ expect(root.querySelector("[data-action='open'] .label")?.textContent?.trim()).toBe(
+ "Work location",
+ );
expect(listener).toHaveBeenCalledOnce();
expect(fetchImpl).toHaveBeenCalledTimes(2);
await i18n.setLocale("ko");
@@ -185,7 +200,9 @@ describe("PlatformClaw execution settings", () => {
expect(
root.querySelector("[data-progress-modal] .progress-message")?.textContent,
).not.toContain("Now using");
- expect(root.querySelector("[data-action='open']")?.textContent?.trim()).toBe("작업 위치");
+ expect(root.querySelector("[data-action='open'] .label")?.textContent?.trim()).toBe(
+ "작업 위치",
+ );
} finally {
unsubscribe();
}
@@ -320,7 +337,9 @@ describe("PlatformClaw execution settings", () => {
);
expect(root.querySelector("[data-current-target]")?.textContent).toContain("Development VM");
expect(root.querySelector("[data-progress-panel]")?.textContent).toContain("Second VM");
- expect(root.querySelector("[data-action='open']")?.textContent?.trim()).toBe("Work location");
+ expect(root.querySelector("[data-action='open'] .label")?.textContent?.trim()).toBe(
+ "Work location",
+ );
const keptLocation = t("platformClaw.execution.previousLocationKept", {
target: "Development VM",
});
@@ -337,7 +356,7 @@ describe("PlatformClaw execution settings", () => {
const retry = root.querySelector("[data-action='retry-progress']")!;
expect(retry.disabled).toBe(false);
retry.click();
- expect(root.querySelector("[data-action='open']")?.textContent?.trim()).toBe(
+ expect(root.querySelector("[data-action='open'] .label")?.textContent?.trim()).toBe(
t("platformClaw.execution.switching", { target: "Second VM" }),
);
await vi.waitFor(() =>
@@ -381,7 +400,9 @@ describe("PlatformClaw execution settings", () => {
expect(executionProgressState(root, "connection")).toBe("complete");
expect(executionProgressState(root, "activation")).toBe("complete");
expect(listener).toHaveBeenCalledOnce();
- expect(root.querySelector("[data-action='open']")?.textContent?.trim()).toBe("Work location");
+ expect(root.querySelector("[data-action='open'] .label")?.textContent?.trim()).toBe(
+ "Work location",
+ );
expect(fetchImpl.mock.calls.map(([path]) => path)).toEqual([
"/platformclaw/api/execution",
"/platformclaw/api/execution/selection",
@@ -415,7 +436,7 @@ describe("PlatformClaw execution settings", () => {
);
expect(root.querySelector("[data-action='open']")?.getAttribute("aria-busy")).toBe("true");
expectExecutionControlsDisabled(root);
- expect(root.querySelector("[data-action='open']")?.textContent?.trim()).toBe(
+ expect(root.querySelector("[data-action='open'] .label")?.textContent?.trim()).toBe(
t("platformClaw.execution.testing"),
);
verification.resolve(executionSettingsResponse(EXECUTION_SETTINGS));
diff --git a/ui/src/platformclaw/execution-settings.ts b/ui/src/platformclaw/execution-settings.ts
index 61591d96b0..d1b37bf2af 100644
--- a/ui/src/platformclaw/execution-settings.ts
+++ b/ui/src/platformclaw/execution-settings.ts
@@ -702,6 +702,7 @@ class PlatformClawExecutionSettingsElement extends HTMLElement {
message: this.message,
messageKind: this.messageKind,
canRetryProgress: canRetryExecutionProgress(this.settings, this.activity),
+ hideLauncher: this.hasAttribute("hide-launcher"),
}),
this.root,
);
diff --git a/ui/src/platformclaw/quick-actions.test.ts b/ui/src/platformclaw/quick-actions.test.ts
index 91c80efc01..6b5fb4368f 100644
--- a/ui/src/platformclaw/quick-actions.test.ts
+++ b/ui/src/platformclaw/quick-actions.test.ts
@@ -4,7 +4,7 @@ import {
notifyPlatformClawExecutionSettingsChanged,
notifyPlatformClawExecutionTargetChanged,
} from "./execution-target-events.ts";
-import { loadPlatformClawLocale } from "./i18n.ts";
+import { loadPlatformClawLocale, platformClawT as t } from "./i18n.ts";
import { PlatformClawQuickActionsElement } from "./quick-actions.ts";
function jsonResponse(body: unknown): Response {
@@ -27,7 +27,6 @@ async function mount(
options: {
fetchImpl?: typeof fetch;
vocEnabled?: boolean;
- locationOnly?: boolean;
onUnauthenticated?: () => void;
} = {},
) {
@@ -37,7 +36,6 @@ async function mount(
element.fetchImpl =
options.fetchImpl ?? vi.fn(async () => jsonResponse(BASIC_EXECUTION_SETTINGS));
element.vocEnabled = options.vocEnabled ?? false;
- element.locationOnly = options.locationOnly ?? false;
element.onUnauthenticated = options.onUnauthenticated ?? (() => {});
document.body.append(element);
await element.updateComplete;
@@ -89,13 +87,45 @@ describe("platformclaw-quick-actions", () => {
expect(messenger?.classList.contains("span-two")).toBe(true);
});
- it("opens the existing execution settings control", async () => {
- const member = await mount();
- member.shadowRoot?.querySelector('[data-action="work-location"]')?.click();
-
+ it("keeps the named location inside the same launcher after opening and closing settings", async () => {
+ let vmLabel = "Research VM";
+ const fetchImpl = vi.fn(async () =>
+ jsonResponse({
+ ...BASIC_EXECUTION_SETTINGS,
+ activeTarget: "assigned_vm",
+ assignment: { status: "ready", vmLabel },
+ }),
+ );
+ const member = await mount({ fetchImpl });
+ const launcher = member.shadowRoot!.querySelector(
+ '[data-action="work-location"]',
+ )!;
+ expect(member.shadowRoot?.querySelector("platformclaw-execution-settings")).toBeNull();
await vi.waitFor(() =>
- expect(member.shadowRoot?.querySelector("platformclaw-execution-settings")).not.toBeNull(),
+ expect(launcher.querySelector("[data-location-status]")?.textContent).toContain(
+ "Research VM",
+ ),
);
+ launcher.click();
+ await vi.waitFor(() => {
+ const settings = member.shadowRoot?.querySelector("platformclaw-execution-settings");
+ expect(settings?.shadowRoot?.querySelector("[data-settings-modal]")).not.toBeNull();
+ expect(settings?.shadowRoot?.querySelector('[data-action="open"]')).toBeNull();
+ });
+ expect(member.shadowRoot?.querySelector('[data-action="work-location"]')).toBe(launcher);
+ const settingsRoot = member.shadowRoot!.querySelector(
+ "platformclaw-execution-settings",
+ )!.shadowRoot!;
+ settingsRoot.querySelector('[data-action="close"]')!.click();
+ expect(settingsRoot.querySelector("[data-settings-modal]")).toHaveProperty("open", false);
+ vmLabel = "Build VM";
+ notifyPlatformClawExecutionTargetChanged();
+ await vi.waitFor(() =>
+ expect(launcher.querySelector("[data-location-status]")?.textContent).toContain("Build VM"),
+ );
+ expect(launcher.querySelector(".label")?.textContent).toBe("Work location");
+ expect(launcher.textContent).not.toContain("Research VM");
+ expect(fetchImpl).toHaveBeenCalledTimes(2);
});
it("refreshes the visible location status when credential state changes without a target revision change", async () => {
@@ -108,7 +138,7 @@ describe("platformclaw-quick-actions", () => {
assignment: { id: "allocation-one", vmLabel: "Build VM", status: "ready" },
}),
);
- const element = await mount({ locationOnly: true, fetchImpl });
+ const element = await mount({ fetchImpl });
await vi.waitFor(() =>
expect(element.shadowRoot?.querySelector("[role='status']")?.getAttribute("data-state")).toBe(
"ready",
@@ -162,18 +192,19 @@ describe("platformclaw-quick-actions", () => {
...(scenario.status ? { assignment: { status: scenario.status } } : {}),
}),
);
- const element = await mount({ locationOnly: true, fetchImpl });
+ const element = await mount({ fetchImpl });
await vi.waitFor(() => {
- const indicator = element.shadowRoot?.querySelector('[role="status"]');
+ const launcher = element.shadowRoot?.querySelector('[data-action="work-location"]');
+ const indicator = launcher?.querySelector('[data-location-status][role="status"]');
+ expect(launcher?.querySelector(".label")?.textContent).toBe("Work location");
+ expect(launcher?.getAttribute("aria-label")).toBe(t("platformClaw.execution.openSettings"));
expect(indicator?.getAttribute("data-state")).toBe(scenario.state);
expect(indicator?.getAttribute("aria-label")).toContain(
`Selected location: ${scenario.label}`,
);
});
- expect(
- element.shadowRoot?.querySelector("button, a, platformclaw-execution-settings"),
- ).toBeNull();
+ expect(element.shadowRoot?.querySelector("platformclaw-execution-settings")).toBeNull();
expect(fetchImpl).toHaveBeenCalledExactlyOnceWith("/platformclaw/api/execution", {
credentials: "same-origin",
headers: { Accept: "application/json" },
@@ -198,7 +229,7 @@ describe("platformclaw-quick-actions", () => {
assignment: { status: "ready" },
}),
);
- const element = await mount({ locationOnly: true, fetchImpl });
+ const element = await mount({ fetchImpl });
expect(element.shadowRoot?.querySelector('[role="status"]')?.getAttribute("data-state")).toBe(
"loading",
);
@@ -217,7 +248,7 @@ describe("platformclaw-quick-actions", () => {
.fn()
.mockResolvedValueOnce(jsonResponse(BASIC_EXECUTION_SETTINGS))
.mockResolvedValueOnce(new Response("unavailable", { status: 503 }));
- const element = await mount({ locationOnly: true, fetchImpl });
+ const element = await mount({ fetchImpl });
await vi.waitFor(() => expect(element.shadowRoot?.textContent).toContain("Basic server"));
notifyPlatformClawExecutionTargetChanged();
await vi.waitFor(() =>
@@ -232,7 +263,7 @@ describe("platformclaw-quick-actions", () => {
expect(fetchImpl).toHaveBeenCalledTimes(2);
});
- it("refreshes the named VM in the header after a direct VM-to-VM change", async () => {
+ it("refreshes the named VM inside the launcher after a direct VM-to-VM change", async () => {
const fetchImpl = vi.fn();
for (const vmLabel of ["Research VM", "Build VM"]) {
fetchImpl.mockResolvedValueOnce(
@@ -243,10 +274,12 @@ describe("platformclaw-quick-actions", () => {
}),
);
}
- const element = await mount({ locationOnly: true, fetchImpl });
+ const element = await mount({ fetchImpl });
const expectLocation = async (label: string) => {
await vi.waitFor(() => {
- const indicator = element.shadowRoot?.querySelector('[role="status"]');
+ const indicator = element.shadowRoot?.querySelector(
+ '[data-action="work-location"] [data-location-status]',
+ );
expect(indicator?.textContent?.trim()).toBe(label);
expect(indicator?.getAttribute("aria-label")).toBe(label);
expect(indicator?.getAttribute("title")).toContain(label);
@@ -273,7 +306,7 @@ describe("platformclaw-quick-actions", () => {
assignment: { status: "ready" },
}),
);
- const element = await mount({ locationOnly: true, fetchImpl });
+ const element = await mount({ fetchImpl });
await vi.waitFor(() => expect(element.shadowRoot?.textContent).toContain("Basic server"));
window.dispatchEvent(new Event("focus"));
await vi.waitFor(() =>
@@ -285,7 +318,7 @@ describe("platformclaw-quick-actions", () => {
it("uses the existing session-expiry handler without presenting a fallback target", async () => {
const fetchImpl = vi.fn(async () => new Response(null, { status: 401 }));
const onUnauthenticated = vi.fn();
- const element = await mount({ locationOnly: true, fetchImpl, onUnauthenticated });
+ const element = await mount({ fetchImpl, onUnauthenticated });
await vi.waitFor(() => expect(onUnauthenticated).toHaveBeenCalledOnce());
expect(element.shadowRoot?.textContent).not.toContain("Basic server");
});
diff --git a/ui/src/platformclaw/quick-actions.ts b/ui/src/platformclaw/quick-actions.ts
index 5833f60e93..c734783bed 100644
--- a/ui/src/platformclaw/quick-actions.ts
+++ b/ui/src/platformclaw/quick-actions.ts
@@ -3,6 +3,10 @@ import { property, state } from "lit/decorators.js";
import { unsafeSVG } from "lit/directives/unsafe-svg.js";
import { icons } from "../components/icons.ts";
import { OpenClawLitElement } from "../lit/openclaw-element.ts";
+import {
+ executionLocationStatusStyles,
+ renderExecutionLocationStatus,
+} from "./execution-location-status.ts";
import type { ExecutionSettings } from "./execution-settings-view.ts";
import {
subscribeToPlatformClawExecutionSettingsChanges,
@@ -17,18 +21,15 @@ export class PlatformClawQuickActionsElement extends OpenClawLitElement {
@property({ attribute: false }) fetchImpl: typeof fetch = globalThis.fetch.bind(globalThis);
@property({ attribute: false }) onUnauthenticated: () => void = () => undefined;
@property({ type: Boolean }) vocEnabled = false;
- @property({ type: Boolean, attribute: "location-only", reflect: true }) locationOnly = false;
@state() private executionSettingsLoaded = false;
- @state() private executionTarget: "platform_server" | "assigned_vm" | null = null;
+ @state() private executionSettingsSnapshot: ExecutionSettings | undefined;
@state() private executionLoading = true;
@state() private vocOpen = false;
- private executionSettingsSnapshot: ExecutionSettings | undefined;
private executionRequest = 0;
private unsubscribeExecutionTarget = () => {};
private unsubscribeExecutionSettings = () => {};
private readonly clearExecutionTarget = () => {
- this.executionTarget = null;
this.executionSettingsSnapshot = undefined;
};
private readonly refreshExecutionTarget = () => {
@@ -41,103 +42,80 @@ export class PlatformClawQuickActionsElement extends OpenClawLitElement {
}
};
- static override styles = css`
- :host {
- display: grid;
- min-width: 0;
- gap: 4px;
- }
- :host([location-only]) {
- display: inline-flex;
- max-width: 160px;
- }
- .location-status {
- display: inline-flex;
- align-items: center;
- min-width: 0;
- gap: 6px;
- color: var(--muted-strong);
- font-size: 12px;
- }
- .location-status[data-state="loading"] .execution-dot {
- background: var(--muted);
- }
- .location-status[data-state="warning"] .execution-dot,
- .location-status[data-state="unavailable"] .execution-dot {
- background: var(--warn);
- }
- .grid {
- display: grid;
- min-width: 0;
- grid-template-columns: repeat(2, minmax(0, 1fr));
- gap: 4px;
- }
- platformclaw-execution-settings,
- .action {
- min-width: 0;
- }
- .action {
- box-sizing: border-box;
- display: flex;
- width: 100%;
- min-height: 34px;
- align-items: center;
- gap: 7px;
- overflow: hidden;
- border: 0;
- border-radius: var(--radius-md);
- padding: 7px 9px;
- background: transparent;
- color: var(--muted-strong);
- font: 13px/1.45 var(--font-sans, system-ui, sans-serif);
- text-align: left;
- text-decoration: none;
- cursor: pointer;
- transition:
- background var(--duration-fast) ease,
- color var(--duration-fast) ease;
- }
- .action:hover,
- .action:focus-visible {
- background: var(--bg-hover);
- color: var(--text);
- outline: none;
- }
- .split-action {
- justify-content: center;
- }
- .action svg {
- width: 16px;
- height: 16px;
- flex: none;
- }
- .messenger {
- position: relative;
- }
- .messenger--split::before {
- position: absolute;
- top: 9px;
- bottom: 9px;
- left: 0;
- border-left: 1px solid var(--border);
- content: "";
- }
- .execution-dot {
- width: 7px;
- height: 7px;
- flex: none;
- border-radius: var(--radius-full);
- background: var(--ok);
- }
- .label {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .span-two {
- grid-column: 1 / -1;
- }
- `;
+ static override styles = [
+ executionLocationStatusStyles,
+ css`
+ :host {
+ display: grid;
+ min-width: 0;
+ gap: 4px;
+ }
+ .grid {
+ display: grid;
+ min-width: 0;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 4px;
+ }
+ platformclaw-execution-settings,
+ .action {
+ min-width: 0;
+ }
+ .action {
+ box-sizing: border-box;
+ display: flex;
+ width: 100%;
+ min-height: 34px;
+ align-items: center;
+ gap: 7px;
+ overflow: hidden;
+ border: 0;
+ border-radius: var(--radius-md);
+ padding: 7px 9px;
+ background: transparent;
+ color: var(--muted-strong);
+ font: 13px/1.45 var(--font-sans, system-ui, sans-serif);
+ text-align: left;
+ text-decoration: none;
+ cursor: pointer;
+ transition:
+ background var(--duration-fast) ease,
+ color var(--duration-fast) ease;
+ }
+ .action:hover,
+ .action:focus-visible {
+ background: var(--bg-hover);
+ color: var(--text);
+ outline: none;
+ }
+ .split-action {
+ justify-content: center;
+ }
+ .action svg {
+ width: 16px;
+ height: 16px;
+ flex: none;
+ }
+ .messenger {
+ position: relative;
+ }
+ .messenger--split::before {
+ position: absolute;
+ top: 9px;
+ bottom: 9px;
+ left: 0;
+ border-left: 1px solid var(--border);
+ content: "";
+ }
+ .label {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+ .span-two {
+ grid-column: 1 / -1;
+ }
+ `,
+ ];
override connectedCallback(): void {
super.connectedCallback();
@@ -192,7 +170,6 @@ export class PlatformClawQuickActionsElement extends OpenClawLitElement {
}
if (settings.activeTarget === "platform_server" || settings.activeTarget === "assigned_vm") {
this.executionSettingsSnapshot = settings;
- this.executionTarget = settings.activeTarget;
}
} catch {
// The launcher remains usable; the full view reports actionable errors when opened.
@@ -218,39 +195,6 @@ export class PlatformClawQuickActionsElement extends OpenClawLitElement {
}
override render() {
- if (this.locationOnly) {
- const settings = this.executionSettingsSnapshot;
- const vmNeedsConnection =
- this.executionTarget === "assigned_vm" &&
- (settings?.assignment?.status !== "ready" || settings.credentialStatus !== "current");
- const status = this.executionLoading
- ? "loading"
- : !this.executionTarget
- ? "unavailable"
- : vmNeedsConnection
- ? "warning"
- : "ready";
- const target = this.executionLoading
- ? t("common.loading")
- : !this.executionTarget
- ? t("platformClaw.execution.locationUnknown")
- : this.executionTarget === "assigned_vm"
- ? (settings?.assignment?.vmLabel ?? t("platformClaw.execution.vm"))
- : t("platformClaw.execution.basic");
- const label = t("platformClaw.execution.selectedLocation", { target });
- const detail = vmNeedsConnection
- ? `${label} · ${t("platformClaw.execution.connectionRequired")}`
- : label;
- return html`
- ${detail}
- `;
- }
return html`
${this.vocEnabled
@@ -272,22 +216,31 @@ export class PlatformClawQuickActionsElement extends OpenClawLitElement {
${unsafeSVG(messengerIcon)}
${t("platformClaw.quickActions.messenger")}
+
void this.openExecutionSettings()}
+ aria-label=${t("platformClaw.execution.openSettings")}
+ aria-describedby="execution-location-status"
+ >
+ ${icons.monitor}${t("platformClaw.execution.workLocation")} ${renderExecutionLocationStatus(
+ this.executionSettingsSnapshot,
+ this.executionLoading,
+ )}
+
${this.executionSettingsLoaded
? html`
`
- : html`
void this.openExecutionSettings()}
- aria-label=${t("platformClaw.execution.openSettings")}
- >
- ${icons.monitor}${t("platformClaw.execution.workLocation")}
- `}
+ : null}
${this.vocOpen
? html`