@@ -15,10 +15,7 @@ import {
1515 XAxis ,
1616 YAxis ,
1717} from "recharts" ;
18- import {
19- ChartContainer ,
20- ChartTooltip ,
21- } from "@/components/ui/chart" ;
18+ import { ChartContainer , ChartTooltip } from "@/components/ui/chart" ;
2219import {
2320 Collapsible ,
2421 CollapsibleContent ,
@@ -45,9 +42,7 @@ function computeGroupTrend(entries: EvalSuiteOverviewEntry[]): number[] {
4542 const vals = entries
4643 . filter ( ( e ) => e . passRateTrend . length > i )
4744 . map ( ( e ) => e . passRateTrend [ i ] ) ;
48- return vals . length > 0
49- ? vals . reduce ( ( a , b ) => a + b , 0 ) / vals . length
50- : 0 ;
45+ return vals . length > 0 ? vals . reduce ( ( a , b ) => a + b , 0 ) / vals . length : 0 ;
5146 } ) . slice ( - 12 ) ;
5247}
5348
@@ -119,8 +114,8 @@ export function TagAggregationPanel({
119114 onFilterTagChange,
120115 onSelectSuite,
121116} : TagAggregationPanelProps ) {
122- const [ expandedTags , setExpandedTags ] = useState < Set < string > > (
123- ( ) => ( filterTag ? new Set ( [ filterTag ] ) : new Set ( ) ) ,
117+ const [ expandedTags , setExpandedTags ] = useState < Set < string > > ( ( ) =>
118+ filterTag ? new Set ( [ filterTag ] ) : new Set ( ) ,
124119 ) ;
125120
126121 // Auto-expand when filterTag changes
@@ -131,16 +126,15 @@ export function TagAggregationPanel({
131126 } , [ filterTag ] ) ;
132127
133128 const visibleGroups = useMemo (
134- ( ) => ( filterTag ? tagGroups . filter ( ( g ) => g . tag === filterTag ) : tagGroups ) ,
129+ ( ) =>
130+ filterTag ? tagGroups . filter ( ( g ) => g . tag === filterTag ) : tagGroups ,
135131 [ tagGroups , filterTag ] ,
136132 ) ;
137133
138134 // Pre-compute group trends
139135 const groupTrends = useMemo (
140136 ( ) =>
141- new Map (
142- visibleGroups . map ( ( g ) => [ g . tag , computeGroupTrend ( g . entries ) ] ) ,
143- ) ,
137+ new Map ( visibleGroups . map ( ( g ) => [ g . tag , computeGroupTrend ( g . entries ) ] ) ) ,
144138 [ visibleGroups ] ,
145139 ) ;
146140
@@ -236,9 +230,7 @@ export function TagAggregationPanel({
236230 { allTags . map ( ( tag ) => (
237231 < button
238232 key = { tag }
239- onClick = { ( ) =>
240- onFilterTagChange ( filterTag === tag ? null : tag )
241- }
233+ onClick = { ( ) => onFilterTagChange ( filterTag === tag ? null : tag ) }
242234 className = { cn (
243235 "text-xs px-3 py-1 rounded-full border transition-colors" ,
244236 filterTag === tag
@@ -303,7 +295,7 @@ export function TagAggregationPanel({
303295 ) }
304296 </ div >
305297
306- { ( group . totals . passed + group . totals . failed ) > 0 && (
298+ { group . totals . passed + group . totals . failed > 0 && (
307299 < div className = "h-1.5 w-full rounded-full bg-muted overflow-hidden" >
308300 < div
309301 className = "h-full rounded-full bg-primary/70"
@@ -357,7 +349,19 @@ export function TagAggregationPanel({
357349 />
358350 < ChartTooltip
359351 cursor = { false }
360- content = { ( { active, payload, label } : { active ?: boolean ; payload ?: Array < { dataKey : string ; value : number ; color : string } > ; label ?: string } ) => {
352+ content = { ( {
353+ active,
354+ payload,
355+ label,
356+ } : {
357+ active ?: boolean ;
358+ payload ?: Array < {
359+ dataKey : string ;
360+ value : number ;
361+ color : string ;
362+ } > ;
363+ label ?: string ;
364+ } ) => {
361365 if ( ! active || ! payload || payload . length === 0 )
362366 return null ;
363367 return (
@@ -444,7 +448,15 @@ export function TagAggregationPanel({
444448 />
445449 < ChartTooltip
446450 cursor = { false }
447- content = { ( { active, payload } : { active ?: boolean ; payload ?: Array < { payload : typeof passRateBarData [ number ] } > } ) => {
451+ content = { ( {
452+ active,
453+ payload,
454+ } : {
455+ active ?: boolean ;
456+ payload ?: Array < {
457+ payload : ( typeof passRateBarData ) [ number ] ;
458+ } > ;
459+ } ) => {
448460 if ( ! active || ! payload || payload . length === 0 )
449461 return null ;
450462 const data = payload [ 0 ] . payload ;
@@ -525,10 +537,7 @@ export function TagAggregationPanel({
525537 </ div >
526538 < div className = "flex items-center gap-4" >
527539 { trend . length >= 2 && (
528- < Sparkline
529- data = { trend }
530- className = "h-5 shrink-0"
531- />
540+ < Sparkline data = { trend } className = "h-5 shrink-0" />
532541 ) }
533542 < span className = "text-xs text-muted-foreground" >
534543 < span className = "text-emerald-600" >
@@ -539,9 +548,7 @@ export function TagAggregationPanel({
539548 { group . totals . failed } failed
540549 </ span >
541550 </ span >
542- < span className = "text-sm font-bold" >
543- { group . passRate } %
544- </ span >
551+ < span className = "text-sm font-bold" > { group . passRate } %</ span >
545552 </ div >
546553 </ CollapsibleTrigger >
547554
@@ -557,13 +564,10 @@ export function TagAggregationPanel({
557564
558565 < div className = "divide-y" >
559566 { sortedEntries . map ( ( entry ) => {
560- const total =
561- entry . totals . passed + entry . totals . failed ;
567+ const total = entry . totals . passed + entry . totals . failed ;
562568 const suitePassRate =
563569 total > 0
564- ? Math . round (
565- ( entry . totals . passed / total ) * 100 ,
566- )
570+ ? Math . round ( ( entry . totals . passed / total ) * 100 )
567571 : 0 ;
568572 const status = getStatusDot ( entry ) ;
569573 const suiteTrend = entry . passRateTrend . slice ( - 8 ) ;
0 commit comments