@@ -14,7 +14,6 @@ import {
1414 ChevronDown ,
1515 ChevronRight ,
1616 ChevronsDownUp ,
17- ChevronsUpDown ,
1817 FolderClosed ,
1918 FolderOpen ,
2019 RefreshCw ,
@@ -168,46 +167,6 @@ export const ExplorerTab: React.FC<ExplorerTabProps> = (props) => {
168167 } ) ) ;
169168 } ;
170169
171- // Expand all recursively (skip gitignored directories)
172- const handleExpandAll = async ( ) => {
173- const allDirs : string [ ] = [ ] ;
174- const entriesCache = new Map ( state . entries ) ;
175-
176- // Recursively fetch and collect all non-ignored directories
177- const expandRecursively = async ( parentKey : string ) : Promise < void > => {
178- let entries = entriesCache . get ( parentKey ) ;
179-
180- // Fetch if not in cache
181- if ( ! entries ) {
182- const fetched = await fetchDirectory ( parentKey === "__root__" ? "" : parentKey ) ;
183- if ( fetched ) {
184- entries = fetched ;
185- entriesCache . set ( parentKey , entries ) ;
186- }
187- }
188-
189- if ( ! entries ) return ;
190-
191- // Process children in parallel
192- const childPromises : Array < Promise < void > > = [ ] ;
193- for ( const entry of entries ) {
194- if ( entry . isDirectory && ! entry . ignored ) {
195- allDirs . push ( entry . path ) ;
196- childPromises . push ( expandRecursively ( entry . path ) ) ;
197- }
198- }
199-
200- await Promise . all ( childPromises ) ;
201- } ;
202-
203- await expandRecursively ( "__root__" ) ;
204-
205- setState ( ( prev ) => ( {
206- ...prev ,
207- expanded : new Set ( allDirs ) ,
208- } ) ) ;
209- } ;
210-
211170 const hasExpandedDirs = state . expanded . size > 0 ;
212171
213172 // Render a tree node recursively
@@ -308,24 +267,20 @@ export const ExplorerTab: React.FC<ExplorerTabProps> = (props) => {
308267 </ TooltipTrigger >
309268 < TooltipContent side = "bottom" > Refresh</ TooltipContent >
310269 </ Tooltip >
311- < Tooltip >
312- < TooltipTrigger asChild >
313- < button
314- type = " button"
315- className = "text-muted hover:bg-accent/50 hover:text-foreground rounded p-1 "
316- onClick = { hasExpandedDirs ? handleCollapseAll : handleExpandAll }
317- >
318- { hasExpandedDirs ? (
270+ { hasExpandedDirs && (
271+ < Tooltip >
272+ < TooltipTrigger asChild >
273+ < button
274+ type = "button "
275+ className = "text-muted hover:bg-accent/50 hover:text-foreground rounded p-1"
276+ onClick = { handleCollapseAll }
277+ >
319278 < ChevronsDownUp className = "h-3.5 w-3.5" />
320- ) : (
321- < ChevronsUpDown className = "h-3.5 w-3.5" />
322- ) }
323- </ button >
324- </ TooltipTrigger >
325- < TooltipContent side = "bottom" >
326- { hasExpandedDirs ? "Collapse All" : "Expand All" }
327- </ TooltipContent >
328- </ Tooltip >
279+ </ button >
280+ </ TooltipTrigger >
281+ < TooltipContent side = "bottom" > Collapse All</ TooltipContent >
282+ </ Tooltip >
283+ ) }
329284 </ div >
330285 </ div >
331286
0 commit comments