@@ -672,9 +672,20 @@ function TasksDropdown({
672672} ) {
673673 const { values, replace } = useSearchParams ( ) ;
674674
675- const handleChange = ( values : string [ ] ) => {
675+ const handleChange = ( newValues : string [ ] ) => {
676676 clearSearchValue ( ) ;
677- replace ( { tasks : values , cursor : undefined , direction : undefined } ) ;
677+ const previousTasks = values ( "tasks" ) ;
678+ const wasEmpty = previousTasks . length === 0 || previousTasks . every ( ( v ) => v === "" ) ;
679+ 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).
682+ const transitioningToTasks = wasEmpty && ! isEmpty ;
683+ replace ( {
684+ tasks : newValues ,
685+ cursor : undefined ,
686+ direction : undefined ,
687+ ...( transitioningToTasks ? { rootOnly : "false" } : { } ) ,
688+ } ) ;
678689 } ;
679690
680691 const filtered = useMemo ( ( ) => {
@@ -1456,16 +1467,15 @@ function AppliedVersionsFilter() {
14561467const rootOnlyShortcut = { key : "o" } ;
14571468
14581469function RootOnlyToggle ( { defaultValue } : { defaultValue : boolean } ) {
1459- const { value, values , replace } = useSearchParams ( ) ;
1470+ const { value, replace } = useSearchParams ( ) ;
14601471 const searchValue = value ( "rootOnly" ) ;
14611472 const rootOnly = searchValue !== undefined ? searchValue === "true" : defaultValue ;
14621473
14631474 const batchId = value ( "batchId" ) ;
14641475 const runId = value ( "runId" ) ;
14651476 const scheduleId = value ( "scheduleId" ) ;
1466- const tasks = values ( "tasks" ) ;
14671477
1468- const disabled = ! ! batchId || ! ! runId || ! ! scheduleId || tasks . length > 0 ;
1478+ const disabled = ! ! batchId || ! ! runId || ! ! scheduleId ;
14691479
14701480 return (
14711481 < Ariakit . TooltipProvider timeout = { 200 } >
0 commit comments