Skip to content

Commit 8870e4a

Browse files
authored
fix(ui): remove duplicate OpenClaw shortcut from Inbox (#135008)
Keep the Home dock as the shared entry to the selected agent and Ask OpenClaw. Remove the obsolete Inbox shortcut and its mobile button clearance while preserving issue-specific diagnostic actions.
1 parent 3e37496 commit 8870e4a

9 files changed

Lines changed: 93 additions & 131 deletions

‎docs/web/control-ui.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ When your connection is bound to an authenticated Gateway profile, theme, theme
186186

187187
## OpenClaw system care
188188

189-
Open **Settings → Ask OpenClaw** to talk to the system setup and repair agent. Toggle it from anywhere with the lobster button in the sidebar footer or the **Ask OpenClaw** command-palette action. The full page and dockable panel share one machine-wide conversation whose durable history lives on the Gateway. Closing the UI never cancels a turn; reopening Ask OpenClaw shows the completed conversation. The panel docks on the right or bottom, remembers its placement and size in the browser profile, and hides itself while the full page is open.
189+
Open **Settings → Ask OpenClaw** to talk to the system setup and repair agent. To open it alongside your current page, click **Home** in the sidebar footer and select the **Ask OpenClaw** tab, or use the **Ask OpenClaw** command-palette action. The full page and dockable panel share one machine-wide conversation whose durable history lives on the Gateway. Closing the UI never cancels a turn; reopening Ask OpenClaw shows the completed conversation. The panel docks on the right or bottom, remembers its placement and size in the browser profile, and hides itself while the full page is open.
190190

191191
If no AI provider is configured, Ask OpenClaw offers **Connect an AI provider**. If a configured runtime fails to start or verify, the conversation stays visible with the actual error and **Retry**. Sending stays disabled until verification succeeds. Retry checks the runtime without resending your earlier message or clearing your draft.
192192

‎ui/src/components/sidebar-attention-panel.runtime.ts‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
} from "./sidebar-attention-entries.ts";
1919
import {
2020
renderSidebarApprovalItem,
21-
renderSidebarAskOpenClawButton,
2221
renderSidebarIssueItem,
2322
renderSidebarScopeUpgradeItem,
2423
renderSidebarUpdateSurface,
@@ -66,14 +65,6 @@ export function renderSidebarAttentionPanel(params: SidebarAttentionPanelParams)
6665
);
6766
const hasVisibleDismissals = visibleDismissals.length > 0;
6867
const tabCounts = sidebarInboxTabCounts(params.entries);
69-
const custodianItems = params.entries.filter(
70-
(entry) => entry.type === "attention" && entry.action.kind === "askCustodian",
71-
);
72-
const custodianSeverity = custodianItems.some((item) => item.severity === "error")
73-
? "error"
74-
: custodianItems.length
75-
? "warning"
76-
: null;
7768
const renderEntry = (entry: SidebarInboxEntry) => {
7869
const dismissal = entry.dismissal;
7970
const onDismiss = dismissal ? () => params.onDismiss(dismissal) : undefined;
@@ -151,11 +142,6 @@ export function renderSidebarAttentionPanel(params: SidebarAttentionPanelParams)
151142
>
152143
${t("attention.dismissShown")}
153144
</button>
154-
${renderSidebarAskOpenClawButton({
155-
count: custodianItems.length,
156-
severity: custodianSeverity,
157-
snapshot: params.context.gateway.snapshot,
158-
})}
159145
<button
160146
type="button"
161147
class="sidebar-brand__icon sidebar-issues-panel__mobile-close"

‎ui/src/components/sidebar-attention.test.ts‎

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
} from "../test-helpers/application-context.ts";
1414
import { createStorageMock as createTestStorageMock } from "../test-helpers/storage.ts";
1515
import { waitForFast } from "../test-helpers/wait-for.ts";
16+
import { CUSTODIAN_PANEL_TOGGLE_EVENT } from "./panel-toggle-contract.ts";
1617
import {
1718
dismissSidebarAttention,
1819
dismissalStoreKey,
@@ -552,7 +553,7 @@ describe("sidebar attention refresh ownership", () => {
552553
{ enabled: true, triggersEnabled: true, jobs: 1 },
553554
{ enabled: true, triggersEnabled: true, jobs: 0 },
554555
],
555-
"models.authStatus": [{ ts: 1, providers: [] }],
556+
"models.authStatus": [authStatus(1)],
556557
};
557558
const request = vi.fn((method: keyof typeof responses) => {
558559
const response = responses[method].shift();
@@ -565,7 +566,10 @@ describe("sidebar attention refresh ownership", () => {
565566
const snapshot = {
566567
client,
567568
phase: "connected",
568-
hello: null,
569+
hello: {
570+
auth: { role: "operator", scopes: ["operator.admin"] },
571+
features: { methods: ["openclaw.chat"] },
572+
},
569573
assistantAgentId: "main",
570574
sessionKey: "agent:main:main",
571575
lastError: null,
@@ -628,6 +632,33 @@ describe("sidebar attention refresh ownership", () => {
628632
expect(panel.style.top).toBe("50px");
629633
expect(panel.style.bottom).toBe("");
630634
expect(panel.style.getPropertyValue("--sidebar-issues-panel-top")).toBe("50px");
635+
expect(
636+
Array.from(
637+
panel.querySelectorAll("header button"),
638+
(button) => button.getAttribute("aria-label") ?? button.textContent,
639+
).some((label) => label?.includes("Ask OpenClaw")),
640+
).toBe(false);
641+
642+
const { custodianAlertStore } = await import("../pages/custodian/custodian-alert-store.ts");
643+
const dispatch = vi.spyOn(window, "dispatchEvent");
644+
try {
645+
const alertAction = panel.querySelector<HTMLButtonElement>(
646+
'[data-attention-kind="modelAuthExpired"] .sidebar-issues-panel__action:not(.sidebar-issues-panel__action--primary)',
647+
)!;
648+
expect(alertAction.textContent?.trim()).toBe("Ask OpenClaw");
649+
alertAction.click();
650+
await waitForFast(() =>
651+
expect(dispatch).toHaveBeenCalledWith(
652+
expect.objectContaining({ type: CUSTODIAN_PANEL_TOGGLE_EVENT, detail: { open: true } }),
653+
),
654+
);
655+
expect(custodianAlertStore.alert?.id).toBe("modelAuthExpired:agent:main\nopenai");
656+
expect(element.querySelector(".sidebar-issues-panel")).toBeNull();
657+
} finally {
658+
custodianAlertStore.dismiss();
659+
}
660+
trigger.click();
661+
await waitForFast(() => expect(element.querySelector(".sidebar-issues-panel")).not.toBeNull());
631662

632663
eventListener?.({ type: "event", event: "cron", payload: {} });
633664
await waitForFast(() =>

‎ui/src/components/sidebar-issue-item.ts‎

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { sessionNavigationTarget } from "../lib/sessions/route-navigation.ts";
1212
import { areUiSessionKeysEquivalent } from "../lib/sessions/session-key.ts";
1313
import { renderSidebarApprovalRow } from "./exec-approval-card.ts";
1414
import { icons } from "./icons.ts";
15-
import { CUSTODIAN_PANEL_TOGGLE_EVENT } from "./panel-toggle-contract.ts";
1615
import type { SidebarAttentionItem } from "./sidebar-attention-entries.ts";
1716
import "./sidebar-update-card.ts";
1817

@@ -43,40 +42,6 @@ function renderSidebarDismissButton(itemLabel: string, onDismiss?: () => void) {
4342
</button>`;
4443
}
4544

46-
export function renderSidebarAskOpenClawButton(params: {
47-
count: number;
48-
severity: "error" | "warning" | null;
49-
snapshot: ApplicationContext["gateway"]["snapshot"] | undefined;
50-
}) {
51-
if (!canCallGatewayMethod(params.snapshot, "openclaw.chat", "operator.admin")) {
52-
return nothing;
53-
}
54-
const label = params.count
55-
? t(params.count === 1 ? "attention.custodianAlertAria" : "attention.custodianAlertsAria", {
56-
count: String(params.count),
57-
})
58-
: t("nav.askOpenClaw");
59-
return html`<openclaw-tooltip .content=${label}>
60-
<button
61-
type="button"
62-
class="sidebar-brand__icon sidebar-footer-bar__custodian sidebar-issues-panel__ask"
63-
aria-label=${label}
64-
@click=${() => window.dispatchEvent(new CustomEvent(CUSTODIAN_PANEL_TOGGLE_EVENT))}
65-
>
66-
<span class="sidebar-footer-bar__custodian-glyph">
67-
${icons.lobster}
68-
${params.count
69-
? html`<span
70-
class="session-glyph__badge sidebar-footer-bar__custodian-badge sidebar-footer-bar__custodian-badge--${params.severity ??
71-
"warning"}"
72-
aria-hidden="true"
73-
></span>`
74-
: nothing}
75-
</span>
76-
</button>
77-
</openclaw-tooltip>`;
78-
}
79-
8045
export function renderSidebarApprovalItem(params: {
8146
approval: ExecApprovalRequest;
8247
context: ApplicationContext | undefined;

‎ui/src/e2e/custodian-panel-toggle.e2e.test.ts‎

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { beforeEach, afterAll, beforeAll, describe, expect, it } from "vitest";
55
import { createControlUiE2eArtifactDir } from "../test-helpers/control-ui-e2e-artifacts.ts";
66
import {
77
canRunPlaywrightChromium,
8+
controlUiSessionUrl,
89
installMockGateway,
910
resolvePlaywrightChromiumExecutablePath,
1011
startControlUiE2eServer,
@@ -22,13 +23,22 @@ beforeEach(() => {
2223

2324
const CUSTODIAN_SESSION_STORAGE_KEY = "openclaw.custodian.session.v1";
2425
const MOCK_SESSION_ID = "e2e-custodian-panel";
26+
const WORK_SESSION_KEY = "agent:main:work";
2527

2628
let browser: Browser;
2729
let server: ControlUiE2eServer;
2830

2931
function custodianGatewayScenario() {
3032
return {
31-
featureMethods: ["chat.metadata", "chat.startup", "openclaw.chat", "openclaw.chat.history"],
33+
sessionKey: WORK_SESSION_KEY,
34+
featureMethods: [
35+
"chat.metadata",
36+
"chat.startup",
37+
"chat.history",
38+
"chat.send",
39+
"openclaw.chat",
40+
"openclaw.chat.history",
41+
],
3242
methodResponses: {
3343
"openclaw.chat": {
3444
sessionId: MOCK_SESSION_ID,
@@ -59,32 +69,41 @@ describeControlUiE2e("Control UI Ask OpenClaw panel toggle mocked Gateway E2E",
5969
await server?.close();
6070
});
6171

62-
it("hides the sidebar footer toggle when openclaw.chat is not advertised", async () => {
72+
it("keeps Home available without an OpenClaw tab when openclaw.chat is not advertised", async () => {
6373
const context = await browser.newContext({
6474
colorScheme: "dark",
6575
locale: "en-US",
6676
serviceWorkers: "block",
6777
viewport: { height: 900, width: 1280 },
6878
});
6979
const page = await context.newPage();
70-
await installMockGateway(page, { featureMethods: ["chat.metadata", "chat.startup"] });
80+
const gateway = await installMockGateway(page, {
81+
sessionKey: WORK_SESSION_KEY,
82+
featureMethods: ["chat.metadata", "chat.startup", "chat.history", "chat.send"],
83+
});
7184

7285
try {
73-
const response = await page.goto(`${server.baseUrl}chat`);
86+
const response = await page.goto(controlUiSessionUrl(server.baseUrl, WORK_SESSION_KEY));
7487
expect(response?.status()).toBe(200);
7588
await page.locator(".shell-chrome-controls__search").waitFor();
7689
await page.locator(".sidebar-identity-card").waitFor();
77-
await expect.poll(() => page.locator(".sidebar-footer-bar__custodian").count()).toBe(0);
90+
await page.locator(".sidebar-footer-bar__home").click();
91+
const panel = page.locator("openclaw-assistant-panel");
92+
await panel.getByRole("button", { name: "Home", exact: true }).waitFor();
93+
expect(await panel.getByRole("button", { name: "Ask OpenClaw", exact: true }).count()).toBe(
94+
0,
95+
);
96+
expect(await gateway.getRequests("openclaw.chat")).toHaveLength(0);
7897
await page.screenshot({
7998
animations: "disabled",
80-
path: path.join(artifactDir, "00-gated-off-no-button.png"),
99+
path: path.join(artifactDir, "00-home-without-openclaw-tab.png"),
81100
});
82101
} finally {
83102
await context.close();
84103
}
85104
});
86105

87-
it("toggles the panel from the sidebar and palette and reuses the persisted session id", async () => {
106+
it("opens OpenClaw from Home and the palette and reuses the persisted session id", async () => {
88107
const context = await browser.newContext({
89108
colorScheme: "dark",
90109
locale: "en-US",
@@ -96,22 +115,20 @@ describeControlUiE2e("Control UI Ask OpenClaw panel toggle mocked Gateway E2E",
96115
const gateway = await installMockGateway(page, custodianGatewayScenario());
97116

98117
try {
99-
const response = await page.goto(`${server.baseUrl}chat`);
118+
const response = await page.goto(controlUiSessionUrl(server.baseUrl, WORK_SESSION_KEY));
100119
expect(response?.status()).toBe(200);
101120

102-
// Ask OpenClaw lives in the Inbox header and renders only while
103-
// openclaw.chat is advertised.
104-
await page.locator(".sidebar-issues-button").click();
105-
const footerToggle = page.locator(".sidebar-issues-panel__ask");
106-
await footerToggle.waitFor();
121+
await page.locator(".sidebar-footer-bar__home").click();
122+
const panel = page.locator("openclaw-assistant-panel");
123+
const openClawTab = panel.getByRole("button", { name: "Ask OpenClaw", exact: true });
124+
await openClawTab.waitFor();
107125
await page.screenshot({
108126
animations: "disabled",
109-
path: path.join(artifactDir, "01-sidebar-footer-button.png"),
127+
path: path.join(artifactDir, "01-home-dock.png"),
110128
});
111129

112130
// Opening the panel renders the durable machine-wide history from the Gateway.
113-
await footerToggle.click();
114-
const panel = page.locator("openclaw-assistant-panel");
131+
await openClawTab.click();
115132
await panel.getByText("Channel repaired.").waitFor();
116133
const chatRequest = await gateway.waitForRequest("openclaw.chat");
117134
const firstSessionId = (chatRequest.params as { sessionId?: string }).sessionId;
@@ -121,26 +138,19 @@ describeControlUiE2e("Control UI Ask OpenClaw panel toggle mocked Gateway E2E",
121138
path: path.join(artifactDir, "02-panel-open-history.png"),
122139
});
123140

124-
// The same Inbox action closes it again.
125-
await footerToggle.click();
141+
await panel.getByRole("button", { name: "Close assistant sidebar", exact: true }).click();
126142
await panel.getByText("Channel repaired.").waitFor({ state: "hidden" });
127143

128-
// The command palette exposes the same toggle from anywhere. Its action
129-
// dispatches the identical toggle event the Inbox action uses (pinned by
130-
// the palette unit test), so this asserts the gated entry exists and
131-
// reopens through the Inbox path — the palette click-through composition
132-
// proved timing-flaky on loaded CI runners without adding coverage.
144+
// The command palette opens the same conversation directly.
133145
await page.locator(".shell-chrome-controls__search").click();
134146
await page.getByPlaceholder("Search chats and commands…").fill("Ask OpenClaw");
135-
const paletteItem = page.locator(".cmd-palette__item--active", { hasText: "Ask OpenClaw" });
147+
const paletteItem = page.getByRole("option", { name: "Ask OpenClaw", exact: true });
136148
await paletteItem.waitFor();
137149
await page.screenshot({
138150
animations: "disabled",
139151
path: path.join(artifactDir, "03-palette-item.png"),
140152
});
141-
await page.keyboard.press("Escape");
142-
await page.locator(".sidebar-issues-button").click();
143-
await page.locator(".sidebar-issues-panel__ask").click();
153+
await paletteItem.click();
144154
await panel.getByText("Channel repaired.").waitFor();
145155

146156
// The server-confirmed session id persists and is reused after a full reload.

‎ui/src/e2e/inference-setup-gate.e2e.test.ts‎

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { beforeEach, expect, it } from "vitest";
33
import { createControlUiE2eArtifactDir } from "../test-helpers/control-ui-e2e-artifacts.ts";
44
import {
55
createNewSessionPageE2eSuite,
6+
controlUiSessionUrl,
67
installMockGateway,
78
} from "./new-session-page.test-support.ts";
89

@@ -144,8 +145,16 @@ suite.define(() => {
144145
const runtimeError =
145146
"OpenClaw requires working inference: The configured runtime could not start. Repair the launcher and retry.";
146147
const gateway = await installMockGateway(page, {
148+
sessionKey: "agent:main:work",
147149
deferredMethods: ["openclaw.chat"],
148-
featureMethods: ["chat.metadata", "chat.startup", "openclaw.chat", "openclaw.chat.history"],
150+
featureMethods: [
151+
"chat.metadata",
152+
"chat.startup",
153+
"chat.history",
154+
"chat.send",
155+
"openclaw.chat",
156+
"openclaw.chat.history",
157+
],
149158
methodResponses: {
150159
"openclaw.chat.history": {
151160
turns: [
@@ -160,10 +169,17 @@ suite.define(() => {
160169
});
161170

162171
try {
163-
await page.goto(`${suite.server.baseUrl}${surface === "page" ? "custodian" : "chat"}`);
172+
await page.goto(
173+
surface === "page"
174+
? `${suite.server.baseUrl}custodian`
175+
: controlUiSessionUrl(suite.server.baseUrl, "agent:main:work"),
176+
);
164177
if (surface === "panel") {
165-
await page.locator(".sidebar-issues-button").click();
166-
await page.locator(".sidebar-issues-panel__ask").click();
178+
await page.locator(".sidebar-footer-bar__home").click();
179+
await page
180+
.locator("openclaw-assistant-panel")
181+
.getByRole("button", { name: "Ask OpenClaw", exact: true })
182+
.click();
167183
}
168184
const chat = page.locator("openclaw-custodian-surface");
169185
await gateway.waitForRequest("openclaw.chat");

‎ui/src/i18n/locales/en.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4510,8 +4510,6 @@ export const en: TranslationMap = {
45104510
},
45114511
},
45124512
attention: {
4513-
custodianAlertAria: "Ask OpenClaw, {count} undismissed alert",
4514-
custodianAlertsAria: "Ask OpenClaw, {count} undismissed alerts",
45154513
cronErrorUnknown: "Unknown error",
45164514
cronFailed: "{job} failed",
45174515
cronOverdue: "{job} overdue",

‎ui/src/styles/layout.css‎

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,29 +1075,17 @@ openclaw-settings-save-indicator:empty {
10751075
stroke-linejoin: round;
10761076
}
10771077

1078-
.sidebar-brand__new-thread,
1079-
.sidebar-footer-bar__custodian {
1078+
.sidebar-brand__new-thread {
10801079
width: 32px;
10811080
height: 32px;
10821081
color: var(--text);
10831082
}
10841083

1085-
.sidebar-brand__new-thread svg,
1086-
.sidebar-footer-bar__custodian svg {
1084+
.sidebar-brand__new-thread svg {
10871085
width: 18px;
10881086
height: 18px;
10891087
}
10901088

1091-
.sidebar-footer-bar__custodian-glyph {
1092-
position: relative;
1093-
display: inline-flex;
1094-
}
1095-
1096-
.sidebar-footer-bar__custodian-badge--warning,
1097-
.sidebar-footer-bar__custodian-badge--error {
1098-
color: var(--inbox-attention);
1099-
}
1100-
11011089
.sidebar-shell__content {
11021090
display: flex;
11031091
flex: 1;

0 commit comments

Comments
 (0)