@@ -370,9 +370,6 @@ export function RunsFilters(props: RunFiltersProps) {
370370 < FilterMenu { ...props } />
371371 { hasFilters && (
372372 < Form className = "-ml-1 h-6" >
373- { searchParams . has ( "rootOnly" ) && (
374- < input type = "hidden" name = "rootOnly" value = { searchParams . get ( "rootOnly" ) as string } />
375- ) }
376373 < Button
377374 variant = "minimal/small"
378375 LeadingIcon = { XMarkIcon }
@@ -677,14 +674,17 @@ function TasksDropdown({
677674 const previousTasks = values ( "tasks" ) ;
678675 const wasEmpty = previousTasks . length === 0 || previousTasks . every ( ( v ) => v === "" ) ;
679676 const isEmpty = newValues . length === 0 || newValues . every ( ( v ) => v === "" ) ;
680- // When transitioning from no tasks to tasks, force rootOnly off so users
681- // see the runs of the task they just selected (root or otherwise).
677+ // empty -> tasks: temporarily force rootOnly off so child runs of the selected
678+ // task are visible. tasks -> empty: drop rootOnly so the toggle reverts to the
679+ // user's saved session preference. Neither writes to the cookie (see loader).
682680 const transitioningToTasks = wasEmpty && ! isEmpty ;
681+ const transitioningToNoTasks = ! wasEmpty && isEmpty ;
683682 replace ( {
684683 tasks : newValues ,
685684 cursor : undefined ,
686685 direction : undefined ,
687686 ...( transitioningToTasks ? { rootOnly : "false" } : { } ) ,
687+ ...( transitioningToNoTasks ? { rootOnly : undefined } : { } ) ,
688688 } ) ;
689689 } ;
690690
@@ -770,7 +770,7 @@ function PermanentTasksFilter({ possibleTasks }: Pick<RunFiltersProps, "possible
770770 return task ? task . slug : v ;
771771 } )
772772 ) }
773- onRemove = { ( ) => del ( [ "tasks" , "cursor" , "direction" ] ) }
773+ onRemove = { ( ) => del ( [ "tasks" , "cursor" , "direction" , "rootOnly" ] ) }
774774 variant = "secondary/small"
775775 className = "pl-1"
776776 />
0 commit comments