@@ -155,7 +155,11 @@ import {
155155import { ProjectFavicon } from "./ProjectFavicon" ;
156156import { ProviderInstanceIcon } from "./chat/ProviderInstanceIcon" ;
157157import { getTriggerDisplayModelLabel } from "./chat/providerIconUtils" ;
158- import { deriveProviderInstanceEntries , type ProviderInstanceEntry } from "../providerInstances" ;
158+ import {
159+ deriveProviderInstanceEntries ,
160+ shouldShowInstanceBadge ,
161+ type ProviderInstanceEntry ,
162+ } from "../providerInstances" ;
159163import { primaryServerProvidersAtom } from "../state/server" ;
160164import { useThreadRunningTerminalIds } from "../state/terminalSessions" ;
161165import { stackedThreadToast , toastManager } from "./ui/toast" ;
@@ -238,21 +242,6 @@ function terminalProcessLabel(count: number): string {
238242 return `${ count } terminal ${ count === 1 ? "process" : "processes" } running` ;
239243}
240244
241- // Several accounts on the same provider share one glyph, so the account badge
242- // is the only thing telling them apart.
243- function hasDuplicateDriverInstances (
244- entries : ReadonlyMap < string , ProviderInstanceEntry > ,
245- driverKind : ProviderInstanceEntry [ "driverKind" ] ,
246- ) : boolean {
247- let seen = false ;
248- for ( const entry of entries . values ( ) ) {
249- if ( entry . driverKind !== driverKind ) continue ;
250- if ( seen ) return true ;
251- seen = true ;
252- }
253- return false ;
254- }
255-
256245function SidebarThreadTooltip ( {
257246 thread,
258247 projectTitle,
@@ -336,8 +325,7 @@ function SidebarThreadTooltip({
336325 providerEntry ?. displayName ?? thread . session ?. providerName ?? modelInstanceId
337326 }
338327 accentColor = { providerEntry ?. accentColor }
339- // Initials would swallow a size-3 glyph, so the accent reads as
340- // a plain dot here and the account name lands in the label.
328+ // Initials would swallow a size-3 glyph: accent dot, name in label.
341329 showBadge = { showInstanceBadge && providerEntry ?. accentColor !== undefined }
342330 badgeContent = "none"
343331 badgeClassName = "h-2 min-w-2 px-0"
@@ -890,8 +878,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
890878 const driverKind = providerEntry ?. driverKind ?? null ;
891879 const showInstanceBadge =
892880 providerEntry !== null &&
893- ( Boolean ( providerEntry . accentColor ) ||
894- hasDuplicateDriverInstances ( props . providerEntryByInstanceId , providerEntry . driverKind ) ) ;
881+ shouldShowInstanceBadge ( providerEntry , props . providerEntryByInstanceId . values ( ) ) ;
895882 const selectedModel = providerEntry ?. models . find (
896883 ( model ) => model . slug === thread . modelSelection . model ,
897884 ) ;
@@ -1498,10 +1485,9 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
14981485 }
14991486 accentColor = { providerEntry ?. accentColor }
15001487 showBadge = { showInstanceBadge }
1501- // Only the glyph dims; the accent badge has to stay
1502- // saturated to read as an account color.
1488+ // Glyph dims, badge stays saturated; offset matches the composer trigger.
15031489 iconClassName = "size-3.5 opacity-60"
1504- badgeClassName = "h-3 min-w-3 px-0.5 text-[7px]"
1490+ badgeClassName = "right-[-0.1875rem] bottom-[-0.1875rem] h-3 min-w-3 px-0.5 text-[7px]"
15051491 />
15061492 </ span >
15071493 ) : null }
@@ -1560,8 +1546,7 @@ const SidebarSearchResultRow = memo(function SidebarSearchResultRow(props: {
15601546 const providerEntry = props . providerEntryByInstanceId . get ( modelInstanceId ) ?? null ;
15611547 const showInstanceBadge =
15621548 providerEntry !== null &&
1563- ( Boolean ( providerEntry . accentColor ) ||
1564- hasDuplicateDriverInstances ( props . providerEntryByInstanceId , providerEntry . driverKind ) ) ;
1549+ shouldShowInstanceBadge ( providerEntry , props . providerEntryByInstanceId . values ( ) ) ;
15651550 const selectedModel = providerEntry ?. models . find (
15661551 ( model ) => model . slug === thread . modelSelection . model ,
15671552 ) ;
0 commit comments