Skip to content

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

Bot panel: drop MausBot's Try asking card from Details

luishron123d29c3b693711
diff --git a/src/components/bot-panel/DetailsTab.tsx b/src/components/bot-panel/DetailsTab.tsx
index a3d498b3db..6e36be417f 100644
--- a/src/components/bot-panel/DetailsTab.tsx
+++ b/src/components/bot-panel/DetailsTab.tsx
@@ -9,7 +9,6 @@ import type { SidebarMenuItem } from "../SidebarPopoverMenu";
import type { useBotSettingsDerived } from "../bot-settings/useBotSettingsDerived";
import { BotConversations } from "./Conversations";
import type { SimplePageId } from "./page-registry";
-import { TryAsking } from "./TryAsking";
import { Card, CardLabel, LabelAction, panelActionCls, NavRow, RowIcon, rowCls, RowText } from "./rows";
import { useStoreDispatch, useStoreSelector } from "@/state/store-select";
import { newChatBot } from "@/state/new-chat";
@@ -92,8 +91,6 @@ export function DetailsTab({ bot, derived, onOpen }: {
<BotConversations bot={bot} />
- <TryAsking bot={bot} />
-
{conversationItems.length > 0 && (
<section data-panel-card="conversation">
<CardLabel>{t("botPanel.section.conversation")}</CardLabel>
diff --git a/src/components/bot-panel/TryAsking.test.ts b/src/components/bot-panel/TryAsking.test.ts
deleted file mode 100644
index d78e3141a6..0000000000
--- a/src/components/bot-panel/TryAsking.test.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-// @vitest-environment happy-dom
-// MausBot's example asks live in its panel in Simple mode: a tap sends one.
-import { act, createElement } from "react";
-import { createRoot, type Root } from "react-dom/client";
-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
-import { setLocale } from "@/lib/i18n";
-import type { Bot } from "@/state/store";
-
-const f = vi.hoisted(() => ({ advanced: false, dispatch: vi.fn() }));
-vi.mock("@/lib/interface-mode", () => ({ useAdvancedMode: () => f.advanced }));
-vi.mock("@/state/store", () => ({ useStore: () => ({ state: {}, dispatch: f.dispatch }) }));
-vi.mock("../HelperIntro", () => ({ HELPER_ASK_KEYS: ["helperIntro.ask.overview", "helperIntro.ask.inbox", "helperIntro.ask.routine", "helperIntro.ask.howto"] }));
-const { TryAsking } = await import("./TryAsking");
-
-(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true;
-const bot = (extra: Partial<Bot> = {}) => ({ id: "maus", threadId: "t", name: "MausBot", defaultBot: {}, ...extra }) as Bot;
-let host: HTMLDivElement, root: Root;
-const show = async (target: Bot) => { await act(async () => { root.render(createElement(TryAsking, { bot: target })); }); };
-
-beforeEach(() => {
- setLocale("en");
- f.advanced = false;
- f.dispatch.mockReset();
- host = document.createElement("div");
- document.body.append(host);
- root = createRoot(host);
-});
-afterEach(async () => {
- await act(async () => root.unmount());
- host.remove();
-});
-
-describe("Try asking", () => {
- it("lists MausBot's four asks, and a tap sends one in the open conversation", async () => {
- await show(bot());
- const asks = [...host.querySelectorAll<HTMLButtonElement>("[data-panel-ask]")];
- expect(host.textContent).toContain("Try asking");
- expect(asks.map((ask) => ask.textContent)).toEqual(["What are my bots up to?", "Set up a bot for my inbox", "Make me a morning routine", "How do I connect my email?"]);
- await act(async () => { asks[1]!.click(); });
- expect(f.dispatch).toHaveBeenCalledWith({ type: "send", botId: "maus", text: "Set up a bot for my inbox", threadId: "t" });
- });
-
- it("is MausBot's alone, and Simple mode's", async () => {
- await show(bot({ defaultBot: undefined }));
- expect(host.textContent).toBe("");
- f.advanced = true;
- await show(bot());
- expect(host.textContent).toBe("");
- });
-});
diff --git a/src/components/bot-panel/TryAsking.tsx b/src/components/bot-panel/TryAsking.tsx
deleted file mode 100644
index 3cfe196bc8..0000000000
--- a/src/components/bot-panel/TryAsking.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { t } from "@/lib/i18n";
-import { useAdvancedMode } from "@/lib/interface-mode";
-import { type Bot } from "@/state/store";
-import { HELPER_ASK_KEYS } from "../HelperIntro";
-import { Card } from "./rows";
-import { useStoreDispatch } from "@/state/store-select";
-
-/** MausBot's example asks, in its panel (Simple mode): a tap sends one in the open conversation. */
-export function TryAsking({ bot }: { bot: Bot }) {
- const dispatch = useStoreDispatch();
- const advanced = useAdvancedMode();
- if (advanced || !bot.defaultBot) return null;
- return (
- <Card label={t("botPanel.tryAsking")} anchor="try-asking">
- {HELPER_ASK_KEYS.map((key) => (
- <button key={key} type="button" data-panel-ask={key}
- onClick={() => dispatch({ type: "send", botId: bot.id, text: t(key), threadId: bot.threadId })}
- className="flex h-9 w-full items-center px-3.5 text-left text-[14px] text-ink transition-colors hover:bg-ink/[0.03]">
- <span className="truncate">{t(key)}</span>
- </button>
- ))}
- </Card>
- );
-}
diff --git a/src/locales/en.json b/src/locales/en.json
index 0efb4ccdd6..f7c42c23f0 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -4756,7 +4756,6 @@
"botPanel.folder.ownHint": "Nothing on this computer is touched",
"botPanel.folder.pick": "A folder you choose",
"botPanel.folder.pickHint": "Desktop, a project, Downloads",
- "botPanel.tryAsking": "Try asking",
"computer.simple.dest.letItChoose": "Let it choose",
"botSettings.visibility.title": "Who can see it",
"botSettings.sections.overview": "Overview",
diff --git a/src/locales/it.json b/src/locales/it.json
index 57bf1dd39b..a8f307c800 100644
--- a/src/locales/it.json
+++ b/src/locales/it.json
@@ -4744,7 +4744,6 @@
"botPanel.folder.ownHint": "Su questo computer non viene toccato nulla",
"botPanel.folder.pick": "Una cartella a tua scelta",
"botPanel.folder.pickHint": "Desktop, un progetto, Download",
- "botPanel.tryAsking": "Prova a chiedere",
"computer.simple.dest.letItChoose": "Lascia scegliere",
"botSettings.visibility.title": "Chi può vederlo",
"botSettings.sections.overview": "Panoramica",
diff --git a/src/locales/ja.json b/src/locales/ja.json
index 75da991a2e..38eb930d5b 100644
--- a/src/locales/ja.json
+++ b/src/locales/ja.json
@@ -4041,7 +4041,6 @@
"botPanel.folder.ownHint": "このコンピューターのファイルには一切触れません",
"botPanel.folder.pick": "選択したフォルダー",
"botPanel.folder.pickHint": "デスクトップ、プロジェクト、ダウンロードなど",
- "botPanel.tryAsking": "こんなふうに頼んでみましょう",
"computer.simple.dest.letItChoose": "お任せ",
"botSettings.visibility.title": "見られる人",
"botSettings.sections.overview": "概要",
diff --git a/src/locales/ko.json b/src/locales/ko.json
index 89d41ec73a..081da17f6c 100644
--- a/src/locales/ko.json
+++ b/src/locales/ko.json
@@ -3854,7 +3854,6 @@
"botPanel.folder.ownHint": "이 컴퓨터의 다른 것은 건드리지 않아요",
"botPanel.folder.pick": "직접 고른 폴더",
"botPanel.folder.pickHint": "바탕화면, 프로젝트, 다운로드",
- "botPanel.tryAsking": "이렇게 물어보세요",
"computer.simple.dest.letItChoose": "알아서 고르게 하기",
"botSettings.visibility.title": "볼 수 있는 사람",
"botSettings.sections.overview": "개요",
diff --git a/src/locales/pt-br.json b/src/locales/pt-br.json
index 213b6cf5a9..307f009a9c 100644
--- a/src/locales/pt-br.json
+++ b/src/locales/pt-br.json
@@ -8263,7 +8263,6 @@
"botPanel.folder.ownHint": "Não altera nada neste computador",
"botPanel.folder.pick": "Uma pasta que você escolher",
"botPanel.folder.pickHint": "Mesa/Área de Trabalho, um projeto, Downloads",
- "botPanel.tryAsking": "Experimente perguntar",
"computer.simple.dest.letItChoose": "Deixar o bot escolher",
"model.fallback.add": "Adicionar uma IA reserva",
"model.fallback.none": "Nenhuma outra IA disponível",
diff --git a/src/locales/zh-tw.json b/src/locales/zh-tw.json
index c7cfed257d..c0a303cf02 100644
--- a/src/locales/zh-tw.json
+++ b/src/locales/zh-tw.json
@@ -4176,7 +4176,6 @@
"botPanel.folder.ownHint": "不會動到這台電腦上的任何內容",
"botPanel.folder.pick": "你選擇的資料夾",
"botPanel.folder.pickHint": "桌面、專案、下載",
- "botPanel.tryAsking": "試著問問",
"computer.simple.dest.letItChoose": "讓它選擇",
"botSettings.visibility.title": "誰可以看到",
"botSettings.sections.overview": "概覽",
diff --git a/src/locales/zh.json b/src/locales/zh.json
index da170c4869..a109ede85b 100644
--- a/src/locales/zh.json
+++ b/src/locales/zh.json
@@ -4236,7 +4236,6 @@
"botPanel.folder.ownHint": "不会碰到这台电脑上的任何内容",
"botPanel.folder.pick": "由你选择的文件夹",
"botPanel.folder.pickHint": "桌面、某个项目、下载",
- "botPanel.tryAsking": "试着这样问",
"computer.simple.dest.letItChoose": "让它自己选",
"botSettings.visibility.title": "谁可以查看",
"botSettings.sections.overview": "概览",