diff --git a/internal/gui/assets/app.css b/internal/gui/assets/app.css index 9ca5ea78d..81923f863 100644 --- a/internal/gui/assets/app.css +++ b/internal/gui/assets/app.css @@ -360,8 +360,10 @@ body.panel .field.open { box-shadow: inset 0 0 0 1px var(--accent), var(--pill-s /* the tray panel keeps control-sized pills: a solo control spans both columns and hugs the right — an economy the narrow panel wants */ /* a field that follows the model unless set: a square in a third column */ -#agents.extras .fields { width: 379px; grid-template-columns: minmax(0, 1fr) 124px 24px; } -body.panel #agents.extras .fields { width: 301px; grid-template-columns: minmax(0, 1fr) 118px 24px; } +#agents { --extras: 1; --extras-w: calc(var(--extras) * 29px - 5px); } +#agents.extras .fields { width: calc(355px + var(--extras-w)); grid-template-columns: minmax(0, 1fr) 124px var(--extras-w); } +body.panel #agents.extras .fields { width: calc(277px + var(--extras-w)); grid-template-columns: minmax(0, 1fr) 118px var(--extras-w); } +.extras-cell { grid-column: 3; display: flex; justify-content: flex-end; gap: 5px; } #agents.extras .field.solo { grid-column: 1 / 3; } body.window #agents.extras .field.solo { grid-column: 1 / 3; } .field.extra { grid-column: 3; width: 24px; padding: 0; justify-content: center; position: relative; color: var(--faint); } diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.js index 6a560942d..fc1a83e4c 100644 --- a/internal/gui/assets/app.js +++ b/internal/gui/assets/app.js @@ -196,8 +196,11 @@ function renderAgents() { if (tiers) shownFields.push(tiers); const sorted = shownFields.sort((x, y) => wide(y) - wide(x) || extra(x) - extra(y)); const plain = sorted.filter((f) => !extra(f)).length; + // the squares share one cell, side by side: two (Codex's subagents and + // sign-in) wrapped the second under the first + const extras = el("span", "extras-cell"); for (const f of sorted) { - if (extra(f)) { fields.append(extraField(a, f)); continue; } + if (extra(f)) { extras.append(extraField(a, f)); continue; } const b = el("button", "field " + (plain === 1 ? "solo" : wide(f) ? "main" : "side")); const opt = optionFor(f, f.value); b.title = t("{label}: {value}", { label: t(f.label), value: f.value || t("agent default") }) + (opt?.note ? ` · ${opt.note}` : ""); @@ -218,6 +221,7 @@ function renderAgents() { b.onclick = (ev) => openPicker(a, f, b, ev); fields.append(b); } + if (extras.childNodes.length) fields.append(extras); // one hidden by hand gives its way back in words, rather than being a // greyed row whose way back is its menu. One nothing is set on isn't // hidden: setting something on it brings it up the list. @@ -242,6 +246,8 @@ function renderAgents() { // the extras column is there for every row once any agent has one, so the // pickers keep lining up down the list list.classList.toggle("extras", state.agents.some((a) => a.fields.some(extra) || tierMenu(a))); + // as wide as the row with the most squares + list.style.setProperty("--extras", Math.max(1, ...state.agents.map((a) => a.fields.filter((f) => extra(f) && !TIERS.includes(f.label)).length + (tierMenu(a) ? 1 : 0)))); if (!folded.length) { for (const a of used) list.append(agentRow(a)); } else {