fix: avoid duplicate label when displayName equals label

For main/cron sessions, displayName falls back to label, causing
'Label — Label' duplication. Now only shows label suffix when it
differs from displayName.
This commit is contained in:
Clawdbot 2026-01-28 17:27:57 +01:00
parent 58760b53a0
commit fd508a34f8

View File

@ -88,7 +88,9 @@ export function renderChatControls(state: AppViewState) {
(entry) => entry.key,
(entry) => {
const base = entry.displayName ?? entry.key;
const text = entry.label ? `${base}${entry.label}` : base;
// Only append label if it differs from displayName
const showLabel = entry.label && entry.label !== entry.displayName;
const text = showLabel ? `${base}${entry.label}` : base;
return html`<option value=${entry.key}>${text}</option>`;
},
)}