diff options
| author | David Hill <[email protected]> | 2026-03-13 15:08:23 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-13 10:08:23 -0500 |
| commit | 536abea2e2ed3bee160cf16a12b23558ed6e3fa3 (patch) | |
| tree | 02aadf005ea56f86cf1b4ad42a47c03152a2c650 /packages/app/src/utils | |
| parent | c7a52b6a2d47c39fc2c3c6311355cd7b9286aac2 (diff) | |
| download | opencode-536abea2e2ed3bee160cf16a12b23558ed6e3fa3.tar.gz opencode-536abea2e2ed3bee160cf16a12b23558ed6e3fa3.zip | |
fix(app): restore sidebar dash and sync session spinner colors (#17384)
Diffstat (limited to 'packages/app/src/utils')
| -rw-r--r-- | packages/app/src/utils/agent.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/app/src/utils/agent.ts b/packages/app/src/utils/agent.ts index 7c2c81e74..390932a13 100644 --- a/packages/app/src/utils/agent.ts +++ b/packages/app/src/utils/agent.ts @@ -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) + } +} |
