diff --git a/extensions/void/src/sidebar/SidebarThreadSelector.tsx b/extensions/void/src/sidebar/SidebarThreadSelector.tsx
index 59faa41f..323d66e5 100644
--- a/extensions/void/src/sidebar/SidebarThreadSelector.tsx
+++ b/extensions/void/src/sidebar/SidebarThreadSelector.tsx
@@ -1,10 +1,26 @@
import React from "react";
import { ThreadsProvider, useThreads } from "./contextForThreads";
+
+const truncate = (s: string) => {
+ let len = s.length
+ const TRUNC_AFTER = 16
+ if (len >= TRUNC_AFTER)
+ s = s.substring(0, TRUNC_AFTER) + '...'
+ return s
+}
+
+
export const SidebarThreadSelector = ({ onClose }: { onClose: () => void }) => {
const { allThreads, currentThread, switchToThread } = useThreads()
+
+ // sorted by most recent to least recent
+ const sortedThreadIds = Object.keys(allThreads ?? {}).sort((threadId1, threadId2) => allThreads![threadId1].createdAt > allThreads![threadId2].createdAt ? -1 : 1)
+
return (
-
+
+
+ {/* X button at top right */}
- {/* iterate through all past threads */}
- {Object.keys(allThreads ?? {}).map((threadId) => {
- const pastThread = (allThreads ?? {})[threadId];
- return (
-
- )
- })}
+
+ {/* a list of all the past threads */}
+