- {/* selection */}
-
-
-
- {/* selections */}
- {(selections && selections.length !== 0) &&
-
-
}
-
-
-
-
+
+ {/* input box */}
+
+ {/* middle row */}
+
+ {/* text input */}
+
+
+
+ {/* bottom row */}
+
+ {/* submit / stop button */}
+ {isLoading ?
+ // stop button
+
+ :
+ // submit button (up arrow)
+
+ }
+
+
+
+
+
+
+
>
}
diff --git a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarSettings.tsx b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarSettings.tsx
deleted file mode 100644
index d0f910377..000000000
--- a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarSettings.tsx
+++ /dev/null
@@ -1,115 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Glass Devtools, Inc. All rights reserved.
- * Void Editor additions licensed under the AGPLv3 License.
- *--------------------------------------------------------------------------------------------*/
-import React, { useEffect, useState } from 'react';
-import { useConfigState, useService } from '../util/services.js';
-import { IVoidConfigStateService, nonDefaultConfigFields, PartialVoidConfig, VoidConfig, VoidConfigField, VoidConfigInfo, SetFieldFnType, ConfigState } from '../../../registerConfig.js';
-
-
-const SettingOfFieldAndParam = ({ field, param, configState, configStateService }:
- { field: VoidConfigField; param: string; configState: ConfigState; configStateService: IVoidConfigStateService }) => {
-
- const { partialVoidConfig } = configState
-
-
- const { enumArr, defaultVal, description } = configStateService.voidConfigInfo[field][param]
- const val = partialVoidConfig[field]?.[param] ?? defaultVal // current value of this item
-
- const updateState = (newValue: string) => { configStateService.setField(field, param, newValue) }
-
- const resetButton =
-
- const inputElement = enumArr === undefined ?
- // string
- (
updateState(e.target.value)}
- />)
- :
- // enum
- (
)
-
- return
-
-
{description}
-
- {inputElement}
- {resetButton}
-
-
-}
-
-
-export const SidebarSettings = () => {
-
- const configState = useConfigState()
- const configStateService = useService('configStateService')
-
- const { voidConfig } = configState
- const current_field = voidConfig.default['whichApi'] as VoidConfigField
-
- return (
-
-
- {/* choose the field */}
-
-
-
-
-
-
-
- {/* render all fields, but hide the ones not visible for fast tab switching */}
- {nonDefaultConfigFields.map(field => {
- return
- {Object.keys(configStateService.voidConfigInfo[field]).map((param) => (
-
- ))}
-
- })}
-
- )
-}
-
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 7ae8acefb..3c3e00d3d 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
@@ -1,7 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Glass Devtools, Inc. All rights reserved.
- * Void Editor additions licensed under the AGPLv3 License.
+ * Void Editor additions licensed under the AGPL 3.0 License.
*--------------------------------------------------------------------------------------------*/
+
import React from "react";
import { useService, useThreadsState } from '../util/services.js';
@@ -23,10 +24,10 @@ export const SidebarThreadSelector = () => {
const { allThreads } = threadsState
// sorted by most recent to least recent
- const sortedThreadIds = Object.keys(allThreads ?? {}).sort((threadId1, threadId2) => allThreads![threadId1].lastModified > allThreads![threadId2].lastModified ? 1 : -1)
+ const sortedThreadIds = Object.keys(allThreads ?? {}).sort((threadId1, threadId2) => allThreads![threadId1].lastModified > allThreads![threadId2].lastModified ? -1 : 1)
return (
-
+
{/* X button at top right */}
@@ -56,21 +57,26 @@ export const SidebarThreadSelector = () => {
let btnStringArr: string[] = []
- let msg1 = truncate(allThreads[threadId].messages[0]?.displayContent ?? '(empty)')
- btnStringArr.push(msg1)
+ const firstMsgIdx = allThreads[threadId].messages.findIndex(msg => msg.role !== 'system' && !!msg.displayContent) ?? ''
+ if (firstMsgIdx !== -1)
+ btnStringArr.push(truncate(allThreads[threadId].messages[firstMsgIdx].displayContent ?? ''))
+ else
+ btnStringArr.push('""')
- let msg2 = truncate(allThreads[threadId].messages[1]?.displayContent ?? '')
- if (msg2)
- btnStringArr.push(msg2)
+ const secondMsgIdx = allThreads[threadId].messages.findIndex((msg, i) => msg.role !== 'system' && !!msg.displayContent && i > firstMsgIdx) ?? ''
+ if (secondMsgIdx !== -1)
+ btnStringArr.push(truncate(allThreads[threadId].messages[secondMsgIdx].displayContent ?? ''))
- btnStringArr.push(allThreads[threadId].messages.length + '')
+ const numMessagesRemaining = allThreads[threadId].messages.filter((msg, i) => msg.role !== 'system' && !!msg.displayContent && i > secondMsgIdx).length
+ if (numMessagesRemaining > 0)
+ btnStringArr.push(numMessagesRemaining + '')
const btnString = btnStringArr.join(' / ')
return (