diff --git a/apps/desktop/src/app/right-sidebar/files/tree.tsx b/apps/desktop/src/app/right-sidebar/files/tree.tsx index 2b74280a76b0..0783b64a521b 100644 --- a/apps/desktop/src/app/right-sidebar/files/tree.tsx +++ b/apps/desktop/src/app/right-sidebar/files/tree.tsx @@ -4,6 +4,7 @@ import { type NodeApi, type NodeRendererProps, type RowRendererProps, Tree, type import { TreeSkeleton } from '@/components/chat/skeletons' import { Codicon } from '@/components/ui/codicon' +import { Tip } from '@/components/ui/tooltip' import { useResizeObserver } from '@/hooks/use-resize-observer' import { cn } from '@/lib/utils' import { $repoChangeByPath, type RepoChangeKind } from '@/store/coding-status' @@ -271,85 +272,86 @@ function ProjectTreeRow({ const editing = !isPlaceholder && renamingPath === node.data.id const row = ( -
{ - event.stopPropagation() - - // Read the rename atom LIVE (not the render closure): the fall-through - // click from a context-menu close can fire before the editing re-render - // commits, so a stale closure would still select/activate and yank focus. - if (isPlaceholder || $renamingPath.get() === node.data.id) { - return - } - - if (event.shiftKey) { - ;(isFolder ? onAttachFolder : onAttachFile)(node.data.id) - - return - } - - if (isFolder) { - node.toggle() - } else { - node.select() - } - }} - onDoubleClick={event => { - event.stopPropagation() - - if (!isFolder && !isPlaceholder && $renamingPath.get() !== node.data.id) { - onPreviewFile?.(node.data.id) - } - }} - onDragStart={event => { - if (isPlaceholder || $renamingPath.get() === node.data.id) { - event.preventDefault() - - return - } - - const payload = JSON.stringify([{ isDirectory: isFolder, path: node.data.id }]) - - event.dataTransfer.effectAllowed = 'copy' - event.dataTransfer.setData('application/x-hermes-paths', payload) - event.dataTransfer.setData('text/plain', node.data.id) - }} - ref={dragHandle} - style={{ - ...style, - paddingLeft: withTreeInset(style.paddingLeft) - }} - title={node.data.id} - > - {/* No chevron column — the folder icon (open/closed) already carries the - expand state, so the extra glyph was pure noise. */} - - {isPlaceholder && !isErrorPlaceholder ? ( - - ) : isErrorPlaceholder ? ( - - ) : isFolder ? ( - + +
{ + event.stopPropagation() + + // Read the rename atom LIVE (not the render closure): the fall-through + // click from a context-menu close can fire before the editing re-render + // commits, so a stale closure would still select/activate and yank focus. + if (isPlaceholder || $renamingPath.get() === node.data.id) { + return + } + + if (event.shiftKey) { + ;(isFolder ? onAttachFolder : onAttachFile)(node.data.id) + + return + } + + if (isFolder) { + node.toggle() + } else { + node.select() + } + }} + onDoubleClick={event => { + event.stopPropagation() + + if (!isFolder && !isPlaceholder && $renamingPath.get() !== node.data.id) { + onPreviewFile?.(node.data.id) + } + }} + onDragStart={event => { + if (isPlaceholder || $renamingPath.get() === node.data.id) { + event.preventDefault() + + return + } + + const payload = JSON.stringify([{ isDirectory: isFolder, path: node.data.id }]) + + event.dataTransfer.effectAllowed = 'copy' + event.dataTransfer.setData('application/x-hermes-paths', payload) + event.dataTransfer.setData('text/plain', node.data.id) + }} + ref={dragHandle} + style={{ + ...style, + paddingLeft: withTreeInset(style.paddingLeft) + }} + > + {/* No chevron column — the folder icon (open/closed) already carries the + expand state, so the extra glyph was pure noise. */} + + {isPlaceholder && !isErrorPlaceholder ? ( + + ) : isErrorPlaceholder ? ( + + ) : isFolder ? ( + + ) : ( + + )} + + {editing ? ( + ) : ( - + // Git decoration (VS Code-style): tint changed files; the explicit color + // wins over the row's hover/selected text color, so it persists. + {node.data.name} )} - - {editing ? ( - - ) : ( - // Git decoration (VS Code-style): tint changed files; the explicit color - // wins over the row's hover/selected text color, so it persists. - {node.data.name} - )} -
+
+ ) if (isPlaceholder) { diff --git a/apps/desktop/src/app/right-sidebar/index.tsx b/apps/desktop/src/app/right-sidebar/index.tsx index d800137789f2..425fdb553fd5 100644 --- a/apps/desktop/src/app/right-sidebar/index.tsx +++ b/apps/desktop/src/app/right-sidebar/index.tsx @@ -5,6 +5,7 @@ import { TreeSkeleton } from '@/components/chat/skeletons' import { ErrorBoundary } from '@/components/error-boundary' import { Button } from '@/components/ui/button' import { Codicon } from '@/components/ui/codicon' +import { Tip } from '@/components/ui/tooltip' import { useDelayedTrue } from '@/hooks/use-delayed-true' import { useI18n } from '@/i18n' import { normalizeOrLocalPreviewTarget } from '@/lib/local-preview' @@ -151,28 +152,30 @@ function FilesystemTab({
{cwdName}
- - + + + + + +