Skip to content

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

Keep the main thread in the collapsed Conversations list

Bugfixer 28e43405003ad
diff --git a/src/components/bot-panel/Conversations.dom.test.ts b/src/components/bot-panel/Conversations.dom.test.ts
index e39d1f86c0..057119c54d 100644
--- a/src/components/bot-panel/Conversations.dom.test.ts
+++ b/src/components/bot-panel/Conversations.dom.test.ts
@@ -146,6 +146,13 @@ describe("a bot's conversations in its panel", () => {
expect(more()!.textContent).toBe("Show 6 more");
});
+ it("keeps the main thread listed, with its star, when it is older than the first three", () => {
+ render(research({ mainThreadId: "gift" }));
+ expect(listed()).toEqual(["hiring", "launch", "who", "gift"]);
+ expect(row("gift").querySelector('[aria-label="Main thread"]')).not.toBeNull();
+ expect(more()!.textContent).toBe("Show 6 more");
+ });
+
it("offers only New conversation while the open one is the bot's only conversation", () => {
render(research({ tasks: [task("who", "Who am I?", 2)] }));
expect(host.querySelector("[data-conversations-new]")).not.toBeNull();
diff --git a/src/components/bot-panel/Conversations.tsx b/src/components/bot-panel/Conversations.tsx
index ba91d8916e..d58bc6f203 100644
--- a/src/components/bot-panel/Conversations.tsx
+++ b/src/components/bot-panel/Conversations.tsx
@@ -81,7 +81,7 @@ export function BotConversations({ bot }: { bot: Bot }) {
const conversations = orderedThreadList(threads.filter((task) => !isArchived(task) || task.threadId === bot.threadId));
const archived = orderedThreadList(threads.filter((task) => isArchived(task) && task.threadId !== bot.threadId));
const needle = query.trim();
- const collapsed = conversations.filter((task, index) => index < CONVERSATIONS_SHOWN || task.threadId === bot.threadId);
+ const collapsed = conversations.filter((task, index) => index < CONVERSATIONS_SHOWN || task.threadId === bot.threadId || task.threadId === bot.mainThreadId);
const recent = useRecentMessages(bot, [...(needle || expanded ? conversations : collapsed), ...(showArchived ? archived : [])]);
const preview = (threadId: string) => {
const messages = recent(threadId);