diff --git a/src/vs/workbench/contrib/void/browser/react/src/markdown/BlockCode.tsx b/src/vs/workbench/contrib/void/browser/react/src/markdown/BlockCode.tsx index 4c2cbea4..f7954b82 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/markdown/BlockCode.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/markdown/BlockCode.tsx @@ -13,7 +13,7 @@ export const BlockCode = ({ buttonsOnHover, ...codeEditorProps }: { buttonsOnHov return ( <> -
+
{buttonsOnHover === null ? null : (
diff --git a/src/vs/workbench/contrib/void/browser/react/src/markdown/ChatMarkdownRender.tsx b/src/vs/workbench/contrib/void/browser/react/src/markdown/ChatMarkdownRender.tsx index 8168bed3..d2f24569 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/markdown/ChatMarkdownRender.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/markdown/ChatMarkdownRender.tsx @@ -51,11 +51,13 @@ const RenderToken = ({ token, nested, noSpace, chatMessageLocation, tokenIdx }: tokenIdx: tokenIdx, }) : null - return + } /> +
} if (t.type === "heading") { 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 1fda7cfb..3d6fbcb7 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 @@ -187,12 +187,14 @@ export const VoidChatArea: React.FC = ({ return (
{ @@ -414,7 +416,7 @@ export const SelectedFiles = ( } return ( -
+
{allSelections.map((selection, i) => { @@ -424,94 +426,65 @@ export const SelectedFiles = ( const thisKey = `${isThisSelectionProspective}-${i}-${selections.length}` - const selectionHTML = (
- {/* selection summary */} -
{ + if (isThisSelectionProspective) { // add prospective selection to selections + if (type !== 'staging') return; // (never) + setSelections([...selections, selection]) + } else if (isThisSelectionAFile) { // open files + commandService.executeCommand('vscode.open', selection.fileURI, { + preview: true, + // preserveFocus: false, + }); + } else { // show text + setSelectionIsOpened(s => { + const newS = [...s] + newS[i] = !newS[i] + return newS + }); + } + }} > -
{ - if (isThisSelectionProspective) { // add prospective selection to selections - if (type !== 'staging') return; // (never) - setSelections([...selections, selection]) + { // file name and range + getBasename(selection.fileURI.fsPath) + + (isThisSelectionAFile ? '' : ` (${selection.range.startLineNumber}-${selection.range.endLineNumber})`) + } - } else if (isThisSelectionAFile) { // open files - commandService.executeCommand('vscode.open', selection.fileURI, { - preview: true, - // preserveFocus: false, - }); - } else { // show text - 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' && !isThisSelectionProspective && - { - e.stopPropagation(); // don't open/close selection - if (type !== 'staging') return; - setSelections([...selections.slice(0, i), ...selections.slice(i + 1)]) - setSelectionIsOpened(o => [...o.slice(0, i), ...o.slice(i + 1)]) - }} - > - - } - - -
- - {/* clear all selections button */} - {/* {type !== 'staging' || selections.length === 0 || i !== selections.length - 1 - ? null - :
-
setIsClearHovered(true)} - onMouseLeave={() => setIsClearHovered(false)} - > - { setSelections([]) }} - /> -
-
- } */} + {type === 'staging' && !isThisSelectionProspective ? // X button + { + e.stopPropagation(); // don't open/close selection + if (type !== 'staging') return; + setSelections([...selections.slice(0, i), ...selections.slice(i + 1)]) + setSelectionIsOpened(o => [...o.slice(0, i), ...o.slice(i + 1)]) + }} + size={10} + /> + : <> + }
- {/* selection text */} - {isThisSelectionOpened && + + {/* code box */} + {isThisSelectionOpened ?
{ @@ -525,14 +498,9 @@ export const SelectedFiles = ( showScrollbars={true} />
+ : <> } -
) - - return - {/* divider between `selections` and `prospectiveSelections` */} - {/* {selections.length > 0 && i === selections.length &&
} */} - {selectionHTML} -
+
})} @@ -851,7 +819,7 @@ const ChatBubble = ({ chatMessage, isLoading, messageIdx }: { chatMessage: ChatM > setIsDisabled(!text)} onFocus={() => { @@ -1101,7 +1069,7 @@ export const SidebarChat = () => { featureName="Ctrl+L" >