@@ -5,7 +5,7 @@ import { ActionList, ActionMenu, SegmentedControl } from '@primer/react';
55import { CopilotIcon , CreditCardIcon } from '@primer/octicons-react' ;
66import { useReport } from '../../context/useReport' ;
77import { groupBy , sumBy , topN } from '../../lib/aggregation' ;
8- import { humanizeColumn , formatCompact , formatDisplayValue , getAvatarUrl , getGroupIconSvg } from '../../lib/formatters' ;
8+ import { humanizeColumn , formatCompact , formatDisplayValue , getAvatarUrl , getGroupIconSvg , columnHasIcons } from '../../lib/formatters' ;
99import { buildColorMap , getModelIconUrl } from '../../lib/chart-theme' ;
1010import { REPORT_TYPES } from '../../lib/types' ;
1111import type { MetricOption } from '../../lib/report-schema' ;
@@ -93,7 +93,7 @@ export function GroupBreakdownChart({ stackField = 'model', metricOptions }: Gro
9393
9494 const seriesColor = colorMap . get ( stackInfo . stack ) ?? '#808fa3' ;
9595 const displayName = formatDisplayValue ( stackInfo . stack , stackField ) || ' ' ;
96- const hasIcons = stackField === 'sku' || stackField === 'product' ;
96+ const hasIcons = columnHasIcons ( stackField ) ;
9797 const iconHtml = hasIcons ? getGroupIconSvg ( stackInfo . stack , stackField , seriesColor ) : '' ;
9898 return {
9999 type : 'bar' as const ,
@@ -136,7 +136,7 @@ export function GroupBreakdownChart({ stackField = 'model', metricOptions }: Gro
136136 const name = typeof this . value === 'string' ? this . value : String ( this . value ) ;
137137 const isAvatar = groupByColumn === 'username' || groupByColumn === 'organization' ;
138138 const isModel = groupByColumn === 'model' ;
139- const hasIcons = groupByColumn === 'sku' || groupByColumn === 'product' ;
139+ const hasIcons = columnHasIcons ( groupByColumn ) ;
140140 if ( isAvatar && name ) {
141141 return `<span style="display:inline-flex;align-items:center;gap:6px;">${ name } <img src="${ getAvatarUrl ( name ) } " width="16" height="16" style="border-radius:50%;" loading="lazy" /></span>` ;
142142 }
@@ -174,7 +174,7 @@ export function GroupBreakdownChart({ stackField = 'model', metricOptions }: Gro
174174 : '<tr style="border-top: 1px solid var(--borderColor-muted, #d1d9e0b3);"><td><b>Total: </b></td><td style="text-align: right;"><b>{point.total:,.0f}</b></td></tr></table>' ,
175175 } ,
176176 plotOptions : { bar : { stacking : 'normal' } } ,
177- legend : stackField === 'sku' || stackField === 'product'
177+ legend : columnHasIcons ( stackField )
178178 ? { symbolWidth : 0 , symbolHeight : 0 , symbolPadding : 0 }
179179 : { symbolWidth : 16 , symbolHeight : 12 , symbolPadding : 5 } ,
180180 series,
0 commit comments