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 10372fa6..a531baa9 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
@@ -53,56 +53,62 @@ export const SidebarThreadSelector = () => {
{/* a list of all the past threads */}
-
- {sortedThreadIds.map((threadId) => {
- if (!allThreads) {
- return {`No history found.`} ;
- }
+
- const pastThread = allThreads[threadId];
- let firstMsg = null;
- let secondMsg = null;
+ {sortedThreadIds.length === 0
- const firstMsgIdx = pastThread.messages.findIndex(
- (msg) => msg.role !== 'system' && !!msg.displayContent
- );
+ ? {`No history found`}
- if (firstMsgIdx !== -1) {
- firstMsg = truncate(pastThread.messages[firstMsgIdx].displayContent ?? '');
- } else {
- firstMsg = '""';
- }
+ : sortedThreadIds.map((threadId) => {
+ if (!allThreads) {
+ return {`No history found`} ;
+ }
- const secondMsgIdx = pastThread.messages.findIndex(
- (msg, i) => msg.role !== 'system' && !!msg.displayContent && i > firstMsgIdx
- );
+ const pastThread = allThreads[threadId];
+ let firstMsg = null;
+ let secondMsg = null;
- if (secondMsgIdx !== -1) {
- secondMsg = truncate(pastThread.messages[secondMsgIdx].displayContent ?? '');
- }
+ const firstMsgIdx = pastThread.messages.findIndex(
+ (msg) => msg.role !== 'system' && !!msg.displayContent
+ );
- const numMessages = pastThread.messages.filter(
- (msg) => msg.role !== 'system'
- ).length;
+ if (firstMsgIdx !== -1) {
+ firstMsg = truncate(pastThread.messages[firstMsgIdx].displayContent ?? '');
+ } else {
+ firstMsg = '""';
+ }
- return (
-
- msg.role !== 'system' && !!msg.displayContent && i > firstMsgIdx
+ );
+
+ if (secondMsgIdx !== -1) {
+ secondMsg = truncate(pastThread.messages[secondMsgIdx].displayContent ?? '');
+ }
+
+ const numMessages = pastThread.messages.filter(
+ (msg) => msg.role !== 'system'
+ ).length;
+
+ return (
+
+ threadsStateService.switchToThread(pastThread.id)}
- title={new Date(pastThread.createdAt).toLocaleString()}
- >
- {`${firstMsg} (${numMessages})`}
-
-
- );
- })}
+ onClick={() => threadsStateService.switchToThread(pastThread.id)}
+ title={new Date(pastThread.createdAt).toLocaleString()}
+ >
+ {`${firstMsg} (${numMessages})`}
+
+
+ );
+ })
+ }