diff --git a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx index c9b49391..aed5b4b2 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx @@ -288,59 +288,83 @@ export const SelectedFiles = ( const isThisSelectionOpened = !!(selection.selectionStr && selectionIsOpened[i]) const isThisSelectionAFile = selection.selectionStr === null - const content =
{/* selection summary */} -
{ - // open the file if it is a file - if (isThisSelectionAFile) { - commandService.executeCommand('vscode.open', selection.fileURI, { - preview: true, - // preserveFocus: false, - }); - } else { - // open the selection if it is a text-selection - setSelectionIsOpened(s => { - const newS = [...s] - newS[i] = !newS[i] - return newS - }); - } - }} +
- - {/* file name */} - {getBasename(selection.fileURI.fsPath)} - {/* selection range */} - {!isThisSelectionAFile ? ` (${selection.range.startLineNumber}-${selection.range.endLineNumber})` : ''} - +
{ + // open the file if it is a file + if (isThisSelectionAFile) { + commandService.executeCommand('vscode.open', selection.fileURI, { + preview: true, + // preserveFocus: false, + }); + } else { + // open the selection if it is a text-selection + setSelectionIsOpened(s => { + const newS = [...s] + newS[i] = !newS[i] + return newS + }); + } + }} + > + + {/* file name */} + {getBasename(selection.fileURI.fsPath)} + {/* selection range */} + {!isThisSelectionAFile ? ` (${selection.range.startLineNumber}-${selection.range.endLineNumber})` : ''} + - {/* X button */} - {type === 'staging' && - { - e.stopPropagation(); // don't open/close selection - if (type !== 'staging') return; - setStaging([...selections.slice(0, i), ...selections.slice(i + 1)]) - setSelectionIsOpened(o => [...o.slice(0, i), ...o.slice(i + 1)]) - }} - > - - } + {/* X button */} + {type === 'staging' && + { + e.stopPropagation(); // don't open/close selection + if (type !== 'staging') return; + setStaging([...selections.slice(0, i), ...selections.slice(i + 1)]) + setSelectionIsOpened(o => [...o.slice(0, i), ...o.slice(i + 1)]) + }} + > + + } +
+ + {/* delete all selections button */} + {type !== 'staging' || selections.length === 0 || i !== selections.length - 1 + ? null + :
+
setIsClearHovered(true)} + onMouseLeave={() => setIsClearHovered(false)} + > + { setStaging([]) }} + /> +
+
+ }
{/* selection text */} {isThisSelectionOpened && @@ -359,26 +383,6 @@ export const SelectedFiles = (
}
- if (type !== 'staging' || selections.length === 0 || i !== selections.length - 1) - return {content} - - else return
- {content} -
setIsClearHovered(true)} - onMouseLeave={() => setIsClearHovered(false)} - > - { setStaging([]) }} - /> -
-
})} @@ -413,14 +417,14 @@ const ChatBubble = ({ chatMessage, isLoading }: { return