agents: a row's small squares sit side by side — Codex's sign-in square wrapped under its subagents one (the extras column held one); the squares share one cell, the column as wide as the row with the most

This commit is contained in:
yetone committed 2026-09-28 14:37:09 +08:00
1 parent 91aacfba1c
commit af840b012f
2 files changed
+11 -3

No files matched your search

+4 -2
View File
@@ -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); }
+7 -1
View File
@@ -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 {