@@ -21,7 +21,6 @@ const SPECIAL_CATEGORIES: Record<SpecialCategory, string> = {
2121 [ RUN_ABORTED ] : "—" ,
2222} ;
2323
24- // NOTE (JS->TS): Type guard for `SpecialCategory`
2524function isSpecialCategory ( x : string ) : x is SpecialCategory {
2625 return x in SPECIAL_CATEGORIES ;
2726}
@@ -33,10 +32,10 @@ type TrailingSpace = `${string} `;
3332 * ========================================================================== */
3433
3534type RelevantFilterParam = Readonly < {
36- categoryFilters : ReadonlyArray < string > ;
37- statusFilters : ReadonlyArray < string > ;
38- categoryFilterValues : ReadonlyArray < string > ;
39- statusFilterValues : ReadonlyArray < string > ;
35+ categoryFilters : ReadonlyArray < string > ; // The category filters that are currently selected
36+ statusFilters : ReadonlyArray < string > ; // The status filters that are currently selected
37+ categoryFilterValues : ReadonlyArray < string > ; // All selectable category filter values
38+ statusFilterValues : ReadonlyArray < string > ; // All selectable status filter values
4039} > ;
4140
4241/* ============================================================================
@@ -77,7 +76,6 @@ const createRelevantFilterLabel = ({
7776 if ( ! hasSameEntries ( categoryFilters , categoryFilterValues ) ) {
7877 // If categoryFilters is a superset of categoryFilterValues,
7978 // we know that all categories are selected
80- // NOTE (JS->TS): Copy the array to avoid mutating the original
8179 out = [ ...categoryFilters ] ;
8280 }
8381 if ( ! hasSameEntries ( statusFilters , statusFilterValues ) ) {
@@ -103,7 +101,6 @@ function StatusFilter({
103101 setCustomFilters,
104102} : StatusFilterProps ) : JSX . Element {
105103 const categoryValues = allCategoryValues [ runSetIdx ] [ columnIdx ] ;
106- // NOTE (JS->TS): Keep `filteredColumnValues` as `unknown` and cast only at the boundary for `pathOr`.
107104 const filteredColumnValuesRecord = filteredColumnValues as Record <
108105 string ,
109106 unknown
@@ -133,7 +130,6 @@ function StatusFilter({
133130 const multipleSelected =
134131 selectedFilters . length > 1 || selectedFilters [ 0 ] === emptyStateValue ;
135132 const singleFilterValue = selectedFilters && selectedFilters [ 0 ] ;
136- // NOTE (JS->TS): Type guard for `selectValue`
137133 const selectValue : string =
138134 ( allSelected && "all " ) ||
139135 ( multipleSelected && "multiple" ) ||
@@ -166,7 +162,6 @@ function StatusFilter({
166162 < optgroup label = "Category" >
167163 { categoryValues
168164 . filter ( ( category ) => ! isSpecialCategory ( category ) )
169- // NOTE (JS->TS): Slice to create a copy of the readonly array
170165 . slice ( )
171166 . sort ( )
172167 . map ( ( category ) => (
@@ -183,7 +178,6 @@ function StatusFilter({
183178 < optgroup label = "Status" >
184179 { allStatusValues [ runSetIdx ] [ columnIdx ]
185180 . filter ( ( status ) => status !== statusForEmptyRows )
186- // NOTE (JS->TS): Slice to create a copy of the readonly array
187181 . slice ( )
188182 . sort ( )
189183 . map ( ( status ) => (
0 commit comments