@@ -61,7 +61,7 @@ import { type loader as versionsLoader } from "~/routes/resources.orgs.$organiza
6161import { type loader as tagsLoader } from "~/routes/resources.environments.$envId.runs.tags" ;
6262import { Button } from "../../primitives/Buttons" ;
6363import { BulkActionTypeCombo } from "./BulkAction" ;
64- import { appliedSummary , FilterMenuProvider , TimeFilter } from "./SharedFilters" ;
64+ import { appliedSummary , FilterMenuProvider , TimeFilter , timeFilters } from "./SharedFilters" ;
6565import { AIFilterInput } from "./AIFilterInput" ;
6666import {
6767 allTaskRunStatuses ,
@@ -812,7 +812,7 @@ function TagsDropdown({
812812 onClose ?: ( ) => void ;
813813} ) {
814814 const environment = useEnvironment ( ) ;
815- const { values, replace } = useSearchParams ( ) ;
815+ const { values, value , replace } = useSearchParams ( ) ;
816816
817817 const handleChange = ( values : string [ ] ) => {
818818 clearSearchValue ( ) ;
@@ -823,6 +823,12 @@ function TagsDropdown({
823823 } ) ;
824824 } ;
825825
826+ const { period, from, to } = timeFilters ( {
827+ period : value ( "period" ) ,
828+ from : value ( "from" ) ,
829+ to : value ( "to" ) ,
830+ } ) ;
831+
826832 const tagValues = values ( "tags" ) . filter ( ( v ) => v !== "" ) ;
827833 const selected = tagValues . length > 0 ? tagValues : undefined ;
828834
@@ -833,8 +839,17 @@ function TagsDropdown({
833839 if ( searchValue ) {
834840 searchParams . set ( "name" , encodeURIComponent ( searchValue ) ) ;
835841 }
842+ if ( period ) {
843+ searchParams . set ( "period" , period ) ;
844+ }
845+ if ( from ) {
846+ searchParams . set ( "from" , from . getTime ( ) . toString ( ) ) ;
847+ }
848+ if ( to ) {
849+ searchParams . set ( "to" , to . getTime ( ) . toString ( ) ) ;
850+ }
836851 fetcher . load ( `/resources/environments/${ environment . id } /runs/tags?${ searchParams } ` ) ;
837- } , [ searchValue ] ) ;
852+ } , [ searchValue , period , from ?. getTime ( ) , to ?. getTime ( ) ] ) ;
838853
839854 const filtered = useMemo ( ( ) => {
840855 let items : string [ ] = [ ] ;
0 commit comments