@@ -8,6 +8,7 @@ const IssueFiltersSchema = z.object({
88 role : z . enum ( [ "all" , "author" , "assignee" ] ) . default ( "all" ) ,
99 comments : z . enum ( [ "all" , "has" , "none" ] ) . default ( "all" ) ,
1010 user : z . enum ( [ "all" ] ) . or ( z . string ( ) ) . default ( "all" ) ,
11+ depDashboard : z . enum ( [ "hide" , "show" ] ) . default ( "hide" ) ,
1112} ) ;
1213
1314const PullRequestFiltersSchema = z . object ( {
@@ -62,11 +63,11 @@ export const ViewStateSchema = z.object({
6263 } )
6364 . default ( { org : null , repo : null } ) ,
6465 tabFilters : z . object ( {
65- issues : IssueFiltersSchema . default ( { role : "all" , comments : "all" , user : "all" } ) ,
66+ issues : IssueFiltersSchema . default ( { role : "all" , comments : "all" , user : "all" , depDashboard : "hide" } ) ,
6667 pullRequests : PullRequestFiltersSchema . default ( { role : "all" , reviewDecision : "all" , draft : "all" , checkStatus : "all" , sizeCategory : "all" , user : "all" } ) ,
6768 actions : ActionsFiltersSchema . default ( { conclusion : "all" , event : "all" } ) ,
6869 } ) . default ( {
69- issues : { role : "all" , comments : "all" , user : "all" } ,
70+ issues : { role : "all" , comments : "all" , user : "all" , depDashboard : "hide" } ,
7071 pullRequests : { role : "all" , reviewDecision : "all" , draft : "all" , checkStatus : "all" , sizeCategory : "all" , user : "all" } ,
7172 actions : { conclusion : "all" , event : "all" } ,
7273 } ) ,
@@ -120,7 +121,7 @@ export function resetViewState(): void {
120121 ignoredItems : [ ] ,
121122 globalFilter : { org : null , repo : null } ,
122123 tabFilters : {
123- issues : { role : "all" , comments : "all" , user : "all" } ,
124+ issues : { role : "all" , comments : "all" , user : "all" , depDashboard : "hide" } ,
124125 pullRequests : { role : "all" , reviewDecision : "all" , draft : "all" , checkStatus : "all" , sizeCategory : "all" , user : "all" } ,
125126 actions : { conclusion : "all" , event : "all" } ,
126127 } ,
@@ -198,13 +199,20 @@ export function setTabFilter<T extends keyof TabFilterField>(
198199 ) ;
199200}
200201
202+ const tabFilterDefaults : Record < string , Record < string , string > > = {
203+ issues : IssueFiltersSchema . parse ( { } ) as Record < string , string > ,
204+ pullRequests : PullRequestFiltersSchema . parse ( { } ) as Record < string , string > ,
205+ actions : ActionsFiltersSchema . parse ( { } ) as Record < string , string > ,
206+ } ;
207+
201208export function resetTabFilter < T extends keyof TabFilterField > (
202209 tab : T ,
203210 field : TabFilterField [ T ]
204211) : void {
212+ const defaultValue = tabFilterDefaults [ tab ] ?. [ field as string ] ?? "all" ;
205213 setViewState (
206214 produce ( ( draft ) => {
207- ( draft . tabFilters [ tab ] as Record < string , string > ) [ field as string ] = "all" ;
215+ ( draft . tabFilters [ tab ] as Record < string , string > ) [ field as string ] = defaultValue ;
208216 } )
209217 ) ;
210218}
@@ -215,7 +223,9 @@ export function resetAllTabFilters(
215223 setViewState (
216224 produce ( ( draft ) => {
217225 if ( tab === "issues" ) {
226+ const depDashboard = draft . tabFilters . issues . depDashboard ;
218227 draft . tabFilters . issues = IssueFiltersSchema . parse ( { } ) ;
228+ draft . tabFilters . issues . depDashboard = depDashboard ;
219229 } else if ( tab === "pullRequests" ) {
220230 draft . tabFilters . pullRequests = PullRequestFiltersSchema . parse ( { } ) ;
221231 } else {
0 commit comments