File tree Expand file tree Collapse file tree
src/components/functional/browser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,6 +95,11 @@ export function Browser(props: Props) {
9595 const search = usePropagate ( "" ) ;
9696 const { setRoute } = useRoute ( ) ;
9797
98+ // biome-ignore lint/correctness/useExhaustiveDependencies: Whenever the path changes, we want to clear the search
99+ useEffect ( ( ) => {
100+ search . clear ( ) ;
101+ } , [ props . path ] ) ;
102+
98103 const [ focus , setFocus ] = useState < ( typeof focusItems ) [ number ] > ( "key-list" ) ;
99104
100105 // const [showRecursive, setShowRecursive] = useState(false);
@@ -136,9 +141,9 @@ export function Browser(props: Props) {
136141 promises . push ( redisUtils . getDirectChildGroups ( ) ) ;
137142 }
138143 const allEntries = await Promise . all ( promises ) . then ( ( e ) => e . flat ( ) ) ;
139- return allEntries . sort ( ( a , b ) =>
140- a . relativePath . localeCompare ( b . relativePath ) ,
141- ) ;
144+ return allEntries
145+ . filter ( ( entry ) => entry . baseName . includes ( search . propagatedValue ) )
146+ . sort ( ( a , b ) => a . relativePath . localeCompare ( b . relativePath ) ) ;
142147 } ,
143148 } ) ;
144149
You can’t perform that action at this time.
0 commit comments