mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-28 05:16:23 -06:00
fix(ui): clearly label beta releases in the update banner (#115518)
* fix(ui): identify beta channel in update banner * fix(ui): preserve update-banner translation baseline
This commit is contained in:
committed by
GitHub
parent
9c118dd38f
commit
8ff566a24c
@@ -77,6 +77,21 @@ describe("SidebarUpdateCard", () => {
|
||||
expect(onUpdate).toHaveBeenCalledOnce();
|
||||
});
|
||||
|
||||
it.each(["2026.7.2", "2026.7.2-beta.5"])(
|
||||
"identifies a beta update when its available version is %s",
|
||||
async (latestVersion) => {
|
||||
const element = await mount({
|
||||
currentVersion: "2026.7.1-2",
|
||||
latestVersion,
|
||||
channel: "beta",
|
||||
});
|
||||
|
||||
expect(element.querySelector(".sidebar-update-card__text")?.textContent).toBe(
|
||||
`Update Gateway · v${latestVersion} (beta)`,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
it.each([null, { currentVersion: "2.0.0", latestVersion: "2.0.0", channel: "stable" }] as const)(
|
||||
"renders nothing when no newer update is available",
|
||||
async (update) => {
|
||||
|
||||
@@ -107,6 +107,7 @@ class SidebarUpdateCard extends OpenClawLightDomContentsElement {
|
||||
: this.nativeUpdateAvailable
|
||||
? t("chat.sidebar.updateMacAndGateway")
|
||||
: t("chat.sidebar.updateGateway");
|
||||
const betaChannelSuffix = update.channel === "beta" ? " (beta)" : "";
|
||||
return html`
|
||||
<div class="sidebar-update-card" role="status" aria-live="polite">
|
||||
<button
|
||||
@@ -120,7 +121,9 @@ class SidebarUpdateCard extends OpenClawLightDomContentsElement {
|
||||
}}
|
||||
>
|
||||
<span class="sidebar-update-card__icon" aria-hidden="true">${icons.download}</span>
|
||||
<span class="sidebar-update-card__text">${title} · v${update.latestVersion}</span>
|
||||
<span class="sidebar-update-card__text"
|
||||
>${title} · v${update.latestVersion}${betaChannelSuffix}</span
|
||||
>
|
||||
</button>
|
||||
<button
|
||||
class="sidebar-update-card__dismiss"
|
||||
|
||||
@@ -33,6 +33,40 @@ describeControlUiE2e("Control UI coalesced update E2E", () => {
|
||||
await server?.close();
|
||||
});
|
||||
|
||||
it("identifies a beta release in the visible Gateway update card", async () => {
|
||||
const artifactDir = path.resolve(".artifacts/control-ui-e2e/update-beta-channel");
|
||||
const context = await browser.newContext({
|
||||
locale: "en-US",
|
||||
recordVideo: { dir: artifactDir, size: { height: 720, width: 1280 } },
|
||||
serviceWorkers: "block",
|
||||
viewport: { height: 720, width: 1280 },
|
||||
});
|
||||
const page = await context.newPage();
|
||||
const gateway = await installMockGateway(page);
|
||||
|
||||
try {
|
||||
expect((await page.goto(`${server.baseUrl}chat`))?.status()).toBe(200);
|
||||
await gateway.waitForRequest("chat.startup");
|
||||
await gateway.emitGatewayEvent("update.available", {
|
||||
updateAvailable: {
|
||||
channel: "beta",
|
||||
currentVersion: "2026.7.1-2",
|
||||
latestVersion: "2026.7.2-beta.5",
|
||||
},
|
||||
});
|
||||
|
||||
await page
|
||||
.getByRole("button", {
|
||||
name: /Update Gateway · v2026\.7\.2-beta\.5 \(beta\)/u,
|
||||
})
|
||||
.waitFor({ timeout: 10_000 });
|
||||
await page.screenshot({ path: path.join(artifactDir, "beta-update-card.png") });
|
||||
expect(await gateway.getRequests("update.run")).toHaveLength(0);
|
||||
} finally {
|
||||
await context.close();
|
||||
}
|
||||
});
|
||||
|
||||
it("shows coalesced restart feedback after the Update click", async () => {
|
||||
const artifactDir = path.resolve(".artifacts/control-ui-e2e/update-coalesced");
|
||||
const context = await browser.newContext({
|
||||
|
||||
Reference in New Issue
Block a user