From aff96ea963d3a0463f2f5255942edbaf0a551df8 Mon Sep 17 00:00:00 2001 From: Ayaan Zaidi Date: Mon, 20 Apr 2026 13:34:58 +0530 Subject: [PATCH] fix: avoid preview-only pairing approval hint (#69226) --- ui/src/ui/views/overview.render.test.ts | 15 +++++++++++++++ ui/src/ui/views/overview.ts | 8 ++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ui/src/ui/views/overview.render.test.ts b/ui/src/ui/views/overview.render.test.ts index 58b581d64f3..0676c917638 100644 --- a/ui/src/ui/views/overview.render.test.ts +++ b/ui/src/ui/views/overview.render.test.ts @@ -108,4 +108,19 @@ describe("overview view rendering", () => { ); expect(container.textContent).toContain("openclaw devices approve req-123"); }); + + it("does not suggest preview-only latest approval when the request id is absent", async () => { + const container = document.createElement("div"); + const props = createOverviewProps({ + lastError: "scope upgrade pending approval", + lastErrorCode: "PAIRING_REQUIRED", + }); + + render(renderOverview(props), container); + await Promise.resolve(); + + expect(container.textContent).toContain("Scope upgrade pending approval."); + expect(container.textContent).toContain("openclaw devices list"); + expect(container.textContent).not.toContain("openclaw devices approve --latest"); + }); }); diff --git a/ui/src/ui/views/overview.ts b/ui/src/ui/views/overview.ts index 122a3d806b1..f58ba97f7d1 100644 --- a/ui/src/ui/views/overview.ts +++ b/ui/src/ui/views/overview.ts @@ -111,9 +111,6 @@ export function renderOverview(props: OverviewProps) { } const copy = PAIRING_HINT_COPY[pairingState.kind]; const title = copy.titleKey ? t(copy.titleKey) : t("overview.pairing.hint"); - const approveCommand = pairingState.requestId - ? `openclaw devices approve ${pairingState.requestId}` - : "openclaw devices approve --latest"; return html`
${title} @@ -121,7 +118,10 @@ export function renderOverview(props: OverviewProps) { ? html`
${t(copy.summaryKey)}
` : nothing}
- ${approveCommand}
+ ${pairingState.requestId + ? html`openclaw devices approve ${pairingState.requestId}
` + : nothing} openclaw devices list
${t("overview.pairing.mobileHint")}