@@ -174,13 +174,16 @@ export function buildBulkActionEvents(
174174export interface InboxViewedFilterState {
175175 sourceProductFilter : string [ ] ;
176176 priorityFilter : string [ ] ;
177- searchQuery : string ;
177+ searchQuery ?: string ;
178+ statusFilter ?: readonly string [ ] ;
179+ defaultStatusFilter ?: readonly string [ ] ;
180+ suggestedReviewerFilter ?: string [ ] ;
178181 /**
179182 * True when the reviewer scope is the default ("For you"). False when the
180183 * user has narrowed to a teammate or the whole project — treated as an
181184 * active filter for `has_active_filters`.
182185 */
183- isDefaultScope : boolean ;
186+ isDefaultScope ? : boolean ;
184187}
185188
186189export interface BuildInboxViewedInput {
@@ -192,7 +195,7 @@ export interface BuildInboxViewedInput {
192195 /** Server-reported total of reports matching the active query — the headline inbox number. */
193196 totalCount : number ;
194197 /** Tab badge counts shown in the v2 header (the numbers the user actually sees). */
195- tabCounts : { pulls : number ; reports : number } ;
198+ tabCounts ? : { pulls : number ; reports : number } ;
196199 filters : InboxViewedFilterState ;
197200}
198201
@@ -207,7 +210,8 @@ export interface BuildInboxViewedInput {
207210export function buildInboxViewedProperties (
208211 input : BuildInboxViewedInput ,
209212) : InboxViewedProperties {
210- const { visibleReports, totalCount, tabCounts, filters } = input ;
213+ const { visibleReports, totalCount, filters } = input ;
214+ const tabCounts = input . tabCounts ?? { pulls : 0 , reports : totalCount } ;
211215
212216 const priorityCounts = { P0 : 0 , P1 : 0 , P2 : 0 , P3 : 0 , P4 : 0 , unknown : 0 } ;
213217 const actionabilityCounts = {
@@ -237,19 +241,28 @@ export function buildInboxViewedProperties(
237241 }
238242 }
239243
244+ const statusFiltered =
245+ filters . statusFilter !== undefined &&
246+ filters . defaultStatusFilter !== undefined &&
247+ ( filters . statusFilter . length !== filters . defaultStatusFilter . length ||
248+ filters . statusFilter . some (
249+ ( status ) => ! filters . defaultStatusFilter ?. includes ( status ) ,
250+ ) ) ;
240251 const hasActiveFilters =
241252 filters . sourceProductFilter . length > 0 ||
242253 filters . priorityFilter . length > 0 ||
243- filters . searchQuery . trim ( ) . length > 0 ||
244- ! filters . isDefaultScope ;
254+ ( filters . searchQuery ?. trim ( ) . length ?? 0 ) > 0 ||
255+ statusFiltered ||
256+ ( filters . suggestedReviewerFilter ?. length ?? 0 ) > 0 ||
257+ filters . isDefaultScope === false ;
245258
246259 return {
247260 report_count : visibleReports . length ,
248261 total_count : totalCount ,
249262 ready_count : readyCount ,
250263 has_active_filters : hasActiveFilters ,
251264 source_product_filter : filters . sourceProductFilter ,
252- status_filter_count : 0 ,
265+ status_filter_count : filters . statusFilter ?. length ?? 0 ,
253266 is_empty : totalCount === 0 ,
254267 priority_p0_count : priorityCounts . P0 ,
255268 priority_p1_count : priorityCounts . P1 ,
0 commit comments