diff --git a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarThreadSelector.tsx b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarThreadSelector.tsx index 42d2fa6d..0cfcae1c 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarThreadSelector.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarThreadSelector.tsx @@ -295,12 +295,13 @@ const PastThreadElement = ({ pastThread, idx, hoveredIdx, setHoveredIdx }: { pas const numMessages = pastThread.messages.filter((msg) => msg.role === 'assistant' || msg.role === 'user').length; - const dateHTML = + {/* {numMessages} */} {formatDate(new Date(pastThread.lastModified))} @@ -315,10 +316,6 @@ const PastThreadElement = ({ pastThread, idx, hoveredIdx, setHoveredIdx }: { pas }} onMouseEnter={() => setHoveredIdx(idx)} onMouseLeave={() => setHoveredIdx(null)} - data-tooltip-id='void-tooltip' - data-tooltip-content={`${numMessages} messages`} - data-tooltip-place='top' - data-tooltip-delay-show={500} >
@@ -328,7 +325,7 @@ const PastThreadElement = ({ pastThread, idx, hoveredIdx, setHoveredIdx }: { pas
{idx === hoveredIdx ? - : dateHTML + : optionsHTML }
diff --git a/src/vs/workbench/contrib/void/browser/react/src/styles.css b/src/vs/workbench/contrib/void/browser/react/src/styles.css index 58ddedab..f195c334 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/styles.css +++ b/src/vs/workbench/contrib/void/browser/react/src/styles.css @@ -12,7 +12,7 @@ --void-bg-1-alt: var(--vscode-badge-background); --void-bg-2: var(--vscode-sideBar-background); --void-bg-2-alt: color-mix(in srgb, var(--vscode-editor-background) 30%, var(--vscode-sideBar-background) 70%); - --void-bg-2-hover: color-mix(in srgb, var(--vscode-editor-foreground) 5%, var(--vscode-sideBar-background) 95%); + --void-bg-2-hover: color-mix(in srgb, var(--vscode-editor-foreground) 2%, var(--vscode-sideBar-background) 98%); --void-bg-3: var(--vscode-editor-background); --void-fg-0: color-mix(in srgb, var(--vscode-tab-activeForeground) 90%, black 10%); diff --git a/src/vs/workbench/contrib/void/browser/react/src/util/inputs.tsx b/src/vs/workbench/contrib/void/browser/react/src/util/inputs.tsx index d9a266a7..917ef5a0 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/util/inputs.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/util/inputs.tsx @@ -689,7 +689,7 @@ export const VoidCustomDropdownBox = >({ key={optionName} className={`flex items-center px-2 py-1 pr-4 cursor-pointer whitespace-nowrap transition-all duration-100 - ${thisOptionIsSelected ? 'bg-void-bg-2-hover' : 'bg-void-bg-2 hover:bg-void-bg-2-hover'} + ${thisOptionIsSelected ? 'bg-void-bg-2-hover' : 'bg-void-bg-2-alt hover:bg-void-bg-2-hover'} `} onClick={() => { onChangeOption(option); diff --git a/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx b/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx index bb8ab757..810def44 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx @@ -686,7 +686,7 @@ const transferTheseFilesOfOS = (os: 'mac' | 'windows' | 'linux' | null, fromEdit }, { from: URI.joinPath(URI.from({ scheme: 'file' }), userprofile, '.cursor', 'extensions'), to: URI.joinPath(URI.from({ scheme: 'file' }), userprofile, '.void-editor', 'extensions'), - }] + }] } else if (fromEditor === 'Windsurf') { return [{ from: URI.joinPath(URI.from({ scheme: 'file' }), appdata, 'Windsurf', 'User', 'settings.json'), diff --git a/src/vs/workbench/contrib/void/browser/sidebarActions.ts b/src/vs/workbench/contrib/void/browser/sidebarActions.ts index ba257dc4..d6c85982 100644 --- a/src/vs/workbench/contrib/void/browser/sidebarActions.ts +++ b/src/vs/workbench/contrib/void/browser/sidebarActions.ts @@ -202,7 +202,19 @@ registerAction2(class extends Action2 { }) +const openNewThreadAndFireFocus = (accessor: ServicesAccessor) => { + const stateService = accessor.get(ISidebarStateService) + stateService.setState({ isHistoryOpen: false, currentTab: 'chat' }) + const chatThreadService = accessor.get(IChatThreadService) + chatThreadService.openNewThread() + + // focus + stateService.fireFocusChat() + const window = getActiveWindow() + window.requestAnimationFrame(() => stateService.fireFocusChat()) + +} // New chat menu button @@ -213,6 +225,25 @@ registerAction2(class extends Action2 { title: 'New Chat', icon: { id: 'add' }, menu: [{ id: MenuId.ViewTitle, group: 'navigation', when: ContextKeyExpr.equals('view', VOID_VIEW_ID), }], + + }); + } + async run(accessor: ServicesAccessor): Promise { + + const metricsService = accessor.get(IMetricsService) + metricsService.capture('Chat Navigation', { type: 'New Chat' }) + + openNewThreadAndFireFocus(accessor) + + } +}) + +// New chat keybind +registerAction2(class extends Action2 { + constructor() { + super({ + id: 'void.newChatKeybindAction', + title: 'New Chat Keybind', keybinding: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyL, weight: KeybindingWeight.VoidExtension, @@ -220,19 +251,16 @@ registerAction2(class extends Action2 { }); } async run(accessor: ServicesAccessor): Promise { - const stateService = accessor.get(ISidebarStateService) + const metricsService = accessor.get(IMetricsService) + const commandService = accessor.get(ICommandService) + metricsService.capture('Chat Navigation', { type: 'New Chat Keybind' }) - metricsService.capture('Chat Navigation', { type: 'New Chat' }) + openNewThreadAndFireFocus(accessor) - stateService.setState({ isHistoryOpen: false, currentTab: 'chat' }) - const chatThreadService = accessor.get(IChatThreadService) - chatThreadService.openNewThread() + // add user's selection to chat + await commandService.executeCommand(VOID_CTRL_L_ACTION_ID) - // focus - stateService.fireFocusChat() - const window = getActiveWindow() - window.requestAnimationFrame(() => stateService.fireFocusChat()) } }) @@ -247,13 +275,27 @@ registerAction2(class extends Action2 { }); } async run(accessor: ServicesAccessor): Promise { + + // do not do anything if there are no messages (without this it clears all of the user's selections if the button is pressed) + // TODO the history button should be disabled in this case so we can remove this logic + const thread = accessor.get(IChatThreadService).getCurrentThread() + if (thread.messages.length === 0) { + return; + } + const stateService = accessor.get(ISidebarStateService) const metricsService = accessor.get(IMetricsService) + metricsService.capture('Chat Navigation', { type: 'History' }) + openNewThreadAndFireFocus(accessor) + + // doesnt do anything right now stateService.setState({ isHistoryOpen: !stateService.state.isHistoryOpen, currentTab: 'chat' }) stateService.fireBlurChat() + + } }) diff --git a/src/vs/workbench/contrib/void/browser/sidebarStateService.ts b/src/vs/workbench/contrib/void/browser/sidebarStateService.ts index 799ae14d..bd56657e 100644 --- a/src/vs/workbench/contrib/void/browser/sidebarStateService.ts +++ b/src/vs/workbench/contrib/void/browser/sidebarStateService.ts @@ -13,7 +13,7 @@ import { VOID_OPEN_SIDEBAR_ACTION_ID } from './sidebarPane.js'; // service that manages sidebar's state export type VoidSidebarState = { - isHistoryOpen: boolean; + isHistoryOpen: boolean; // this isn't doing anything right now currentTab: 'chat'; }