diff --git a/internal/gui/assets/app.css b/internal/gui/assets/app.css index 19eb54d43..c0ee2effd 100644 --- a/internal/gui/assets/app.css +++ b/internal/gui/assets/app.css @@ -830,6 +830,13 @@ body.window .row.agent .who .ag-cli { flex: 0 1 auto; overflow: hidden; } and gone where the pill keeps only its arrow */ .ag-app { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; } @container (max-width: 250px) { body.window .row.agent .ag-app { display: none; } } +/* beside the app's version the pill says "Update CLI to …", longer, so + there it keeps only its arrow, and the app's version goes, sooner */ +@container (max-width: 360px) { + body.window .row.agent .ag-cli.with-app .ag-up { padding: 0 6px; } + body.window .row.agent .ag-cli.with-app .ag-up > span, + body.window .row.agent .ag-cli.with-app .ag-app { display: none; } +} .ag-offpath { flex: 0 1 auto; min-width: 0; } @container (max-width: 250px) { body.window .row.agent .ag-offpath { display: none; } } .ag-here { flex: 0 1 auto; min-width: 0; } diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.js index 2666e709d..fdf44b96b 100644 --- a/internal/gui/assets/app.js +++ b/internal/gui/assets/app.js @@ -2552,6 +2552,7 @@ function cliTag(a) { // the desktop app (the Codex app, #1334): its version, which updates // itself; one connection serves the app and the CLI if (c.app) { + box.classList.add("with-app"); const v = el("span", "ag-ver ag-app", t("App {v}", { v: c.app })); v.title = t("The {agent} app {v}. It reads the same settings as the CLI: connecting {agent} here connects both", { agent: a.name, v: c.app }); box.append(v); @@ -2569,7 +2570,9 @@ function cliTag(a) { function paintCLIButton(b, c, busy) { b.classList.toggle("busy", busy); b.setAttribute("aria-busy", String(busy)); - const text = busy ? t("Updating…") : t("Update to {v}", { v: c.latest }); + // beside its app's version, it says it updates the CLI: "Update to + // 0.2.2-rc.1" next to "App 0.2.2-rc.2" read as a step back (roger1huh on X) + const text = busy ? t("Updating…") : t(c.app ? "Update CLI to {v}" : "Update to {v}", { v: c.latest }); // named even where a tight row shows only the arrow b.setAttribute("aria-label", text); b.replaceChildren(svg(busy ? CLI_SPIN : CLI_UP, 11, 1.8), el("span", "", text)); diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.js index 4ea79b36f..00373dbbc 100644 --- a/internal/gui/assets/i18n.js +++ b/internal/gui/assets/i18n.js @@ -1028,6 +1028,7 @@ const I18N = { "{agent} no longer goes through magpie · on its own default": "{agent} 已不经过 magpie · 使用自身默认设置", "{agent} no longer goes through magpie; its own settings are back": "{agent} 已不再经过 magpie,原来的设置已还原", "Update to {v}": "更新到 {v}", + "Update CLI to {v}": "更新 CLI 到 {v}", "Updates with {cmd}": "通过 {cmd} 更新", "Updates with {cmd}, as administrator: Windows asks first": "通过 {cmd} 以管理员身份更新:Windows 会先询问", "{agent} is installed in {prefix}, which only an administrator can change, and the administrator prompt was declined.": "{agent} 安装在 {prefix},这个目录只有管理员能修改,而管理员授权提示被拒绝了。", @@ -6357,6 +6358,7 @@ const I18N = { "{agent} no longer goes through magpie · on its own default": "{agent} 已不經過 magpie · 使用自身預設設定", "{agent} no longer goes through magpie; its own settings are back": "{agent} 已不再經過 magpie,原來的設定已還原", "Update to {v}": "更新到 {v}", + "Update CLI to {v}": "更新 CLI 到 {v}", "Updates with {cmd}": "透過 {cmd} 更新", "Updates with {cmd}, as administrator: Windows asks first": "透過 {cmd} 以系統管理員身分更新:Windows 會先詢問", "{agent} is installed in {prefix}, which only an administrator can change, and the administrator prompt was declined.": "{agent} 安裝在 {prefix},這個資料夾只有系統管理員能修改,而系統管理員授權提示被拒絕了。", @@ -11650,6 +11652,7 @@ const I18N = { "{agent} no longer goes through magpie · on its own default": "{agent} は magpie を経由しなくなりました · 独自のデフォルトを使用", "{agent} no longer goes through magpie; its own settings are back": "{agent} は magpie を経由しなくなりました。元の設定に戻りました", "Update to {v}": "{v} にアップデート", + "Update CLI to {v}": "CLI を {v} にアップデート", "Updates with {cmd}": "{cmd} でアップデート", "Updates with {cmd}, as administrator: Windows asks first": "{cmd} で管理者としてアップデート:Windows が先に確認します", "{agent} is installed in {prefix}, which only an administrator can change, and the administrator prompt was declined.": "{agent} は {prefix} にインストールされています。ここは管理者しか変更できませんが、管理者の確認が拒否されました。", @@ -16961,6 +16964,7 @@ const I18N = { "{agent} no longer goes through magpie · on its own default": "{agent} läuft nicht mehr über magpie · nutzt seinen eigenen Standard", "{agent} no longer goes through magpie; its own settings are back": "{agent} läuft nicht mehr über magpie; seine eigenen Einstellungen sind wiederhergestellt", "Update to {v}": "Auf {v} aktualisieren", + "Update CLI to {v}": "CLI auf {v} aktualisieren", "Updates with {cmd}": "Aktualisiert mit {cmd}", "Updates with {cmd}, as administrator: Windows asks first": "Aktualisiert mit {cmd} als Administrator: Windows fragt vorher", "{agent} is installed in {prefix}, which only an administrator can change, and the administrator prompt was declined.": "{agent} ist in {prefix} installiert, das nur ein Administrator ändern kann, und die Administrator-Abfrage wurde abgelehnt.", diff --git a/internal/gui/tests/agent-app-version.test.cjs b/internal/gui/tests/agent-app-version.test.cjs index 751b9cbf0..bc556d96c 100644 --- a/internal/gui/tests/agent-app-version.test.cjs +++ b/internal/gui/tests/agent-app-version.test.cjs @@ -4,7 +4,9 @@ // named ("CLI 0.130.0", "App 26.930.31730"), the update pill still beside // the CLI's; with the app alone, the app's; an agent with no app is as it // was. At the window's narrow width the name keeps its room. No backend: the -// API is faked here. +// API is faked here. Beside the app's version the pill says it updates the +// CLI: "Update to 0.2.2-rc.1" beside "App 0.2.2-rc.2" read as a step back +// (roger1huh on X, DeepSeek Harness). const assert = require("node:assert/strict"); const fs = require("node:fs/promises"); const path = require("node:path"); @@ -61,11 +63,12 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", }; const vers = (page, id) => page.locator(`${row(id)} .ag-ver`).allTextContents(); - for (const [lang, cli, app, tip] of [ - ["en", "CLI 0.130.0", "App 26.930.31730", /The Codex app 26\.930\.31730\. It reads the same settings as the CLI: connecting Codex here connects both/], - ["zh", "CLI 0.130.0", "App 26.930.31730", /Codex App 26\.930\.31730。它和 CLI 读同一份设置:在这里接入 Codex,两者都会接入/], - ["ja", "CLI 0.130.0", "アプリ 26.930.31730", /Codex アプリ 26\.930\.31730。CLI と同じ設定を読むので/], - ["de", "CLI 0.130.0", "App 26.930.31730", /Codex-App 26\.930\.31730\. Sie liest dieselben Einstellungen wie die CLI/], + for (const [lang, cli, app, pill, tip] of [ + ["en", "CLI 0.130.0", "App 26.930.31730", "Update CLI to 0.131.0", /The Codex app 26\.930\.31730\. It reads the same settings as the CLI: connecting Codex here connects both/], + ["zh", "CLI 0.130.0", "App 26.930.31730", "更新 CLI 到 0.131.0", /Codex App 26\.930\.31730。它和 CLI 读同一份设置:在这里接入 Codex,两者都会接入/], + ["zh-TW", "CLI 0.130.0", "App 26.930.31730", "更新 CLI 到 0.131.0", /Codex App 26\.930\.31730。它和 CLI 讀同一份設定:在這裡接入 Codex,兩者都會接入/], + ["ja", "CLI 0.130.0", "アプリ 26.930.31730", "CLI を 0.131.0 にアップデート", /Codex アプリ 26\.930\.31730。CLI と同じ設定を読むので/], + ["de", "CLI 0.130.0", "App 26.930.31730", "CLI auf 0.131.0 aktualisieren", /Codex-App 26\.930\.31730\. Sie liest dieselben Einstellungen wie die CLI/], ]) { await t.test(lang + ": both, each named, the pill beside the CLI's", async () => { const page = await open(lang, BOTH); @@ -74,6 +77,8 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", // the pill comes after the CLI's version, before the app's const order = await page.locator(`${row("codex")} .ag-cli > *`).evaluateAll((xs) => xs.map((x) => x.classList.contains("ag-app") ? "app" : x.classList.contains("ag-up") ? "pill" : "cli")); assert.deepEqual(order, ["cli", "pill", "app"]); + // the pill says it updates the CLI, never read against the app's + assert.equal(await page.locator(`${row("codex")} .ag-up`).getAttribute("aria-label"), pill); // an agent with no app: its version alone, as before assert.deepEqual(await vers(page, "gemini"), ["0.60.0"]); // name, versions and pill on one line @@ -86,6 +91,12 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", }); } + await t.test("a CLI with no app: the pill says only the version", async () => { + const page = await open("en", { codex: { ...BOTH.codex, app: undefined } }); + assert.equal(await page.locator(`${row("codex")} .ag-up`).getAttribute("aria-label"), "Update to 0.131.0"); + await page.close(); + }); + await t.test("the app alone: its version, no pill", async () => { const page = await open("en", APP_ONLY); assert.deepEqual(await vers(page, "codex"), ["App 26.930.31730"]);