From 42c50413f583f00d09a6de34ff4c525f9bdf9f2d Mon Sep 17 00:00:00 2001 From: servetgulnaroglu Date: Sat, 28 Jun 2025 15:08:40 +0300 Subject: [PATCH 1/2] added tooltip for selected files the prevent ambiguity --- .../react/src/sidebar-tsx/SidebarChat.tsx | 149 +++++++++--------- 1 file changed, 78 insertions(+), 71 deletions(-) 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 ea24ef38..61cc98dc 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 @@ -664,81 +664,88 @@ export const SelectedFiles = ( key={thisKey} className={`flex flex-col space-y-[1px]`} > - {/* summarybox */} -
{ - if (type !== 'staging') return; // (never) - if (isThisSelectionProspective) { // add prospective selection to selections - setSelections([...selections, selection]) - } - else if (selection.type === 'File') { // open files - voidOpenFileFn(selection.uri, accessor); - - const wasAddedAsCurrentFile = selection.state.wasAddedAsCurrentFile - if (wasAddedAsCurrentFile) { - // make it so the file is added permanently, not just as the current file - const newSelection: StagingSelectionItem = { ...selection, state: { ...selection.state, wasAddedAsCurrentFile: false } } - setSelections([ - ...selections.slice(0, i), - newSelection, - ...selections.slice(i + 1) - ]) - } - } - else if (selection.type === 'CodeSelection') { - voidOpenFileFn(selection.uri, accessor, selection.range); - } - else if (selection.type === 'Folder') { - // TODO!!! reveal in tree - } - }} + {/* tooltip for file path */} + - {} + {/* summarybox */} +
{ + if (type !== 'staging') return; // (never) + if (isThisSelectionProspective) { // add prospective selection to selections + setSelections([...selections, selection]) + } + else if (selection.type === 'File') { // open files + voidOpenFileFn(selection.uri, accessor); - { // file name and range - getBasename(selection.uri.fsPath) - + (selection.type === 'CodeSelection' ? ` (${selection.range[0]}-${selection.range[1]})` : '') - } + const wasAddedAsCurrentFile = selection.state.wasAddedAsCurrentFile + if (wasAddedAsCurrentFile) { + // make it so the file is added permanently, not just as the current file + const newSelection: StagingSelectionItem = { ...selection, state: { ...selection.state, wasAddedAsCurrentFile: false } } + setSelections([ + ...selections.slice(0, i), + newSelection, + ...selections.slice(i + 1) + ]) + } + } + else if (selection.type === 'CodeSelection') { + voidOpenFileFn(selection.uri, accessor, selection.range); + } + else if (selection.type === 'Folder') { + // TODO!!! reveal in tree + } + }} + > + {} - {selection.type === 'File' && selection.state.wasAddedAsCurrentFile && messageIdx === undefined && currentURI?.fsPath === selection.uri.fsPath ? - - {`(Current File)`} - - : null - } + { // file name and range + getBasename(selection.uri.fsPath) + + (selection.type === 'CodeSelection' ? ` (${selection.range[0]}-${selection.range[1]})` : '') + } - {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)]) - }} - > - -
- : <> - } -
+ {selection.type === 'File' && selection.state.wasAddedAsCurrentFile && messageIdx === undefined && currentURI?.fsPath === selection.uri.fsPath ? + + {`(Current File)`} + + : null + } + + {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)]) + }} + > + +
+ : <> + } +
+ })} From c90f707070429f1beec7319fff928080b4fbcb1a Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Sat, 28 Jun 2025 22:12:08 -0700 Subject: [PATCH 2/2] add delay --- .../contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx | 1 + 1 file changed, 1 insertion(+) 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 61cc98dc..2cd6c742 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 @@ -669,6 +669,7 @@ export const SelectedFiles = ( data-tooltip-id='void-tooltip' data-tooltip-content={getRelative(selection.uri, accessor)} data-tooltip-place='top' + data-tooltip-delay-show={3000} > {/* summarybox */}