diff --git a/internal/gui/assets/context.css b/internal/gui/assets/context.css index a0340b134..519849232 100644 --- a/internal/gui/assets/context.css +++ b/internal/gui/assets/context.css @@ -167,9 +167,9 @@ i.dot.free { background: var(--k-free); box-shadow: inset 0 0 0 1px color-mix(in .ctx-agent, .ctx-tune { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 12px; min-width: 0; font-variant-numeric: tabular-nums; } .ctx-agent-head { display: flex; align-items: center; gap: 10px; min-width: 0; } .ctx-who-box { min-width: 0; display: flex; flex-direction: column; gap: 3px; } -.ctx-who { display: flex; align-items: center; gap: 8px; min-width: 0; } -.ctx-who .ic { width: 20px; height: 20px; flex: none; } -.ctx-who b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.ctx-who-box .ctx-who { display: flex; align-items: center; gap: 8px; min-width: 0; } +.ctx-who-box .ctx-who .ic { width: 20px; height: 20px; flex: none; } +.ctx-who-box .ctx-who b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ctx-who-sub { font-size: 11px; color: var(--muted); } .ctx-grade { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; } .ctx-grade-word { font-size: 10.5px; font-weight: 600; } diff --git a/internal/gui/tests/ctx-route.test.cjs b/internal/gui/tests/ctx-route.test.cjs index a4486142d..2a30145e9 100644 --- a/internal/gui/tests/ctx-route.test.cjs +++ b/internal/gui/tests/ctx-route.test.cjs @@ -3,7 +3,7 @@ // model it went to (the owner): the agent's icon and name, then the model's // lab icon before its id. A model from a lab magpie doesn't know gets no // icon, so a wrong logo never stands for it. In a narrow card the agent's -// name and the › go first and its icon stays; folded, the route is still in +// name and the › go first and its icon stays, at the head's 14px; folded, the route is still in // the head. Nothing in the head runs past the card. Every GUI language, // Chromium and WebKit. const assert = require("node:assert/strict"); @@ -62,7 +62,7 @@ const look = (page) => page.evaluate(() => { const past = [...head.querySelectorAll("*")].filter((e) => shown(e) && getComputedStyle(e).overflow !== "hidden" && e.getBoundingClientRect().right > hr.right + 0.5).map((e) => e.className); return { name: q(".ctx-who-n")?.textContent, nameShown: shown(q(".ctx-who-n")), sepShown: shown(q(".ctx-sep")), - agentIcon: q(".ctx-who .ic")?.dataset.icon, agentIconShown: shown(q(".ctx-who .ic")), + agentIcon: q(".ctx-who .ic")?.dataset.icon, agentIconShown: shown(q(".ctx-who .ic")), agentIconW: q(".ctx-who .ic")?.getBoundingClientRect().width, labIcons: [...head.querySelectorAll(".ctx-what .ic")].map((e) => e.dataset.icon), model: q(".ctx-model")?.textContent, modelShown: shown(q(".ctx-model")), routeShown: shown(q(".ctx-route")), stateShown: shown(q(".ctx-state")), inCard: hr.right <= cr.right + 0.5, past, headH: hr.height, @@ -100,6 +100,8 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", assert.equal(lab$.name, "Claude Code"); assert.ok(lab$.nameShown && lab$.sepShown, "a wide card names the agent before the ›"); assert.equal(lab$.agentIcon, "claudecode-color"); + // the head's 14px, not the Context tab's 20px agent cards (the owner: Pi's icon was oversized) + assert.ok(Math.abs(lab$.agentIconW - 14) < 0.5, `the agent icon is 14px wide (${lab$.agentIconW})`); assert.deepEqual(lab$.labIcons, lab ? [lab] : [], "the model's lab icon, none when the lab isn't known"); assert.equal(lab$.model, model); assert.ok(lab$.modelShown && lab$.stateShown && lab$.inCard, JSON.stringify(lab$));