Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Show all ungrouped threads when expanding the whole bot

vincent22100ed51347
diff --git a/src/components/Sidebar.pinned-show-all.dom.test.ts b/src/components/Sidebar.pinned-show-all.dom.test.ts
index 4505c230f6..0631611b34 100644
--- a/src/components/Sidebar.pinned-show-all.dom.test.ts
+++ b/src/components/Sidebar.pinned-show-all.dom.test.ts
@@ -116,9 +116,8 @@ describe("a bot's ungrouped threads", () => {
expect(looseRows()).toHaveLength(10);
await click("Show all 15 threads");
- expect(looseRows()).toHaveLength(10);
- expect(button("Show 3 more")).toBeTruthy();
- await click("Show 3 more");
+ expect(looseRows()).toHaveLength(13);
+ expect(button("Show 3 more")).toBeUndefined();
expect(host.querySelectorAll("[data-sidebar-thread-row]")).toHaveLength(15);
expect(button("Show fewer threads")).toBeTruthy();
await click("Show fewer threads");
diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx
index 16da54beb2..873046db61 100644
--- a/src/components/Sidebar.tsx
+++ b/src/components/Sidebar.tsx
@@ -622,7 +622,7 @@ export function BotThreadList({ bot, selected, drafting, query, pendingQueued, r
<span role="status" className="sr-only">{reorderStatus}</span>
{readError && <p role="alert" className="px-2.5 py-1 text-[12px] text-danger">{readError}</p>}
<span role="status" className="sr-only">{readStatus}</span>
- <UngroupedThreadList key={String(showAll)} botId={bot.id} tasks={ungrouped} activeId={selected && !drafting ? bot.threadId : undefined} heading={projects.length > 0} expanded={bulk.active || Boolean(query.trim())} renderThread={renderThread} />
+ <UngroupedThreadList key={String(showAll)} botId={bot.id} tasks={ungrouped} activeId={selected && !drafting ? bot.threadId : undefined} heading={projects.length > 0} expanded={showAll || bulk.active || Boolean(query.trim())} renderThread={renderThread} />
<HelperThreadGroup tasks={orderedThreadList(helpers)} renderThread={renderThread} />
<ThreadListFooter bulk={bulk} rows={shownRows} selected={selection} total={ownTasks.length} canShowAll={!query && !showAll && ownTasks.length > visibleTasks.length} canSelect={tasks.length > 1}
onShowAll={() => setShowAll(true)} onShowFewer={showAll && !query && !bulk.active && visibleSidebarThreads(ownTasks, bot.threadId, query, projects, false, routineRuns, bot.mainThreadId).length < ownTasks.length ? () => setShowAll(false) : undefined} freshConversation onDelete={(threadIds) => deleteThreadsInBulk({ botId: bot.id }, threadIds, dispatch)}