fix(ui): restore agent emoji in selector dropdown

Fixes #45755

The agent emoji was lost during the dashboard-v2 refactor. This restores
it by calling resolveAgentEmoji() and prepending the emoji to the label
in the agent select dropdown.
This commit is contained in:
Marcus Widing 2026-03-14 09:39:18 +01:00
parent 8cd1bdd345
commit d32974d398

View File

@ -16,7 +16,12 @@ import {
renderAgentCron,
} from "./agents-panels-status-files.ts";
import { renderAgentTools, renderAgentSkills } from "./agents-panels-tools-skills.ts";
import { agentBadgeText, buildAgentContext, normalizeAgentLabel } from "./agents-utils.ts";
import {
agentBadgeText,
buildAgentContext,
normalizeAgentLabel,
resolveAgentEmoji,
} from "./agents-utils.ts";
export type AgentsPanel = "overview" | "files" | "tools" | "skills" | "channels" | "cron";
@ -149,13 +154,16 @@ export function renderAgents(props: AgentsProps) {
? html`
<option value="">No agents</option>
`
: agents.map(
(agent) => html`
: agents.map((agent) => {
const emoji = resolveAgentEmoji(agent);
const label = normalizeAgentLabel(agent);
const badge = agentBadgeText(agent.id, defaultId);
return html`
<option value=${agent.id} ?selected=${agent.id === selectedId}>
${normalizeAgentLabel(agent)}${agentBadgeText(agent.id, defaultId) ? ` (${agentBadgeText(agent.id, defaultId)})` : ""}
${emoji ? `${emoji} ` : ""}${label}${badge ? ` (${badge})` : ""}
</option>
`,
)
`;
})
}
</select>
</div>