fix(app): restore sidebar dash and sync session spinner colors (#17384)

This commit is contained in:
David Hill
2026-03-13 15:08:23 +00:00
committed by GitHub
parent c7a52b6a2d
commit 536abea2e2
4 changed files with 65 additions and 106 deletions

View File

@@ -9,3 +9,15 @@ export function agentColor(name: string, custom?: string) {
if (custom) return custom
return defaults[name] ?? defaults[name.toLowerCase()]
}
export function messageAgentColor(
list: readonly { role: string; agent?: string }[] | undefined,
agents: readonly { name: string; color?: string }[],
) {
if (!list) return undefined
for (let i = list.length - 1; i >= 0; i--) {
const item = list[i]
if (item.role !== "user" || !item.agent) continue
return agentColor(item.agent, agents.find((agent) => agent.name === item.agent)?.color)
}
}