@@ -11,10 +11,19 @@ import {MessageSpinner} from '../../shared/message-spinner';
11
11
import { Score } from '../../shared/score/score' ;
12
12
import { ProviderLabel } from '../../shared/provider-label' ;
13
13
import { bucketToScoreVariable } from '../../shared/scoring' ;
14
+ import { MultiSelect } from '../../shared/multi-select/multi-select' ;
14
15
15
16
@Component ( {
16
17
selector : 'app-report-list' ,
17
- imports : [ RouterLink , DatePipe , StackedBarChart , MessageSpinner , Score , ProviderLabel ] ,
18
+ imports : [
19
+ RouterLink ,
20
+ DatePipe ,
21
+ StackedBarChart ,
22
+ MessageSpinner ,
23
+ Score ,
24
+ ProviderLabel ,
25
+ MultiSelect ,
26
+ ] ,
18
27
templateUrl : './report-list.html' ,
19
28
styleUrls : [ './report-list.scss' ] ,
20
29
} )
@@ -30,6 +39,7 @@ export class ReportListComponent {
30
39
protected selectedFramework = signal < string | null > ( null ) ;
31
40
protected selectedModel = signal < string | null > ( null ) ;
32
41
protected selectedRunner = signal < string | null > ( null ) ;
42
+ protected selectedLabels = signal < string [ ] > ( [ ] ) ;
33
43
34
44
protected allFrameworks = computed ( ( ) => {
35
45
const frameworks = new Map < string , string > ( ) ;
@@ -67,17 +77,40 @@ export class ReportListComponent {
67
77
} ) ) ;
68
78
} ) ;
69
79
80
+ protected allLabels = computed ( ( ) => {
81
+ const labels = new Set < string > ( ) ;
82
+
83
+ for ( const group of this . allGroups ( ) ) {
84
+ for ( const label of group . labels ) {
85
+ const trimmed = label . trim ( ) ;
86
+
87
+ if ( trimmed ) {
88
+ labels . add ( trimmed ) ;
89
+ }
90
+ }
91
+ }
92
+
93
+ return Array . from ( labels )
94
+ . sort ( )
95
+ . map ( label => ( {
96
+ label,
97
+ value : label ,
98
+ } ) ) ;
99
+ } ) ;
100
+
70
101
protected reportGroups = computed ( ( ) => {
71
102
const framework = this . selectedFramework ( ) ;
72
103
const model = this . selectedModel ( ) ;
73
104
const runner = this . selectedRunner ( ) ;
105
+ const labels = this . selectedLabels ( ) ;
74
106
const groups = this . allGroups ( ) ;
75
107
76
108
return groups . filter ( group => {
77
109
const frameworkMatch = ! framework || group . framework . fullStackFramework . id === framework ;
78
110
const modelMatch = ! model || group . model === model ;
79
111
const runnerMatch = ! runner || group . runner ?. id === runner ;
80
- return frameworkMatch && modelMatch && runnerMatch ;
112
+ const labelsMatch = labels . length === 0 || group . labels . some ( l => labels . includes ( l . trim ( ) ) ) ;
113
+ return frameworkMatch && modelMatch && runnerMatch && labelsMatch ;
81
114
} ) ;
82
115
} ) ;
83
116
0 commit comments