@@ -3,7 +3,6 @@ import { encodeFilePath } from "@/context/file/path"
33import { Collapsible } from "@opencode-ai/ui/collapsible"
44import { FileIcon } from "@opencode-ai/ui/file-icon"
55import { Icon } from "@opencode-ai/ui/icon"
6- import { Tooltip } from "@opencode-ai/ui/tooltip"
76import {
87 createEffect ,
98 createMemo ,
@@ -192,59 +191,6 @@ const FileTreeNode = (
192191 )
193192}
194193
195- const FileTreeNodeTooltip = ( props : { enabled : boolean ; node : FileNode ; kind ?: Kind ; children : JSXElement } ) => {
196- if ( ! props . enabled ) return props . children
197-
198- const parts = props . node . path . split ( "/" )
199- const leaf = parts [ parts . length - 1 ] ?? props . node . path
200- const head = parts . slice ( 0 , - 1 ) . join ( "/" )
201- const prefix = head ? `${ head } /` : ""
202- const label =
203- props . kind === "add"
204- ? "Additions"
205- : props . kind === "del"
206- ? "Deletions"
207- : props . kind === "mix"
208- ? "Modifications"
209- : undefined
210-
211- return (
212- < Tooltip
213- openDelay = { 2000 }
214- placement = "bottom-start"
215- class = "w-full"
216- contentStyle = { { "max-width" : "480px" , width : "fit-content" } }
217- value = {
218- < div class = "flex items-center min-w-0 whitespace-nowrap text-12-regular" >
219- < span
220- class = "min-w-0 truncate text-text-invert-base"
221- style = { { direction : "rtl" , "unicode-bidi" : "plaintext" } }
222- >
223- { prefix }
224- </ span >
225- < span class = "shrink-0 text-text-invert-strong" > { leaf } </ span >
226- < Show when = { label } >
227- { ( text ) => (
228- < >
229- < span class = "mx-1 font-bold text-text-invert-strong" > •</ span >
230- < span class = "shrink-0 text-text-invert-strong" > { text ( ) } </ span >
231- </ >
232- ) }
233- </ Show >
234- < Show when = { props . node . type === "directory" && props . node . ignored } >
235- < >
236- < span class = "mx-1 font-bold text-text-invert-strong" > •</ span >
237- < span class = "shrink-0 text-text-invert-strong" > Ignored</ span >
238- </ >
239- </ Show >
240- </ div >
241- }
242- >
243- { props . children }
244- </ Tooltip >
245- )
246- }
247-
248194export default function FileTree ( props : {
249195 path : string
250196 class ?: string
@@ -255,7 +201,6 @@ export default function FileTree(props: {
255201 modified ?: readonly string [ ]
256202 kinds ?: ReadonlyMap < string , Kind >
257203 draggable ?: boolean
258- tooltip ?: boolean
259204 onFileClick ?: ( file : FileNode ) => void
260205
261206 _filter ?: Filter
@@ -267,7 +212,6 @@ export default function FileTree(props: {
267212 const file = useFile ( )
268213 const level = props . level ?? 0
269214 const draggable = ( ) => props . draggable ?? true
270- const tooltip = ( ) => props . tooltip ?? true
271215
272216 const key = ( p : string ) =>
273217 file
@@ -467,21 +411,19 @@ export default function FileTree(props: {
467411 onOpenChange = { ( open ) => ( open ? file . tree . expand ( node . path ) : file . tree . collapse ( node . path ) ) }
468412 >
469413 < Collapsible . Trigger >
470- < FileTreeNodeTooltip enabled = { tooltip ( ) } node = { node } kind = { kind ( ) } >
471- < FileTreeNode
472- node = { node }
473- level = { level }
474- active = { props . active }
475- nodeClass = { props . nodeClass }
476- draggable = { draggable ( ) }
477- kinds = { kinds ( ) }
478- marks = { marks ( ) }
479- >
480- < div class = "size-4 flex items-center justify-center text-icon-weak" >
481- < Icon name = { expanded ( ) ? "chevron-down" : "chevron-right" } size = "small" />
482- </ div >
483- </ FileTreeNode >
484- </ FileTreeNodeTooltip >
414+ < FileTreeNode
415+ node = { node }
416+ level = { level }
417+ active = { props . active }
418+ nodeClass = { props . nodeClass }
419+ draggable = { draggable ( ) }
420+ kinds = { kinds ( ) }
421+ marks = { marks ( ) }
422+ >
423+ < div class = "size-4 flex items-center justify-center text-icon-weak" >
424+ < Icon name = { expanded ( ) ? "chevron-down" : "chevron-right" } size = "small" />
425+ </ div >
426+ </ FileTreeNode >
485427 </ Collapsible . Trigger >
486428 < Collapsible . Content class = "relative pt-0.5" >
487429 < div
@@ -504,7 +446,6 @@ export default function FileTree(props: {
504446 kinds = { props . kinds }
505447 active = { props . active }
506448 draggable = { props . draggable }
507- tooltip = { props . tooltip }
508449 onFileClick = { props . onFileClick }
509450 _filter = { filter ( ) }
510451 _marks = { marks ( ) }
@@ -517,53 +458,51 @@ export default function FileTree(props: {
517458 </ Collapsible >
518459 </ Match >
519460 < Match when = { node . type === "file" } >
520- < FileTreeNodeTooltip enabled = { tooltip ( ) } node = { node } kind = { kind ( ) } >
521- < FileTreeNode
522- node = { node }
523- level = { level }
524- active = { props . active }
525- nodeClass = { props . nodeClass }
526- draggable = { draggable ( ) }
527- kinds = { kinds ( ) }
528- marks = { marks ( ) }
529- as = "button"
530- type = "button"
531- onClick = { ( ) => props . onFileClick ?.( node ) }
532- >
533- < div class = "w-4 shrink-0" />
534- < Switch >
535- < Match when = { node . ignored } >
461+ < FileTreeNode
462+ node = { node }
463+ level = { level }
464+ active = { props . active }
465+ nodeClass = { props . nodeClass }
466+ draggable = { draggable ( ) }
467+ kinds = { kinds ( ) }
468+ marks = { marks ( ) }
469+ as = "button"
470+ type = "button"
471+ onClick = { ( ) => props . onFileClick ?.( node ) }
472+ >
473+ < div class = "w-4 shrink-0" />
474+ < Switch >
475+ < Match when = { node . ignored } >
476+ < FileIcon
477+ node = { node }
478+ class = "size-4 filetree-icon filetree-icon--mono"
479+ style = "color: var(--icon-weak-base)"
480+ mono
481+ />
482+ </ Match >
483+ < Match when = { active ( ) } >
484+ < FileIcon
485+ node = { node }
486+ class = "size-4 filetree-icon filetree-icon--mono"
487+ style = { kindTextColor ( kind ( ) ! ) }
488+ mono
489+ />
490+ </ Match >
491+ < Match when = { ! node . ignored } >
492+ < span class = "filetree-iconpair size-4" >
536493 < FileIcon
537494 node = { node }
538- class = "size-4 filetree-icon filetree-icon--mono"
539- style = "color: var(--icon-weak-base)"
540- mono
495+ class = "size-4 filetree-icon filetree-icon--color opacity-0 group-hover/filetree:opacity-100"
541496 />
542- </ Match >
543- < Match when = { active ( ) } >
544497 < FileIcon
545498 node = { node }
546- class = "size-4 filetree-icon filetree-icon--mono"
547- style = { kindTextColor ( kind ( ) ! ) }
499+ class = "size-4 filetree-icon filetree-icon--mono group-hover/filetree:opacity-0"
548500 mono
549501 />
550- </ Match >
551- < Match when = { ! node . ignored } >
552- < span class = "filetree-iconpair size-4" >
553- < FileIcon
554- node = { node }
555- class = "size-4 filetree-icon filetree-icon--color opacity-0 group-hover/filetree:opacity-100"
556- />
557- < FileIcon
558- node = { node }
559- class = "size-4 filetree-icon filetree-icon--mono group-hover/filetree:opacity-0"
560- mono
561- />
562- </ span >
563- </ Match >
564- </ Switch >
565- </ FileTreeNode >
566- </ FileTreeNodeTooltip >
502+ </ span >
503+ </ Match >
504+ </ Switch >
505+ </ FileTreeNode >
567506 </ Match >
568507 </ Switch >
569508 )
0 commit comments