gui: a menu of actions keeps no empty tick column, so its items line up with its heading

Sessions' "Continue in" menu (a screenshot from the owner) drew each
agent's logo and name about 21px right of its heading. The menu is a
list of actions with nothing ticked, but the shared menu reserved its
14px tick column anyway. The same happens in Usage's "Count this
client's calls as", Library's "Copy config…" and Routing's "Add a
condition".

app.css now hides .pm-tick in a menu with no ticked item and no
checkbox item. A choice menu (something ticked) and a multi-pick menu
(menuitemcheckbox, where a tick can appear later) keep the column. The
rule is CSS only: an app.js version put the core 209 bytes over its
budget, which is not raised for this.

Run at cbbf3163c + this:
- sessions-convert, usage-count-client, library-mcp-copy-config,
  purpose-filter, routing-purpose-state, routing-request-metrics: 46/46
  (Chromium and WebKit, every language the files run)
- go test ./internal/gui -run Budget: ok
- measured: the logo went from x=571 to 550, the heading's text start

Broken by hand: the old app.css fails sessions-convert's new "the logo
lines up with the heading (571 vs 550)" in Chromium and WebKit.

Not tried: the whole GUI suite (load ~270 and a nearly full disk on the
machine), and the real Linux (WebKitGTK) and Windows apps.
This commit is contained in:
yetone
2026-10-25 16:30:29 +08:00
parent cbbf3163cb
commit c490165b14
2 changed files with 7 additions and 0 deletions
+3
View File
@@ -2664,6 +2664,9 @@ body.window .ag-sk-icon { width: 22px; height: 22px; border-radius: 6px; }
.proto-menu .pm-item { display: flex; align-items: flex-start; gap: 7px; width: 100%; padding: 6px 8px 7px; border: 0; border-radius: 7px; background: none; color: var(--fg); font: inherit; text-align: left; cursor: default; outline: none; }
.proto-menu .pm-item:hover, .proto-menu .pm-item:focus { background: var(--pill); }
.proto-menu .pm-tick { width: 14px; height: 16px; flex: none; display: grid; place-items: center; color: var(--fg); }
/* a menu of actions, where nothing is or can be ticked, keeps no room for
a tick: its items line up with its heading */
.proto-menu:not(:has(.pm-item.on, [role=menuitemcheckbox])) .pm-tick { display: none; }
.proto-menu .pm-words { display: grid; gap: 1px; min-width: 0; }
.proto-menu .pm-name { font-size: 12.5px; font-weight: 500; line-height: 16px; }
.proto-menu .pm-note { font-size: 11px; color: var(--muted); line-height: 15px; }
@@ -112,6 +112,10 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
assert.deepEqual(await menu.locator(".pm-item .pm-name").allTextContents(), ["Codex", "Codex"]);
assert.deepEqual(await menu.locator(".pm-item .pm-note").allTextContents(), [await tr(KEYS[0]), await tr(KEYS[1])]);
assert.equal(await menu.locator(".pm-item").first().getAttribute("title"), w.made);
// actions, nothing ticked: no empty tick column, so each agent's logo
// starts where the heading's words do
const [headX, icX] = await menu.evaluate((m) => [m.querySelector(".pm-head"), m.querySelector(".pm-item .ic")].map((e) => e.getBoundingClientRect().left + parseFloat(getComputedStyle(e).paddingLeft)));
assert(Math.abs(headX - icX) < 1, `the logo lines up with the heading (${icX} vs ${headX})`);
assert.equal(await page.locator("select").count(), 0, "no native select");
assert.deepEqual(calls, [], "opening the menu converts nothing");