Skip to content

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

Simple mode: fold the everyday Advanced-only settings into Simple (#4999)

Milind Sonie1597258089a
diff --git a/src/components/AppSettingsRows.tsx b/src/components/AppSettingsRows.tsx
index b837ff968d..3a6f3a928c 100644
--- a/src/components/AppSettingsRows.tsx
+++ b/src/components/AppSettingsRows.tsx
@@ -81,7 +81,7 @@ export function UpdatesRow({ title = t("settings.updates.title") }: { title?: st
);
}
-export function NewBotEffortRow() {
+function useNewBotEffort() {
const { state, dispatch } = useStore();
const current = state.config?.newBots?.effort ?? "";
const [saving, setSaving] = useState(false);
@@ -103,26 +103,52 @@ export function NewBotEffortRow() {
setSaving(false);
}
};
+ return { current, saving, error, save };
+}
+
+function NewBotEffortSelect({ effort, className }: { effort: ReturnType<typeof useNewBotEffort>; className: string }) {
+ return (
+ <Select size="sm" className={className}
+ value={effort.current}
+ disabled={effort.saving}
+ aria-label={t("settings.newBotEffort.aria")}
+ onChange={(event) => void effort.save(event.target.value)}
+ >
+ <option value="">{t("settings.newBotEffort.default")}</option>
+ {EFFORT_LEVELS.map((level) => (
+ <option key={level} value={level}>
+ {effortLabel(level)}
+ </option>
+ ))}
+ </Select>
+ );
+}
+export function NewBotEffortRow() {
+ const effort = useNewBotEffort();
return (
<SettingRow
title={t("settings.newBotEffort.title")}
subtitle={t("settings.newBotEffort.subtitle")}
- message={error ? <p role="alert" className="text-danger">{error}</p> : null}
+ message={effort.error ? <p role="alert" className="text-danger">{effort.error}</p> : null}
>
- <Select size="sm" className="w-full max-w-[240px]"
- value={current}
- disabled={saving}
- aria-label={t("settings.newBotEffort.aria")}
- onChange={(event) => void save(event.target.value)}
- >
- <option value="">{t("settings.newBotEffort.default")}</option>
- {EFFORT_LEVELS.map((level) => (
- <option key={level} value={level}>
- {effortLabel(level)}
- </option>
- ))}
- </Select>
+ <NewBotEffortSelect effort={effort} className="w-full max-w-[240px]" />
+ </SettingRow>
+ );
+}
+
+export function NewBotDefaultsRow({ onEdit }: { onEdit: () => void }) {
+ const effort = useNewBotEffort();
+ return (
+ <SettingRow
+ title={t("newBot.defaults")}
+ subtitle={t("settings.newBotEffort.title")}
+ message={effort.error ? <p role="alert" className="text-danger">{effort.error}</p> : null}
+ >
+ <div className="flex items-center gap-2">
+ <NewBotEffortSelect effort={effort} className="w-auto" />
+ <button type="button" className="ui-button" data-new-bot-defaults onClick={onEdit}>{t("newBot.edit")}</button>
+ </div>
</SettingRow>
);
}
diff --git a/src/components/BotContextMenu.position.test.ts b/src/components/BotContextMenu.position.test.ts
index 27aa889508..2238e4f93c 100644
--- a/src/components/BotContextMenu.position.test.ts
+++ b/src/components/BotContextMenu.position.test.ts
@@ -111,6 +111,13 @@ describe("bot actions menu viewport placement", () => {
expect(negative.style).toEqual({ top: "8px", left: "8px" });
});
+ it("lets Simple pin or unpin a bot first, and offers no folders", () => {
+ const html = render();
+ expect(html.indexOf(t("sidebar.bot.pin"))).toBeGreaterThan(-1);
+ expect(html.indexOf(t("sidebar.bot.pin"))).toBeLessThan(html.indexOf(t("sidebar.copyConversationId")));
+ for (const key of ["folder.new", "task.folder.new"] as const) expect(html, key).not.toContain(`>${t(key)}<`);
+ });
+
it("keeps Advanced's flat list of bot actions, drawn on the shared menu sheet", () => {
fixture.advanced = true;
const html = render();
diff --git a/src/components/BotSettingsDialog.simple.test.ts b/src/components/BotSettingsDialog.simple.test.ts
index 02d9a236dc..8e1749a8f7 100644
--- a/src/components/BotSettingsDialog.simple.test.ts
+++ b/src/components/BotSettingsDialog.simple.test.ts
@@ -44,6 +44,7 @@ const fixture = vi.hoisted(() => {
apps: { phase: "ready", apps: [], connectedSlugs: [] } as BotApps,
places: {} as Record<string, [boolean, boolean, string]>,
mcp: { servers: null as McpServerSummary[] | null, error: false },
+ slackUrl: null as string | null,
};
});
vi.mock("react", async (original) => ({
@@ -76,7 +77,7 @@ vi.mock("@/lib/memory", async (importOriginal) => ({
}));
// The server renderer cannot portal; the dialog's props are what these tests read.
vi.mock("./ConfirmDialog", () => ({ ConfirmDialog: () => null }));
-vi.mock("./bot-settings/useSlackManagement", () => ({ useSlackManagementUrl: () => null }));
+vi.mock("./bot-settings/useSlackManagement", () => ({ useSlackManagementUrl: () => fixture.slackUrl }));
vi.mock("./bot-settings/useBotSettingsDerived", () => ({ useBotSettingsDerived: () => fixture.derived }));
vi.mock("./DesktopCapabilities", async (importOriginal) => ({
...(await importOriginal<typeof import("./DesktopCapabilities")>()),
@@ -246,6 +247,7 @@ beforeEach(() => {
fixture.advanced = false;
fixture.setAdvanced = vi.fn();
fixture.ownerOrAdmin = false;
+ fixture.slackUrl = null;
fresh();
fixture.index = 0;
fixture.dispatch = vi.fn();
@@ -411,7 +413,7 @@ describe("the bot panel in Simple mode", () => {
expect(shown(panel(makeBot(), "access"))).toEqual({ tab: "computer", page: undefined });
});
- it("shows no switch on any tab, and on Bot settings only Bot API's: memory, upkeep, browser, record steps and Work until done live elsewhere", () => {
+ it("shows no switch on any tab, and on Bot settings only Notifications and Bot API's: memory, upkeep, browser, record steps and Work until done live elsewhere", () => {
const bot = makeBot();
expect(switches(panel(bot).html)).toBe(0);
expect(panel(bot).html).not.toContain('aria-label="Work until done"');
@@ -423,7 +425,8 @@ describe("the bot panel in Simple mode", () => {
}
click(find(panel(bot), "data-panel-gear"));
const settings = panel(bot).html;
- expect(switches(settings)).toBe(1);
+ expect(switches(settings)).toBe(2);
+ expect(settings).toContain('aria-label="Notifications"');
expect(settings).toContain('aria-label="Let apps talk to this bot"');
});
});
@@ -650,13 +653,15 @@ describe("the Details tab", () => {
expect(rowValue(botTab(makeBot()), "routines")).toBe("None");
});
- it("lists Find and Activity for this conversation as rows that run them, leaving Copy and Download to Share", () => {
+ it("lists Find, Activity and the Inspector for this conversation as rows that run them, leaving Copy and Download to Share", () => {
const rendered = botTab(makeBot());
- expect([...rendered.html.matchAll(/data-panel-item="(\w+)"/g)].map((match) => match[1])).toEqual(["find", "activity"]);
+ expect([...rendered.html.matchAll(/data-panel-item="(\w+)"/g)].map((match) => match[1])).toEqual(["find", "activity", "inspector"]);
expect(rendered.html).toContain(">Find in conversation<");
const run = (key: string) => (rendered.nodes.find((node) => (node.props.item as { key?: string } | undefined)?.key === key)!.props.item as { onSelect: () => void }).onSelect();
run("activity");
expect(fixture.dispatch).toHaveBeenLastCalledWith({ type: "toggleActivity" });
+ run("inspector");
+ expect(fixture.dispatch).toHaveBeenLastCalledWith({ type: "toggleInspector" });
});
});
@@ -670,15 +675,82 @@ describe("the Bot settings page", () => {
expect(patch).toHaveBeenCalledExactlyOnceWith({ soul: description, description: first });
});
- it("holds Instructions, Before it acts, Backup AIs, Call mode, Apps, Job and Hide, with every title on one edge", () => {
+ it("holds Instructions, Before it acts, Backup AIs, Call mode, Reply style, Notifications, Apps, Job and Hide, with every title on one edge", () => {
const rendered = settingsPage(makeBot({ defaultBot: {} }));
- const order = ['data-panel-edit="soul"', 'data-panel-row="approval"', 'data-panel-row="backups"', 'data-panel-row="call-mode"', 'data-panel-page="apps"', 'data-panel-row="job"', 'data-panel-row="default-bot-hide"']
+ const order = ['data-panel-edit="soul"', 'data-panel-row="approval"', 'data-panel-row="backups"', 'data-panel-row="call-mode"', 'data-panel-row="reply-style"',
+ 'data-panel-row="notifications"', 'data-panel-page="apps"', 'data-panel-row="job"', 'data-panel-row="default-bot-hide"']
.map((marker) => rendered.html.indexOf(marker));
expect(order.every((index) => index > -1)).toBe(true);
expect([...order].sort((a, b) => a - b)).toEqual(order);
- expect(switches(rendered.html)).toBe(1);
+ expect(switches(rendered.html)).toBe(2);
expect(rendered.html).toContain('aria-label="Let apps talk to this bot"');
- expect(rendered.html.match(/pl-\[38px\]/g)).toHaveLength(4);
+ expect(rendered.html.match(/pl-\[38px\]/g)).toHaveLength(5);
+ for (const gone of ['data-panel-row="always-allow"', 'data-panel-row="slack"', 'data-panel-page="visibility"']) expect(rendered.html, gone).not.toContain(gone);
+ });
+
+ it("lists what the bot may do without asking under Before it acts, each with a button that takes it off", () => {
+ const rendered = settingsPage(makeBot({ alwaysAllow: ["Bash(git status)", "mcp__linear__list_issues"] }));
+ const html = rendered.html;
+ expect(html.indexOf('data-panel-row="always-allow"')).toBeGreaterThan(html.indexOf('data-panel-row="approval"'));
+ expect(html.indexOf('data-panel-row="always-allow"')).toBeLessThan(html.indexOf('data-panel-row="backups"'));
+ expect(html).toContain(">Always allowed<");
+ expect(html).toContain(">Bash(git status)<");
+ click(find(rendered, "data-panel-action", "always-allow:Bash(git status)"));
+ expect(patch).toHaveBeenLastCalledWith({ alwaysAllow: ["mcp__linear__list_issues"] });
+ });
+
+ it("chooses the reply style from two pills, the hint in each one's tooltip", () => {
+ const style = segment(settingsPage(makeBot()), "data-reply-style");
+ expect(style.options.map((option) => [option.value, option.label])).toEqual([["default", "Default"], ["conversational", "Conversational"]]);
+ expect(style.value).toBe("default");
+ style.onChange("conversational");
+ expect(patch).toHaveBeenLastCalledWith({ replyStyle: "conversational" });
+ expect(segment(settingsPage(makeBot({ replyStyle: "conversational" })), "data-reply-style").value).toBe("conversational");
+ });
+
+ it("turns this bot's notifications off and on, asking the system for permission only when turning them on", async () => {
+ const notify = await import("@/lib/notify");
+ const permission = vi.spyOn(notify, "requestNotificationPermission").mockResolvedValue("granted");
+ try {
+ const row = (bot: Bot) => find(settingsPage(bot), "data-panel-row", "notifications");
+ expect(row(makeBot()).props.checked).toBe(true);
+ (row(makeBot()).props.onChange as () => void)();
+ expect(patch).toHaveBeenLastCalledWith({ notifications: false });
+ expect(permission).not.toHaveBeenCalled();
+ (row(makeBot({ notifications: false })).props.onChange as () => void)();
+ expect(patch).toHaveBeenLastCalledWith({ notifications: true });
+ expect(permission).toHaveBeenCalledOnce();
+ } finally {
+ permission.mockRestore();
+ }
+ });
+
+ it("opens Who can see it for an owner or admin of a self-hosted web workspace, once its config is in, and for nobody on a team", () => {
+ fixture.ownerOrAdmin = true;
+ const visibilityPage = () => renderToStaticMarkup(createElement(PageBody, { page: "visibility", bot: makeBot(), derived: derived() }));
+ expect(has(settingsPage(makeBot()), "data-panel-page", "visibility")).toBe(false);
+ expect(visibilityPage()).toBe("");
+ fixture.storeState = { ...fixture.storeState, config: {} };
+ const rendered = settingsPage(makeBot({ visibility: "admins" }));
+ expect(rowValue(rendered, "visibility")).toBe("Admins only");
+ click(find(rendered, "data-panel-page", "visibility"));
+ expect(onOpen).toHaveBeenLastCalledWith("visibility");
+ expect(rowValue(settingsPage(makeBot()), "visibility")).toBe("Everyone who can sign in");
+ expect(visibilityPage()).toContain("data-bot-visibility");
+ fixture.storeState = { ...fixture.storeState, config: { team: { name: "Acme" } } };
+ expect(has(settingsPage(makeBot()), "data-panel-page", "visibility")).toBe(false);
+ expect(visibilityPage()).toBe("");
+ fixture.storeState = { ...fixture.storeState, config: {} };
+ fixture.ownerOrAdmin = false;
+ expect(has(settingsPage(makeBot()), "data-panel-page", "visibility")).toBe(false);
+ });
+
+ it("links to the bot's own Slack app once it has one", () => {
+ fixture.slackUrl = "https://admin.example.test/bots/scout/slack";
+ const html = settingsPage(makeBot()).html;
+ expect(html).toMatch(/data-panel-row="slack" href="https:\/\/admin\.example\.test\/bots\/scout\/slack" target="_blank" rel="noopener noreferrer"/);
+ expect(html).toContain(">Slack<");
+ expect(html.indexOf('data-panel-row="slack"')).toBeGreaterThan(html.indexOf('data-panel-row="job"'));
});
it("shows the first line of the instructions, or how to start, and edits them in place with Done", () => {
diff --git a/src/components/CloudKeepHere.test.ts b/src/components/CloudKeepHere.test.ts
index 399c55c01c..426581d29c 100644
--- a/src/components/CloudKeepHere.test.ts
+++ b/src/components/CloudKeepHere.test.ts
@@ -38,12 +38,11 @@ beforeEach(() => {
});
afterEach(() => { vi.unstubAllGlobals(); });
-it("is never shown in Simple mode, even to someone with a Cloud, and main is not even asked", async () => {
+it("is shown in Simple mode too, to someone with a Cloud", async () => {
f.advanced = false;
- vi.mocked(bridge.keepHere!).mockResolvedValue(before);
- render(); for (const effect of f.effects) effect(); await flush();
- expect(render().html).toBe("");
- expect(bridge.keepHere).not.toHaveBeenCalled();
+ await ready(before);
+ expect(bridge.keepHere).toHaveBeenCalledOnce();
+ expect(toggle()?.props.checked).toBe(false);
});
it("is never shown without a Cloud of one's own the move applies to, nor by a desktop that has no such switch, nor off the desktop", async () => {
diff --git a/src/components/CloudKeepHere.tsx b/src/components/CloudKeepHere.tsx
index ff29364cfd..851e278a04 100644
--- a/src/components/CloudKeepHere.tsx
+++ b/src/components/CloudKeepHere.tsx
@@ -2,18 +2,11 @@ import { useEffect, useState } from "react";
import type { CloudSendPageBridge, KeepHereState } from "../../electron/cloud-send.mjs";
import { ipcErrorText } from "@/lib/cloud-send";
import { t } from "@/lib/i18n";
-import { useAdvancedMode } from "@/lib/interface-mode";
import { Switch } from "./SettingsPrimitives";
-/**
- * Settings → MausBot Cloud, in Advanced mode only, for someone with a Cloud of their own the move applies to: "Keep this
- * computer's bots on this computer". Turned on once this computer's bots live on My Cloud, it asks first, since they come
- * back here; while they are on their way it can't be turned back.
- */
export function CloudKeepHere({ bridge }: { bridge: CloudSendPageBridge | undefined }) {
- const advanced = useAdvancedMode();
const read = bridge?.keepHere, write = bridge?.setKeepHere;
- return advanced && bridge && read && write ? <KeepHereSwitch bridge={bridge} read={read} write={write} /> : null;
+ return bridge && read && write ? <KeepHereSwitch bridge={bridge} read={read} write={write} /> : null;
}
function KeepHereSwitch({ bridge, read, write }: { bridge: CloudSendPageBridge; read: () => Promise<KeepHereState>; write: (on: boolean) => Promise<KeepHereState> }) {
diff --git a/src/components/ComputerPanel.simple.test.ts b/src/components/ComputerPanel.simple.test.ts
index d1cf7cdaa3..480c3e8aba 100644
--- a/src/components/ComputerPanel.simple.test.ts
+++ b/src/components/ComputerPanel.simple.test.ts
@@ -106,6 +106,7 @@ const { WorksOnGrid } = await import("./WorksOnGrid");
const { FullScreenButton } = await import("./FullScreenButton");
const { ComputerFilesPane } = await import("./ComputerFilesPane");
const { CloudBackendPicker } = await import("./CloudBackendPicker");
+const { SimpleVpsChoices } = await import("./SimpleVpsChoices");
const { LocalComputerAutoWarning } = await import("./LocalComputerAutoWarning");
const { KeyRow } = await import("./keys/KeyRow");
@@ -220,9 +221,10 @@ describe("Computer panel tabs", () => {
}
});
- it("shows Screen, Browser, Data and Files in Simple mode", () => {
- fixture.android = true;
+ it("shows Screen, Browser, Data and Files in Simple mode, and Android after Screen while a phone is connected", () => {
expect(tabs(render(makeBot()))).toEqual(["Screen", "Browser", "Data", "Files"]);
+ fixture.android = true;
+ expect(tabs(render(makeBot()))).toEqual(["Screen", "Android", "Browser", "Data", "Files"]);
});
it("keeps the Advanced tabs unchanged", () => {
@@ -651,14 +653,18 @@ describe("Technical controls", () => {
expect(advanced.buttons.some((node) => node.props.title === "Delete Scout's VM" || /Delete/.test(text(node.props.children)))).toBe(true);
});
- it("turns VPS setup into one friendly line and an Advanced switch", () => {
+ it("turns VPS setup into one friendly line, its start button and the cloud computer choice", () => {
fixture.seed = { phase: "vps-stopped", resolved: { botId: "scout", threadId: "thread-scout", computer: "cloud", cloudBackend: "vps" } };
const vps = () => makeBot({ computer: "cloud", cloudBackend: "vps" });
const simple = render(vps());
expect(simple.html).toContain("Scout&#x27;s desktop needs a setup step first.");
- expect(simple.buttons.some((node) => /VPS/.test(text(node.props.children)))).toBe(false);
- (simple.button("Show advanced controls")!.props.onClick as () => void)();
- expect(fixture.setAdvancedMode).toHaveBeenCalledWith(true);
+ expect(simple.button("Start the desktop on your VPS")).toBeDefined();
+ expect(simple.button("Show advanced controls")).toBeUndefined();
+ expect(simple.button("Open VPS settings")).toBeUndefined();
+ const choices = simple.nodes.find((node) => node.type === SimpleVpsChoices)!;
+ expect(simple.html).not.toContain("Start VPS automatically");
+ (choices.props.onBackend as (backend: string) => void)("box");
+ expect(fixture.dispatch).toHaveBeenLastCalledWith({ type: "updateBot", botId: "scout", patch: { cloudBackend: "box" } });
fixture.advanced = true;
fixture.values = [];
@@ -666,5 +672,17 @@ describe("Technical controls", () => {
const advanced = render(vps());
expect(advanced.buttons.some((node) => /VPS/.test(text(node.props.children)))).toBe(true);
expect(advanced.button("Show advanced controls")).toBeUndefined();
+ expect(advanced.nodes.some((node) => node.type === SimpleVpsChoices)).toBe(false);
+ });
+
+ it("offers a bot that picks its own place auto-start beside a stopped VPS, and Advanced's switch where Simple has no fix", () => {
+ fixture.seed = { phase: "vps-unconfigured", resolved: { botId: "scout", threadId: "thread-scout", computer: undefined, cloudBackend: "vps" } };
+ const simple = render(makeBot({ cloudBackend: "vps" }));
+ expect(simple.html).toContain("Start VPS automatically");
+ expect(simple.button("Start the desktop on your VPS")).toBeUndefined();
+ (simple.nodes.find((node) => node.type === SimpleVpsChoices)!.props.onAutoStart as () => void)();
+ expect(fixture.dispatch).toHaveBeenLastCalledWith({ type: "updateBot", botId: "scout", patch: { autoStartVps: true } });
+ (simple.button("Show advanced controls")!.props.onClick as () => void)();
+ expect(fixture.setAdvancedMode).toHaveBeenCalledWith(true);
});
});
diff --git a/src/components/ComputerPanel.tsx b/src/components/ComputerPanel.tsx
index 9a56e0f705..8252d92d64 100644
--- a/src/components/ComputerPanel.tsx
+++ b/src/components/ComputerPanel.tsx
@@ -19,6 +19,7 @@ import { listenLiveFrames } from "@/lib/live-events";
import { CloudScreenPreview } from "./CloudScreenPreview";
import { isActiveTurnRefusal, isRemoteScreenshotContention } from "@/lib/remote-desktop";
import { CloudBackendPicker } from "./CloudBackendPicker";
+import { SimpleVpsChoices } from "./SimpleVpsChoices";
import { placeManagedBy, worksOnChoices, WorksOnGrid, worksOnSelected } from "./WorksOnGrid";
import { useDesktopCapabilities } from "./DesktopCapabilities";
import { RoutinesSection } from "./bot-settings/RoutinesSection";
@@ -1042,6 +1043,9 @@ export function ComputerPanel({
};
const openConnectionSettings = () => dispatch(openKeySettings("vps"));
+ const vpsPhase = computerStatusCurrent && (phase === "vps-unconfigured" || phase === "vps-stopped" || phase === "vps-incompatible");
+ const canProvisionVps = computerStatusCurrent && canManageCloud && (phase === "vps-stopped" || (phase === "vps-unconfigured" && Boolean(vpsStatus?.configured)));
+ const canReplaceVps = computerStatusCurrent && canManageCloud && phase === "vps-incompatible" && Boolean(vpsStatus?.managed);
const browserCanTurnOn = browserAvailableHere || state.config?.browserEngine?.installable === true;
const [browserTurningOn, setBrowserTurningOn] = useState(false);
@@ -1460,16 +1464,16 @@ export function ComputerPanel({
</button>
)
)}
- {!advanced && computerStatusCurrent && (phase === "vps-unconfigured" || phase === "vps-stopped" || phase === "vps-incompatible") && (
+ {!advanced && vpsPhase && (
<>
<p className="text-[12px]">{t("computer.simple.needsSetup", { name: bot.name })}</p>
- <button
+ {!canProvisionVps && !canReplaceVps && <button
type="button"
onClick={() => setAdvancedMode(true)}
className="mt-1 rounded-lg bg-control px-3 py-1.5 text-[12px] text-ink hover:bg-raised-hover"
>
{t("computer.simple.showAdvanced")}
- </button>
+ </button>}
</>
)}
{advanced && computerStatusCurrent && (phase === "vps-unconfigured" || phase === "vps-stopped") && (
@@ -1480,8 +1484,7 @@ export function ComputerPanel({
{t("computer.openVpsSettings")}
</button>
)}
- {advanced && computerStatusCurrent && (phase === "vps-stopped" || (phase === "vps-unconfigured" && vpsStatus?.configured)) &&
- canManageCloud && (
+ {canProvisionVps && (
<button
onClick={() => run("provision")}
disabled={pending === "provision"}
@@ -1491,8 +1494,7 @@ export function ComputerPanel({
{phase === "vps-stopped" ? t("computer.startVps") : t("computer.prepareVps")}
</button>
)}
- {advanced && computerStatusCurrent && phase === "vps-incompatible" && vpsStatus?.managed &&
- canManageCloud && (
+ {canReplaceVps && (
<button
onClick={() => void replaceVpsComputer()}
disabled={pending === "vps-replace"}
@@ -1749,6 +1751,8 @@ export function ComputerPanel({
</button>
</div>
)}
+ {vpsPhase && <SimpleVpsChoices bot={bot} backend={cloudBackend} onBackend={(backend) => updateComputerSelection({ cloudBackend: backend })}
+ onAutoStart={() => dispatch({ type: "updateBot", botId: bot.id, patch: { autoStartVps: !bot.autoStartVps } })} />}
</div>
)}
</div>
diff --git a/src/components/NewBotDialog.tsx b/src/components/NewBotDialog.tsx
index 1f2e2c94a0..c08b764e9c 100644
--- a/src/components/NewBotDialog.tsx
+++ b/src/components/NewBotDialog.tsx
@@ -31,6 +31,7 @@ import { RoutineEditor } from "./RoutinesPage";
import { LocalComputerAutoWarning } from "./LocalComputerAutoWarning";
import { SharePresetDialog } from "./SharePresetDialog";
import { SettingRow } from "./SettingsPrimitives";
+import { NewBotDefaultsRow } from "./AppSettingsRows";
import { Select } from "./Select";
const SECTIONS = ["Identity", "Soul", "Skills", "Memory", "Routines", "Access", "Model", "Permissions", "Voice & alerts"] as const;
@@ -352,21 +353,22 @@ function DraftRoutines({ draft }: { draft: BotCreationDraft }) {
</div>;
}
-export function DefaultBotSettings() {
+export function DefaultBotSettings({ simple = false }: { simple?: boolean }) {
const [open, setOpen] = useState(false);
const [sharing, setSharing] = useState(false);
+ const dialogs = <>
+ {open && <NewBotDialog defaultsMode onClose={() => setOpen(false)} />}
+ {sharing && <SharePresetDialog onClose={() => setSharing(false)} />}
+ </>;
+ if (simple) return <><NewBotDefaultsRow onEdit={() => setOpen(true)} />{dialogs}</>;
- const content = <>
- <div className="flex shrink-0 gap-2">
- <button type="button" onClick={() => setSharing(true)} className="cursor-pointer rounded-lg px-3 py-1.5 text-[13px] text-ink-secondary hover:bg-control hover:text-ink">{t("newBot.sharePreset")}</button>
- <button type="button" onClick={() => setOpen(true)} className="cursor-pointer rounded-lg bg-control px-3 py-1.5 text-[13px] text-ink hover:bg-raised-hover">{t("newBot.edit")}</button>
- </div>
- {open && <NewBotDialog defaultsMode onClose={() => setOpen(false)} />}
- {sharing && <SharePresetDialog onClose={() => setSharing(false)} />}
- </>
-
- return <>
- <SettingRow title={t("newBot.defaults")} children={content} />
-
+ const content = <>
+ <div className="flex shrink-0 gap-2">
+ <button type="button" onClick={() => setSharing(true)} className="cursor-pointer rounded-lg px-3 py-1.5 text-[13px] text-ink-secondary hover:bg-control hover:text-ink">{t("newBot.sharePreset")}</button>
+ <button type="button" onClick={() => setOpen(true)} className="cursor-pointer rounded-lg bg-control px-3 py-1.5 text-[13px] text-ink hover:bg-raised-hover">{t("newBot.edit")}</button>
+ </div>
+ {dialogs}
</>;
+
+ return <SettingRow title={t("newBot.defaults")} children={content} />;
}
diff --git a/src/components/SettingsModal.search.test.ts b/src/components/SettingsModal.search.test.ts
index 4227b0ca42..1a4b79c601 100644
--- a/src/components/SettingsModal.search.test.ts
+++ b/src/components/SettingsModal.search.test.ts
@@ -5,13 +5,13 @@ import { createRoot, type Root } from "react-dom/client";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { setLocale } from "@/lib/i18n";
-const fixture = vi.hoisted(() => ({ dispatch: vi.fn(), scrolled: [] as Element[] }));
+const fixture = vi.hoisted(() => ({ dispatch: vi.fn(), scrolled: [] as Element[], section: "general" }));
vi.mock("@/lib/scroll-within", () => ({ scrollWithin: (_scroller: unknown, target: Element) => { fixture.scrolled.push(target); }, scrollParent: () => null }));
vi.mock("@/state/store", async (importOriginal) => ({
...await importOriginal<typeof import("@/state/store")>(),
api: vi.fn(async () => ({})),
useStore: () => ({
- state: { appSettingsSection: "general", instances: [], bots: [], config: { features: {}, composio: { mode: "self" } }, appSettingsCloudLink: 0, appSettingsPhonePairing: 0 },
+ state: { appSettingsSection: fixture.section, instances: [], bots: [], config: { features: {}, composio: { mode: "self" }, rooms: { turnTimeoutMinutes: 5 } }, appSettingsCloudLink: 0, appSettingsPhonePairing: 0 },
dispatch: fixture.dispatch,
refreshInstances: vi.fn(),
}),
@@ -28,6 +28,7 @@ for (const [path, name] of [
["./CustomDomainSettings", "CustomDomainSettings"], ["./LoginsSettings", "LoginsSettings"], ["./PlanUsage", "PlanUsageSummary"],
] as const) vi.doMock(path, async (importOriginal) => ({ ...await importOriginal<Record<string, unknown>>(), [name]: () => null }));
+const { SettingsModal } = await import("./SettingsModal");
let host: HTMLDivElement;
let root: Root;
const scrolled = fixture.scrolled;
@@ -38,13 +39,13 @@ beforeAll(() => {
beforeEach(async () => {
vi.clearAllMocks();
+ fixture.section = "general";
setLocale("en");
scrolled.length = 0;
vi.stubGlobal("fetch", vi.fn(async () => new Response("{}", { status: 404 })));
host = document.createElement("div");
document.body.append(host);
root = createRoot(host);
- const { SettingsModal } = await import("./SettingsModal");
flushSync(() => root.render(createElement(SettingsModal)));
});
@@ -78,4 +79,54 @@ describe("Settings search in Simple mode", () => {
expect(scrolled.map((element) => element.getAttribute("data-settings-block"))).toContain("advanced-mode");
expect(search().value).toBe("");
});
+
+ it("opens More settings from the bottom of General: the hidden pages, then Limits, and Back returns to its row", () => {
+ const heading = () => host.querySelector("h2")!.textContent;
+ flushSync(() => host.querySelector<HTMLButtonElement>("[data-settings-more]")!.click());
+ expect(heading()).toBe("More settings");
+ expect([...host.querySelectorAll("[data-settings-more-section]")].map((row) => row.getAttribute("data-settings-more-section")))
+ .toEqual(["decisionModel", "imageGeneration", "backups", "experimental"]);
+ const limits = host.querySelector('[data-settings-block="limits"]')!;
+ expect(limits.querySelector("h3")!.textContent).toBe("Limits");
+ for (const title of ["Group turns", "Tool time limit", "Parallel threads", "Event log cleanup"]) expect(limits.textContent, title).toContain(title);
+ flushSync(() => host.querySelector<HTMLButtonElement>('[data-settings-more-section="backups"]')!.click());
+ expect(fixture.dispatch).toHaveBeenLastCalledWith({ type: "toggleAppSettings", open: true, section: "backups" });
+ expect(heading()).toBe("General");
+ flushSync(() => host.querySelector<HTMLButtonElement>("[data-settings-more]")!.click());
+ flushSync(() => [...host.querySelectorAll<HTMLButtonElement>("button")].find((button) => button.textContent === "Back")!.click());
+ expect(heading()).toBe("General");
+ expect(scrolled.map((element) => element.getAttribute("data-settings-block"))).toContain("more");
+ });
+
+ it("leaves More settings when a link opens another setting, even one back on General", () => {
+ flushSync(() => host.querySelector<HTMLButtonElement>("[data-settings-more]")!.click());
+ expect(host.querySelector('[data-settings-block="limits"]')).not.toBeNull();
+ const follow = (section: string) => {
+ fixture.section = section;
+ flushSync(() => root.render(createElement(SettingsModal)));
+ };
+ follow("appearance");
+ expect(host.querySelector("h2")!.textContent).toBe("General");
+ expect(host.querySelector('[data-settings-block="limits"]')).toBeNull();
+ follow("general");
+ expect(host.querySelector('[data-settings-block="limits"]')).toBeNull();
+ expect(host.querySelector("[data-settings-more]")).not.toBeNull();
+ });
+
+ it("finds a hidden page and a limit as More settings, and opens each where it lives", () => {
+ type("backups");
+ const page = host.querySelector<HTMLButtonElement>('[data-settings-more-result="backups"]')!;
+ expect(page.textContent).toBe("Backups · More settings");
+ flushSync(() => page.click());
+ expect(fixture.dispatch).toHaveBeenLastCalledWith({ type: "toggleAppSettings", open: true, section: "backups" });
+ expect(search().value).toBe("");
+
+ type("parallel");
+ const limit = host.querySelector<HTMLButtonElement>('[data-settings-more-result="settings.threads.title"]')!;
+ expect(limit.textContent).toBe("Parallel threads · More settings");
+ expect(host.querySelector('[data-settings-advanced-only="settings.threads.title"]')).toBeNull();
+ flushSync(() => limit.click());
+ expect(host.querySelector("h2")!.textContent).toBe("More settings");
+ expect(scrolled.map((element) => element.getAttribute("data-settings-block"))).toContain("limits");
+ });
});
diff --git a/src/components/SettingsModal.simple.test.ts b/src/components/SettingsModal.simple.test.ts
index 4846597279..4ac4c1a13b 100644
--- a/src/components/SettingsModal.simple.test.ts
+++ b/src/components/SettingsModal.simple.test.ts
@@ -5,7 +5,7 @@ import { setLocale, t } from "@/lib/i18n";
import type { AppSettingsSection } from "@/state/store";
import type { Switch } from "./SettingsPrimitives";
import { SECTIONS, SIMPLE_FOLDED, SIMPLE_HIDDEN_SECTIONS, SIMPLE_PAGES, SettingsModal, revealSettingsBlock } from "./SettingsModal";
-import { SIMPLE_ADVANCED_ONLY, SimpleLooksPage } from "./SettingsSimplePages";
+import { SIMPLE_ADVANCED_ONLY, SIMPLE_MORE_LIMITS, SimpleLooksPage } from "./SettingsSimplePages";
const fixture = vi.hoisted(() => ({
section: "general" as AppSettingsSection,
@@ -163,11 +163,12 @@ describe("Settings in Simple mode", () => {
for (const id of hidden) expect(SIMPLE_HIDDEN_SECTIONS).toContain(id);
});
- it("opens General on Account, then Appearance, Language and typing, Notifications, System and Import, with Advanced mode last as a plain row", () => {
+ it("opens General on Account, then Appearance, Language and typing, Notifications, System and Import, with More settings and Advanced mode last as plain rows", () => {
const html = render();
expect(currentPage(html)).toBe("general");
expect(groupLabels(html)).toEqual(["Account", "Appearance", "Language and typing", "Notifications", "System", "Import", "Organization"]);
- expect(blocks(html).at(-1)).toBe("advanced-mode");
+ expect(blocks(html).slice(-2)).toEqual(["more", "advanced-mode"]);
+ expect(html).toContain(">More settings<");
expect([...html.matchAll(/<button[^>]*role="switch"[^>]*>/g)].at(-1)?.[0]).toContain('aria-label="Advanced mode"');
expect(html).toContain("Show every control, including tools for builders. Nothing is deleted either way.");
expect(html).not.toContain("border-accent-border/40");
@@ -192,6 +193,8 @@ describe("Settings in Simple mode", () => {
const looks = renderToStaticMarkup(createElement(SimpleLooksPage, { onBack: () => {} }));
expect(looks).toContain('data-settings-block="looks"');
expect(looks).not.toContain("data-place-picture");
+ expect(looks.indexOf('aria-label="Show tool calls in chat"')).toBeGreaterThan(looks.indexOf('data-settings-block="looks"'));
+ expect(renderToStaticMarkup(createElement(SimpleLooksPage, { onBack: () => {}, toolCalls: false }))).not.toContain("Show tool calls");
});
it("shows the rail's switch only where this window has a rail to hide", () => {
@@ -204,7 +207,7 @@ describe("Settings in Simple mode", () => {
expect(fixture.switches.find((props) => props["aria-label"] === "Show your computers")?.checked).toBe(false);
});
- it("keeps the everyday rows and leaves the fourteen builder controls to Advanced, where search still points", () => {
+ it("keeps the everyday rows, puts limits behind More settings, and leaves the six other builder controls to Advanced, where search still points", () => {
const general = open("general");
for (const shown of ['aria-label="Send usage analytics"', 'aria-label="Color my messages with the bot&#x27;s color"', 'aria-label="Send messages with"',
'aria-label="Notification sounds"', 'aria-label="Show the notification feed"', 'aria-label="App language"', 'role="radiogroup" aria-label="Light or dark"']) {
@@ -212,12 +215,24 @@ describe("Settings in Simple mode", () => {
}
expect(placement(open("updates"), "MARKER:updatesConsent;")).toBe("shown");
const everyPage = ["general", "engines", "companion", "usage", "updates"].map((section) => open(section as AppSettingsSection)).join("");
- for (const gone of ["Effort for new bots", "Defaults for new bots", "Group turns", "MCP calls", "Parallel threads", "Automatic recovery", "Event log cleanup",
+ for (const gone of ["Group turns", "Tool time limit", "Parallel threads", "Automatic recovery", "Event log cleanup",
"Interface font", "Chat width", "Pinned bots as circles", "Universal pins", "Tool calls", "This run", "Keep prompt cache warm"]) {
expect(everyPage, gone).not.toContain(`>${gone}<`);
}
- expect(SIMPLE_ADVANCED_ONLY).toHaveLength(14);
- expect(SIMPLE_ADVANCED_ONLY.map((key) => t(key))).toEqual(expect.arrayContaining(["Effort for new bots", "Interface font", "Keep prompt cache warm"]));
+ expect(SIMPLE_ADVANCED_ONLY.map((key) => t(key))).toEqual(["Automatic recovery", "Interface font", "Chat width", "Pinned bots as circles", "Universal pins", "This run"]);
+ expect(SIMPLE_MORE_LIMITS.map((key) => t(key))).toEqual(["Group turns", "Tool time limit", "Parallel threads", "Event log cleanup", "Keep prompt cache warm", "Repeat computer tasks without AI"]);
+ });
+
+ it("holds the defaults for new bots on AI as one row: the effort they start with, and Edit for the rest", () => {
+ const html = open("engines");
+ const row = html.slice(html.indexOf(">Defaults for new bots<"));
+ expect(row).toContain(">Effort for new bots<");
+ expect(row).toMatch(/<select[^>]*aria-label="Effort for new bots"/);
+ expect(row).toMatch(/data-new-bot-defaults="true"[^>]*>Edit<\/button>/);
+ expect(html.indexOf("MARKER:engines;")).toBeLessThan(html.indexOf(">Defaults for new bots<"));
+ expect(html.indexOf(">Defaults for new bots<")).toBeLessThan(html.indexOf(">API keys<"));
+ fixture.ownerOrAdmin = false;
+ expect(open("engines")).not.toContain("Defaults for new bots");
});
it("names this app and its version on Updates, then product updates, the welcome tour and diagnostics", () => {
diff --git a/src/components/SettingsModal.tsx b/src/components/SettingsModal.tsx
index 1cb238b157..f6585da878 100644
--- a/src/components/SettingsModal.tsx
+++ b/src/components/SettingsModal.tsx
@@ -67,7 +67,7 @@ import { useAdvancedMode } from "@/lib/interface-mode";
import { Select } from "./Select";
import { SavedStepsRow } from "./SavedStepsRow";
import { BrowserProfilesRow, ColorUserBubblesRow, AdvancedModeRow, ExperimentalFeaturesRow, LanguageRow, NewBotEffortRow, PinnedCirclesRow, ReplayTourRow, RunCardRow, FollowUpRow, SendKeyRow, ShowThreadsRow, ToolCallsRow, UniversalPinsRow, UpdatesRow } from "./AppSettingsRows";
-import { SIMPLE_ADVANCED_ONLY, SimpleAiPage, SimpleBillingPage, SimpleComputerPage, SimpleGeneralPage, SimpleLooksPage, SimpleUpdatesPage, type Disclose, type SimpleDisclosureId } from "./SettingsSimplePages";
+import { SIMPLE_ADVANCED_ONLY, SIMPLE_MORE_LIMITS, SimpleAiPage, SimpleBillingPage, SimpleComputerPage, SimpleGeneralPage, SimpleLooksPage, SimpleMorePage, SimpleUpdatesPage, type Disclose, type SimpleDisclosureId } from "./SettingsSimplePages";
// labelKey, not a label: t() reads the active pack when called, so a label resolved at module scope would freeze the
// boot language.
@@ -121,9 +121,9 @@ export type SimpleSettingsPage = {
export const SIMPLE_PAGES: SimpleSettingsPage[] = [
{ id: "general", labelKey: "settings.section.general", icon: Settings, sections: ["general", "appearance", "people", "import", "organization", "activity"],
- keywords: ["account", "theme", "looks", "open at login", "startup", "analytics", "advanced mode"] },
+ keywords: ["account", "theme", "looks", "open at login", "startup", "analytics", "advanced mode", "more settings", "limits", "timeout"] },
{ id: "botAccess", labelKey: "settings.section.botAccess", icon: Users, sections: ["botAccess"] },
- { id: "ai", labelKey: "settings.group.ai", icon: Sparkles, sections: ["engines", "connections"] },
+ { id: "ai", labelKey: "settings.group.ai", icon: Sparkles, sections: ["engines", "connections"], keywords: ["new bots", "defaults", "effort"] },
{ id: "computer", labelKey: "settings.simple.page.computer", icon: Monitor, sections: ["companion", "desktopWorkspaces", "computer", "logins"] },
{ id: "billing", labelKey: "settings.simple.page.billing", icon: Gauge, sections: ["usage", "cloudAccount"], keywords: ["billing", "included", "allowance", "cloud hours", "voice"] },
{ id: "updates", labelKey: "settings.simple.page.updates", icon: CloudDownload, sections: ["updates"],
@@ -238,13 +238,17 @@ export function SettingsModal() {
const open = q !== "" || (folds[id] ?? SIMPLE_FOLDED[requested] === id);
return { id, open, onToggle: () => setFolds((current) => ({ ...current, [id]: !open })) };
};
- const [looks, setLooks] = useState(false);
+ const [openSubPage, setOpenSubPage] = useState<{ view: "looks" | "more"; for: AppSettingsSection } | null>(null);
+ const subPage = openSubPage?.for === requested ? openSubPage.view : null;
+ const setSubPage = (view: "looks" | "more" | null, at: AppSettingsSection = requested) => setOpenSubPage(view && { view, for: at });
+ useEffect(() => { setOpenSubPage((current) => current?.for === requested ? current : null); }, [requested]);
const [reveal, setReveal] = useState<string | null>(null);
const advancedMatches = advanced || !q ? [] : SIMPLE_ADVANCED_ONLY.filter((key) => t(key).toLowerCase().includes(q));
+ const moreSections = availableSections.filter((entry) => SIMPLE_HIDDEN_SECTIONS.includes(entry.id));
const keyResults = remoteActive || !availableSections.some((entry) => entry.id === "connections") ? [] : keySearchResults(q);
const keyResultButtons = (className: string) => keyResults.map((entry) => (
<button key={entry.id} type="button" data-settings-key-result={entry.id} className={className}
- onClick={() => { setQuery(""); setLooks(false); dispatch(openKeyResult(entry)); }}>
+ onClick={() => { setQuery(""); setSubPage(null); dispatch(openKeyResult(entry)); }}>
<span>{t(entry.labelKey)} <span className="text-ink-secondary">· {t(keySection(entry).titleKey)}</span></span>
</button>
));
@@ -438,18 +442,26 @@ export function SettingsModal() {
}
};
+ const openMore = () => { openSection("general"); setSubPage("more", "general"); };
const renderSimplePage = (page: SimpleSettingsPage) => {
const has = (id: AppSettingsSection) => page.sections.includes(id);
switch (page.id) {
- case "general": return looks
- ? <SimpleLooksPage onBack={() => { setLooks(false); setReveal("appearance"); }} />
- : <SimpleGeneralPage has={has} peopleOpen={section === "people"} onLooks={() => setLooks(true)} />;
+ case "general": return subPage === "looks"
+ ? <SimpleLooksPage toolCalls={!remoteActive} onBack={() => { setSubPage(null); setReveal("appearance"); }} />
+ : subPage === "more"
+ ? <SimpleMorePage sections={moreSections} onOpen={(id) => { setSubPage(null); openSection(id); }} onBack={() => { setSubPage(null); setReveal("more"); }} />
+ : <SimpleGeneralPage has={has} peopleOpen={section === "people"} onLooks={() => setSubPage("looks")} onMore={has("general") ? () => setSubPage("more") : undefined} />;
case "ai": return <SimpleAiPage has={has} disclose={disclose} connections={renderSection("connections")} />;
case "computer": return <SimpleComputerPage has={has} remoteAccess={remoteAccess} servers={<ConnectedWorkspacesSettings />} disclose={disclose} />;
case "billing": return <SimpleBillingPage has={has} disclose={disclose} cloudAccount={renderSection("cloudAccount")} />;
case "updates": return <SimpleUpdatesPage remoteActive={remoteActive} />;
default:
- return page.sections.map((id) => <section key={id} data-settings-block={id} className="flex scroll-mt-4 flex-col gap-4">{renderSection(id)}</section>);
+ return <>
+ {SIMPLE_HIDDEN_SECTIONS.includes(page.sections[0]!) && simpleAvailable.has("general") && (
+ <div><button type="button" className="ui-button" onClick={openMore}>{t("settings.simple.looks.back")}</button></div>
+ )}
+ {page.sections.map((id) => <section key={id} data-settings-block={id} className="flex scroll-mt-4 flex-col gap-4">{renderSection(id)}</section>)}
+ </>;
}
};
@@ -475,8 +487,14 @@ export function SettingsModal() {
);
if (!advanced) {
- const looksOpen = looks && currentPage?.id === "general";
- const goTo = (id: AppSettingsSection) => { setLooks(false); openSection(id); };
+ const subOpen = currentPage?.id === "general" ? subPage : null;
+ const resultClass = "flex min-h-8 shrink-0 cursor-pointer items-center rounded-lg px-[9px] py-1.5 text-left text-[13px] leading-[18px] text-ink transition-colors hover:bg-ink/[0.06] motion-reduce:transition-none";
+ const goTo = (id: AppSettingsSection) => { setSubPage(null); openSection(id); };
+ const moreMatches = !q ? [] : [
+ ...moreSections.filter((entry) => sectionMatches(entry, q)).map((entry) => ({ key: entry.id, labelKey: entry.labelKey, open: () => goTo(entry.id) })),
+ ...(simpleAvailable.has("general") ? SIMPLE_MORE_LIMITS : []).filter((key) => t(key).toLowerCase().includes(q))
+ .map((key) => ({ key, labelKey: key, open: () => { openMore(); setReveal("limits"); } })),
+ ];
return (
<div
className="glass-popup-frame"
@@ -501,7 +519,7 @@ export function SettingsModal() {
"mb-2 flex h-8 shrink-0 items-center gap-2 rounded-lg bg-ink/[0.05] px-[9px] text-[13px] focus-within:ring-2 focus-within:ring-focus/60",
"w-full min-w-0 bg-transparent text-[13px] text-ink placeholder:text-ink-secondary focus:outline-none",
)}
- {visiblePages.length === 0 && advancedMatches.length === 0 && keyResults.length === 0 && (
+ {visiblePages.length === 0 && advancedMatches.length === 0 && moreMatches.length === 0 && keyResults.length === 0 && (
<div className="px-[9px] py-3 text-[13px] leading-[18px] text-ink-secondary">{t("settings.noMatch", { query: query.trim() })}</div>
)}
{visiblePages.map((page) => {
@@ -530,12 +548,23 @@ export function SettingsModal() {
type="button"
data-settings-advanced-only={key}
onClick={() => { setQuery(""); goTo("general"); setReveal("advanced-mode"); }}
- className="flex min-h-8 shrink-0 cursor-pointer items-center rounded-lg px-[9px] py-1.5 text-left text-[13px] leading-[18px] text-ink transition-colors hover:bg-ink/[0.06] motion-reduce:transition-none"
+ className={resultClass}
>
<span>{t(key)} <span className="text-ink-secondary">· {t("settings.simple.advanced")}</span></span>
</button>
))}
- {keyResultButtons("flex min-h-8 shrink-0 cursor-pointer items-center rounded-lg px-[9px] py-1.5 text-left text-[13px] leading-[18px] text-ink transition-colors hover:bg-ink/[0.06] motion-reduce:transition-none")}
+ {moreMatches.map((match) => (
+ <button
+ key={match.key}
+ type="button"
+ data-settings-more-result={match.key}
+ onClick={() => { setQuery(""); match.open(); }}
+ className={resultClass}
+ >
+ <span>{t(match.labelKey)} <span className="text-ink-secondary">· {t("settings.simple.more.title")}</span></span>
+ </button>
+ ))}
+ {keyResultButtons(resultClass)}
</nav>
<div className="relative flex min-h-0 min-w-0 flex-1 flex-col">
@@ -554,7 +583,7 @@ export function SettingsModal() {
))}
</Select>
<h2 className="hidden truncate text-[17px] font-medium leading-6 tracking-[-0.008em] text-ink sm:block">
- {looksOpen ? t("settings.simple.page.looks") : currentPage ? t(currentPage.labelKey) : null}
+ {subOpen === "looks" ? t("settings.simple.page.looks") : subOpen === "more" ? t("settings.simple.more.title") : currentPage ? t(currentPage.labelKey) : null}
</h2>
</header>
<button
diff --git a/src/components/SettingsSimplePages.member.test.ts b/src/components/SettingsSimplePages.member.test.ts
index 4b82e4f493..fa4cefee8f 100644
--- a/src/components/SettingsSimplePages.member.test.ts
+++ b/src/components/SettingsSimplePages.member.test.ts
@@ -7,6 +7,7 @@ import type { Disclose } from "./SettingsSimplePages";
const fixture = vi.hoisted(() => ({ admin: false as boolean | null }));
vi.mock("@/lib/use-owner-or-admin", () => ({ useOwnerOrAdmin: () => fixture.admin }));
vi.mock("./EnginesSettings", () => ({ EnginesSettings: () => "AI ACCOUNTS" }));
+vi.mock("./NewBotDialog", () => ({ DefaultBotSettings: () => "NEW BOT DEFAULTS" }));
vi.mock("./LocalComputerSection", () => ({ LocalComputerSection: () => "CLOUD DESKTOPS" }));
vi.mock("./UsageSection", () => ({ UsageSection: () => "USAGE TABLE" }));
vi.mock("./PlanUsage", () => ({ PlanUsageSummary: () => "PLAN USAGE" }));
@@ -31,7 +32,7 @@ beforeEach(() => { fixture.admin = false; });
it("shows a session without the admin scope a plain sentence instead of the installation's AI, computers and usage", () => {
const html = pages();
- for (const hidden of ["AI ACCOUNTS", "KEYS", "CLOUD DESKTOPS", "USAGE TABLE", "PLAN USAGE"]) expect(html).not.toContain(hidden);
+ for (const hidden of ["AI ACCOUNTS", "NEW BOT DEFAULTS", "KEYS", "CLOUD DESKTOPS", "USAGE TABLE", "PLAN USAGE"]) expect(html).not.toContain(hidden);
expect(html).toContain("Only an admin of this installation can change this.");
expect(html).toContain("Only an admin of this installation can see usage.");
});
@@ -39,5 +40,5 @@ it("shows a session without the admin scope a plain sentence instead of the inst
it("keeps them for an admin", () => {
fixture.admin = true;
const html = pages();
- for (const shown of ["AI ACCOUNTS", "KEYS", "CLOUD DESKTOPS", "USAGE TABLE", "PLAN USAGE"]) expect(html).toContain(shown);
+ for (const shown of ["AI ACCOUNTS", "NEW BOT DEFAULTS", "KEYS", "CLOUD DESKTOPS", "USAGE TABLE", "PLAN USAGE"]) expect(html).toContain(shown);
});
diff --git a/src/components/SettingsSimplePages.tsx b/src/components/SettingsSimplePages.tsx
index 46905d676e..dfe9de8b97 100644
--- a/src/components/SettingsSimplePages.tsx
+++ b/src/components/SettingsSimplePages.tsx
@@ -21,7 +21,7 @@ import { LoginsSettings } from "./LoginsSettings";
import { OrganizationSettings } from "./OrganizationSettings";
import { CloudPlanRow, CloudPlanFootnote, useCloudPlan } from "./ProIntroduction";
import { CloudUsageDetails, CloudUsageSummaryView, useCloudUsageSettings } from "./CloudUsageMeter";
-import { SettingRow, SettingsDisclosureRow, SettingsGroup, SettingsRows } from "./SettingsPrimitives";
+import { Card, SettingRow, SettingsDisclosureRow, SettingsGroup, SettingsRows } from "./SettingsPrimitives";
import { UsageSection } from "./UsageSection";
import { PlanUsageSummary } from "./PlanUsage";
import { SkinPicker } from "./SkinPicker";
@@ -34,23 +34,34 @@ import { ProfileSummaryRow } from "./ProfileSettings";
import { ImportSettings } from "./ImportSettings";
import { NotificationRows } from "./NotificationSettingsRows";
import { useServerUpdateItem } from "./SidebarProfileMenu";
-import { AdvancedModeRow, BrowserProfilesRow, ColorUserBubblesRow, FollowUpRow, LanguageRow, ReplayTourRow, SendKeyRow, UpdatesRow } from "./AppSettingsRows";
+import { AdvancedModeRow, BrowserProfilesRow, ColorUserBubblesRow, FollowUpRow, LanguageRow, ReplayTourRow, SendKeyRow, ToolCallsRow, UpdatesRow } from "./AppSettingsRows";
+import { RoomTurnTimeoutSettings } from "./RoomTurnTimeoutSettings";
+import { McpCallTimeoutSettings } from "./McpCallTimeoutSettings";
+import { ThreadConcurrencySettings } from "./ThreadConcurrencySettings";
+import { ThreadCleanupSettings } from "./ThreadCleanupSettings";
+import { CacheKeepWarmSettings } from "./CacheKeepWarmSettings";
+import { SavedStepsRow } from "./SavedStepsRow";
import { ThemeRow } from "./ThemeRow";
import { AdminOnly } from "./AdminOnly";
+import { DefaultBotSettings } from "./NewBotDialog";
export type SimpleDisclosureId = "ai-more" | "ai-keys" | "computer-elsewhere" | "billing-limits";
export type Disclose = (id: SimpleDisclosureId) => { id: SimpleDisclosureId; open: boolean; onToggle: () => void };
export const SIMPLE_ADVANCED_ONLY: readonly LocaleKey[] = [
- "settings.newBotEffort.title", "newBot.defaults", "settings.roomTurns.title", "settings.mcpCalls.title", "settings.threads.title",
- "settings.recovery.title", "settings.threadCleanup.title", "settings.font.title", "settings.chatWidth.title",
- "settings.pinnedCircles.title", "settings.universalPins.title", "settings.toolCalls.title", "settings.runCard.title", "settings.keepWarm.title",
+ "settings.recovery.title", "settings.font.title", "settings.chatWidth.title", "settings.pinnedCircles.title", "settings.universalPins.title",
+ "settings.runCard.title",
+];
+
+export const SIMPLE_MORE_LIMITS: readonly LocaleKey[] = [
+ "settings.roomTurns.title", "settings.mcpCalls.title", "settings.threads.title", "settings.threadCleanup.title", "settings.keepWarm.title",
+ "settings.savedSteps.title",
];
type Has = (id: AppSettingsSection) => boolean;
-export function SimpleGeneralPage({ has, peopleOpen, onLooks }: { has: Has; peopleOpen: boolean; onLooks: () => void }) {
+export function SimpleGeneralPage({ has, peopleOpen, onLooks, onMore }: { has: Has; peopleOpen: boolean; onLooks: () => void; onMore?: () => void }) {
return (
<>
{(has("general") || has("people")) && (
@@ -102,6 +113,15 @@ export function SimpleGeneralPage({ has, peopleOpen, onLooks }: { has: Has; peop
{has("import") && <SettingsGroup label={t("settings.section.import")} block="import"><AdminOnly><ImportSettings /></AdminOnly></SettingsGroup>}
{has("organization") && <SettingsGroup label={t("settings.section.organization")} block="organization"><OrganizationSettings /></SettingsGroup>}
{has("activity") && <SettingsGroup label={t("settings.section.activity")} block="activity"><ActivitySection /></SettingsGroup>}
+ {onMore && (
+ <div data-settings-block="more" className="scroll-mt-4">
+ <SettingsRows>
+ <SettingRow title={t("settings.simple.more.title")} subtitle={t("settings.simple.more.subtitle")}>
+ <button type="button" className="ui-button" data-settings-more="" onClick={onMore}>{t("settings.simple.more.open")}</button>
+ </SettingRow>
+ </SettingsRows>
+ </div>
+ )}
<div data-settings-block="advanced-mode" className="scroll-mt-4">
<SettingsRows><AdvancedModeRow simple /></SettingsRows>
</div>
@@ -121,11 +141,43 @@ function LooksRow({ onLooks }: { onLooks: () => void }) {
);
}
-export function SimpleLooksPage({ onBack }: { onBack: () => void }) {
+export function SimpleLooksPage({ onBack, toolCalls = true }: { onBack: () => void; toolCalls?: boolean }) {
return (
<>
<div><button type="button" className="ui-button" onClick={onBack}>{t("settings.simple.looks.back")}</button></div>
<div data-settings-block="looks"><SkinPicker /></div>
+ {toolCalls && <SettingsRows><ToolCallsRow /></SettingsRows>}
+ </>
+ );
+}
+
+type MoreSection = { id: AppSettingsSection; labelKey: LocaleKey };
+
+export function SimpleMorePage({ sections, onOpen, onBack }: { sections: readonly MoreSection[]; onOpen: (id: AppSettingsSection) => void; onBack: () => void }) {
+ return (
+ <>
+ <div><button type="button" className="ui-button" onClick={onBack}>{t("settings.simple.looks.back")}</button></div>
+ {sections.length > 0 && (
+ <SettingsGroup block="more-sections">
+ <SettingsRows>
+ {sections.map(({ id, labelKey }) => (
+ <SettingRow key={id} title={t(labelKey)}>
+ <button type="button" className="ui-button" data-settings-more-section={id} onClick={() => onOpen(id)}>{t("settings.simple.more.open")}</button>
+ </SettingRow>
+ ))}
+ </SettingsRows>
+ </SettingsGroup>
+ )}
+ <SettingsGroup label={t("settings.simple.more.limits")} block="limits">
+ <div className="flex flex-col gap-3">
+ <Card title={t("settings.roomTurns.title")} subtitle={t("settings.roomTurns.subtitle")}><RoomTurnTimeoutSettings /></Card>
+ <Card title={t("settings.mcpCalls.title")} subtitle={t("settings.mcpCalls.subtitle")}><McpCallTimeoutSettings /></Card>
+ <ThreadConcurrencySettings />
+ <ThreadCleanupSettings />
+ <CacheKeepWarmSettings />
+ <SettingsRows><SavedStepsRow /></SettingsRows>
+ </div>
+ </SettingsGroup>
</>
);
}
@@ -133,7 +185,14 @@ export function SimpleLooksPage({ onBack }: { onBack: () => void }) {
export function SimpleAiPage({ has, disclose, connections }: { has: Has; disclose: Disclose; connections: ReactNode }) {
return (
<>
- {has("engines") && <div data-settings-block="engines" className="flex scroll-mt-4 flex-col gap-7"><AdminOnly><EnginesSettings simple more={disclose("ai-more")} /></AdminOnly></div>}
+ {has("engines") && (
+ <div data-settings-block="engines" className="flex scroll-mt-4 flex-col gap-7">
+ <AdminOnly>
+ <EnginesSettings simple more={disclose("ai-more")} />
+ <SettingsRows><DefaultBotSettings simple /></SettingsRows>
+ </AdminOnly>
+ </div>
+ )}
{has("connections") && (
<AdminOnly>
<SettingsDisclosureRow title={t("settings.section.connections")} block="connections" {...disclose("ai-keys")}>
diff --git a/src/components/SimpleVpsChoices.tsx b/src/components/SimpleVpsChoices.tsx
new file mode 100644
index 0000000000..c187fdc239
--- /dev/null
+++ b/src/components/SimpleVpsChoices.tsx
@@ -0,0 +1,27 @@
+import { t } from "@/lib/i18n";
+import type { Bot } from "@/state/store";
+import type { CloudBackend } from "../../shared/wire";
+import { CloudBackendPicker } from "./CloudBackendPicker";
+import { Switch } from "./SettingsPrimitives";
+
+export function SimpleVpsChoices({ bot, backend, onBackend, onAutoStart }: {
+ bot: Bot;
+ backend: CloudBackend;
+ onBackend: (backend: CloudBackend) => void;
+ onAutoStart: () => void;
+}) {
+ return (
+ <div data-testid="vps-choices">
+ <CloudBackendPicker compact value={backend} onChange={onBackend} />
+ {!bot.computer && (
+ <div className="mt-3 flex items-center justify-between gap-4 rounded-lg bg-inset px-3 py-2.5">
+ <div className="min-w-0">
+ <div className="text-[13px] text-ink">{t("botAccess.cloud.startVps")}</div>
+ <div className="mt-0.5 text-[12px] text-ink-secondary">{t("botAccess.cloud.startVpsDescription")}</div>
+ </div>
+ <Switch checked={Boolean(bot.autoStartVps)} aria-label={t("botAccess.cloud.startVps")} onClick={onAutoStart} />
+ </div>
+ )}
+ </div>
+ );
+}
diff --git a/src/components/bot-panel/DetailsTab.tsx b/src/components/bot-panel/DetailsTab.tsx
index ad356c6e96..6436ef9b4d 100644
--- a/src/components/bot-panel/DetailsTab.tsx
+++ b/src/components/bot-panel/DetailsTab.tsx
@@ -14,7 +14,7 @@ import { Card, CardLabel, LabelAction, panelActionCls, NavRow, RowIcon, rowCls,
type Derived = ReturnType<typeof useBotSettingsDerived>;
-export const CONVERSATION_ITEMS = ["find", "usage", "activity"];
+export const CONVERSATION_ITEMS = ["find", "usage", "activity", "inspector"];
/** A ⋯ menu item drawn as a panel row: the same label, icon, value and handler. */
export function ItemRow({ item }: { item: SidebarMenuItem }) {
diff --git a/src/components/bot-panel/SettingsPage.tsx b/src/components/bot-panel/SettingsPage.tsx
index 6c18d9b6c9..7d08052b09 100644
--- a/src/components/bot-panel/SettingsPage.tsx
+++ b/src/components/bot-panel/SettingsPage.tsx
@@ -1,5 +1,5 @@
import { useState } from "react";
-import { AppWindow, AudioLines, ChevronRight, FileText, ShieldCheck, Tag } from "lucide-react";
+import { AppWindow, AudioLines, Bell, ChevronRight, ExternalLink, Eye, FileText, MessageSquareText, ShieldCheck, Slack, Tag } from "lucide-react";
import { cn } from "@/lib/cn";
import { t } from "@/lib/i18n";
@@ -7,23 +7,28 @@ import { mcpServersForBot, useMcpServers } from "@/lib/mcp-servers";
import { CALL_MODES, callModeHint, effectiveCallMode, setCallMode, useCallMode, type CallMode } from "@/lib/call-mode";
import { callCapabilityHelp } from "@/lib/call-capability";
import { fishListeningReady, listensHere, speechBridge } from "@/lib/speech";
+import { requestNotificationPermission } from "@/lib/notify";
import { firstSentence } from "@/lib/soul";
import { currentTaskBot, useStore, type Bot } from "@/state/store";
import type { ApprovalMode } from "../../../shared/approval-mode";
import { BOT_PROFILE_LIMITS } from "../../../shared/bot-profile";
+import { REPLY_STYLES, type ReplyStyle } from "../../../shared/reply-style";
import { ApprovalChip } from "../ComposerPlusMenu";
import { useDesktopCapabilities } from "../DesktopCapabilities";
import { DefaultBotHideRow } from "../DefaultBotControls";
import { SoulField } from "../SoulField";
import { BotApiCard } from "../bot-settings/BotApiCard";
+import { REPLY_STYLE_LABELS } from "../bot-settings/ReplyStyleField";
+import { useChoosesVisibility, visibilityLabel } from "../bot-settings/VisibilitySection";
import { useBotApps } from "../bot-settings/useBotApps";
+import { useSlackManagementUrl } from "../bot-settings/useSlackManagement";
import type { useBotSettingsDerived } from "../bot-settings/useBotSettingsDerived";
import { useThreadApproval } from "../thread-approval";
import { BackupAis } from "./BackupAis";
import { HeavyBotRow } from "./HeavyBotRow";
import { SoulChanges } from "./SoulChanges";
import type { SimplePageId } from "./page-registry";
-import { buttonCls, Card, ColRow, NavRow, RowIcon, rowCls, RowText, Segmented, type SegmentOption } from "./rows";
+import { buttonCls, Card, ColRow, NavRow, RowIcon, rowCls, RowText, Segmented, SwitchRow, TrashButton, type SegmentOption } from "./rows";
type Derived = ReturnType<typeof useBotSettingsDerived>;
@@ -48,6 +53,8 @@ export function SettingsPage({ bot, derived, onOpen, editingInstructions = false
const { servers: allServers } = useMcpServers();
const approval = useThreadApproval(currentTaskBot(bot));
const storedCallMode = useCallMode();
+ const slackUrl = useSlackManagementUrl(bot.id);
+ const choosesVisibility = useChoosesVisibility();
const [jobDraft, setJobDraft] = useState<string | null>(null);
const { patch, approvalMode, engine } = derived;
const name = bot.name;
@@ -81,6 +88,18 @@ export function SettingsPage({ bot, derived, onOpen, editingInstructions = false
tooltip: entry.id === "turns" && turnsHelp ? `${turnsHelp.label}. ${turnsHelp.reason}` : entry.id === "live" ? t("call.mode.liveHint") : callModeHint("turns"),
}));
+ const replyOptions: SegmentOption<ReplyStyle>[] = REPLY_STYLES.map((style) => ({
+ value: style,
+ label: t(REPLY_STYLE_LABELS[style][0]),
+ tooltip: t(REPLY_STYLE_LABELS[style][1]),
+ }));
+ const toggleNotifications = () => {
+ const enabled = !bot.notifications;
+ if (enabled) void requestNotificationPermission();
+ patch({ notifications: enabled });
+ };
+ const alwaysAllow = bot.alwaysAllow ?? [];
+
const soulOpen = editingInstructions || Boolean(bot.soulDrift);
const enabledApps = [
...apps.apps.filter((app) => app.scope !== null).map((app) => app.label),
@@ -152,6 +171,21 @@ export function SettingsPage({ bot, derived, onOpen, editingInstructions = false
</span>
</div>
)}
+ {alwaysAllow.length > 0 && (
+ <div data-panel-row="always-allow" className="flex min-w-0 flex-col gap-1 pl-[38px]">
+ <span className="text-[13px] text-ink-secondary">{t("botAccess.always.title")}</span>
+ {alwaysAllow.map((entry) => (
+ <div key={entry} className="flex min-w-0 items-center gap-2">
+ <span className="min-w-0 flex-1 truncate font-mono text-[12px] text-ink">{entry}</span>
+ <TrashButton
+ data-panel-action={`always-allow:${entry}`}
+ label={t("botAccess.always.remove", { entry })}
+ onClick={() => patch({ alwaysAllow: alwaysAllow.filter((key) => key !== entry) })}
+ />
+ </div>
+ ))}
+ </div>
+ )}
</ColRow>
</Card>
@@ -169,6 +203,32 @@ export function SettingsPage({ bot, derived, onOpen, editingInstructions = false
</ColRow>
</Card>
+ <Card anchor="replies">
+ <ColRow data-panel-row="reply-style">
+ <div className="flex items-center gap-2.5">
+ <RowIcon icon={MessageSquareText} />
+ <RowText title={t("botSettings.replyStyle.title")} />
+ </div>
+ <div className="pl-[38px]">
+ <Segmented
+ attr="data-reply-style"
+ label={t("botSettings.replyStyle.title")}
+ value={bot.replyStyle ?? "default"}
+ onChange={(style) => patch({ replyStyle: style })}
+ options={replyOptions}
+ />
+ </div>
+ </ColRow>
+ <SwitchRow
+ data-panel-row="notifications"
+ icon={Bell}
+ title={t("voice.notifications.title")}
+ color={bot.color}
+ checked={bot.notifications}
+ onChange={toggleNotifications}
+ />
+ </Card>
+
<Card anchor="uses">
<NavRow
data-panel-page="apps"
@@ -201,6 +261,22 @@ export function SettingsPage({ bot, derived, onOpen, editingInstructions = false
className="min-w-0 flex-1 bg-transparent text-right text-[13px] text-ink-secondary outline-none placeholder:text-ink-tertiary focus:text-ink"
/>
</label>
+ {slackUrl && (
+ <a data-panel-row="slack" href={slackUrl} target="_blank" rel="noopener noreferrer" className={cn(rowCls, "hover:bg-ink/[0.03]")}>
+ <RowIcon icon={Slack} />
+ <RowText title={t("botPanel.page.slack")} hint={t("botSlack.manage")} />
+ <ExternalLink size={14} className="shrink-0 text-ink-tertiary" aria-hidden="true" />
+ </a>
+ )}
+ {choosesVisibility && (
+ <NavRow
+ data-panel-page="visibility"
+ icon={Eye}
+ title={t("botSettings.visibility.title")}
+ value={visibilityLabel(bot.visibility)}
+ onClick={() => onOpen?.("visibility")}
+ />
+ )}
</Card>
<BotApiCard bot={bot} webhooksLink className="mt-3.5" />
diff --git a/src/components/bot-panel/page-registry.test.ts b/src/components/bot-panel/page-registry.test.ts
index 4d9aca0ca3..92c0740638 100644
--- a/src/components/bot-panel/page-registry.test.ts
+++ b/src/components/bot-panel/page-registry.test.ts
@@ -31,10 +31,10 @@ describe("the bot panel's page registry", () => {
});
it("draws the Simple pages on their tabs: settings on Details, what it keeps on Library, where it works on Computer", () => {
- expect(SIMPLE_PAGES).toEqual(["settings", "apps", "routines", "memory", "skills", "folder", "browser", "where"]);
+ expect(SIMPLE_PAGES).toEqual(["settings", "apps", "routines", "visibility", "memory", "skills", "folder", "browser", "where"]);
const home = Object.fromEntries(SIMPLE_PAGES.map((page) => [page, PAGES[page].home]));
expect(home).toEqual({
- settings: "details", apps: "details", routines: "details",
+ settings: "details", apps: "details", routines: "details", visibility: "details",
memory: "library", skills: "library", folder: "library",
browser: "computer", where: "computer",
});
diff --git a/src/components/bot-panel/page-registry.ts b/src/components/bot-panel/page-registry.ts
index 390d25e8a1..22a67c8d33 100644
--- a/src/components/bot-panel/page-registry.ts
+++ b/src/components/bot-panel/page-registry.ts
@@ -19,7 +19,7 @@ export type PageId =
| "overview" | "prompt" | "history";
/** The pages Simple mode draws; a link to any other page lands where its section does. */
-export const SIMPLE_PAGES = ["settings", "apps", "routines", "memory", "skills", "folder", "browser", "where"] as const satisfies readonly PageId[];
+export const SIMPLE_PAGES = ["settings", "apps", "routines", "visibility", "memory", "skills", "folder", "browser", "where"] as const satisfies readonly PageId[];
export type SimplePageId = (typeof SIMPLE_PAGES)[number];
export function isSimplePage(page: PageId): page is SimplePageId {
diff --git a/src/components/bot-panel/pages.tsx b/src/components/bot-panel/pages.tsx
index 59bb38d735..ca0374a0b9 100644
--- a/src/components/bot-panel/pages.tsx
+++ b/src/components/bot-panel/pages.tsx
@@ -19,6 +19,7 @@ import { useWorkingFolder } from "../bot-settings/AccessSection";
import { useBotEditor } from "../bot-settings/BotEditorContext";
import { SkillReviewDialog, skillSwitchOn, useManagedSkills, type ManagedSkill } from "../bot-settings/SkillsSection";
import { useBotApps, type BotApp } from "../bot-settings/useBotApps";
+import { useChoosesVisibility, VisibilitySection } from "../bot-settings/VisibilitySection";
import type { useBotSettingsDerived } from "../bot-settings/useBotSettingsDerived";
import { RoutineList } from "../routines/RoutineList";
import { BrowserLogins } from "./browser-logins";
@@ -432,6 +433,10 @@ export function BrowserPage({ bot, derived }: PageContext) {
return <BrowserLogins bot={bot} browserEnabled={derived.browserEnabled} onOpenBrowser={() => openComputer("browser")} />;
}
+function VisibilityPage({ bot }: PageContext) {
+ return useChoosesVisibility() ? <VisibilitySection bot={bot} /> : null;
+}
+
export function PageBody({ page, onOpen, editingInstructions, onEditInstructions, ...context }: PageContext & {
page: SimplePageId;
onOpen?: (page: SimplePageId) => void;
@@ -447,6 +452,8 @@ export function PageBody({ page, onOpen, editingInstructions, onEditInstructions
return <AppsPage {...context} />;
case "routines":
return <RoutinesPage {...context} />;
+ case "visibility":
+ return <VisibilityPage {...context} />;
case "memory":
return <MemoryPage {...context} />;
case "skills":
diff --git a/src/components/bot-panel/rows.tsx b/src/components/bot-panel/rows.tsx
index 774c0cf7be..1c08e780ef 100644
--- a/src/components/bot-panel/rows.tsx
+++ b/src/components/bot-panel/rows.tsx
@@ -79,9 +79,10 @@ export function BotSwitch({ color, checked, ...props }: Parameters<typeof Switch
return <Switch {...props} checked={checked} style={checked ? { backgroundColor: MAUS_COLORS[color] } : undefined} />;
}
-export function SwitchRow({ title, hint, checked, onChange, disabled, color, label, tooltip, extra, ...rest }: {
+export function SwitchRow({ title, hint, icon, checked, onChange, disabled, color, label, tooltip, extra, ...rest }: {
title: ReactNode;
hint?: ReactNode;
+ icon?: LucideIcon;
checked: boolean;
onChange: () => void;
disabled?: boolean;
@@ -93,6 +94,7 @@ export function SwitchRow({ title, hint, checked, onChange, disabled, color, lab
}) {
return (
<div {...rest} className={rowCls}>
+ {icon && <RowIcon icon={icon} />}
<RowText title={title} hint={hint} />
{extra}
<BotSwitch
diff --git a/src/components/bot-settings/ReplyStyleField.tsx b/src/components/bot-settings/ReplyStyleField.tsx
index 2c6f4159ab..7a7388ed18 100644
--- a/src/components/bot-settings/ReplyStyleField.tsx
+++ b/src/components/bot-settings/ReplyStyleField.tsx
@@ -3,7 +3,7 @@ import type { Bot } from "@/state/store";
import { REPLY_STYLES, type ReplyStyle } from "../../../shared/reply-style";
import type { BotPatch } from "./useBotSettingsDerived";
-const LABELS = {
+export const REPLY_STYLE_LABELS = {
default: ["botSettings.replyStyle.default", "botSettings.replyStyle.defaultHint"],
conversational: ["botSettings.replyStyle.conversational", "botSettings.replyStyle.conversationalHint"],
} as const satisfies Record<ReplyStyle, readonly [string, string]>;
@@ -28,8 +28,8 @@ export function ReplyStyleField({ bot, patch }: { bot: Bot; patch: (patch: BotPa
onChange={() => patch({ replyStyle: style })}
/>
<span>
- {t(LABELS[style][0])}
- <span className="block text-[12px] text-ink-secondary">{t(LABELS[style][1])}</span>
+ {t(REPLY_STYLE_LABELS[style][0])}
+ <span className="block text-[12px] text-ink-secondary">{t(REPLY_STYLE_LABELS[style][1])}</span>
</span>
</label>
))}
diff --git a/src/components/bot-settings/VisibilitySection.tsx b/src/components/bot-settings/VisibilitySection.tsx
index 95a84aa0ff..095e192a5a 100644
--- a/src/components/bot-settings/VisibilitySection.tsx
+++ b/src/components/bot-settings/VisibilitySection.tsx
@@ -4,7 +4,9 @@ import { Check, Loader2 } from "lucide-react";
import { api, useStore, type Bot } from "@/state/store";
import { cn } from "@/lib/cn";
import { t } from "@/lib/i18n";
+import { useOwnerOrAdmin } from "@/lib/use-owner-or-admin";
import type { BotVisibility } from "../../../shared/wire";
+import { useTeamName } from "../bot-access/ShareBotButton";
export type VisibilityMode = "everyone" | "admins" | "people";
@@ -47,6 +49,18 @@ const OPTIONS: Array<{ mode: VisibilityMode; key: "botSettings.visibility.everyo
{ mode: "people", key: "botSettings.visibility.people" },
];
+export function useChoosesVisibility(): boolean {
+ const { state } = useStore();
+ const ownerOrAdmin = useOwnerOrAdmin();
+ const teamName = useTeamName();
+ return !window.ogb && ownerOrAdmin === true && Boolean(state.config) && !teamName;
+}
+
+export function visibilityLabel(visibility: BotVisibility | undefined): string {
+ const { mode } = formFromVisibility(visibility);
+ return t(OPTIONS.find((option) => option.mode === mode)!.key);
+}
+
export function VisibilitySection({ bot }: { bot: Bot }) {
const { state } = useStore();
const mixed = mixedRooms(bot, state.groups, state.bots);
diff --git a/src/lib/computer-panel-view.test.ts b/src/lib/computer-panel-view.test.ts
index 373ef65214..3dad02b1c7 100644
--- a/src/lib/computer-panel-view.test.ts
+++ b/src/lib/computer-panel-view.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, it, vi } from "vitest";
-import { readComputerPanelView, resolveComputerPanelView, writeComputerPanelView } from "./computer-panel-view";
+import { computerPanelTabs, readComputerPanelView, resolveComputerPanelView, writeComputerPanelView } from "./computer-panel-view";
describe("computer panel view persistence", () => {
it("restores the browser for the same bot after the expanded workspace closes", () => {
@@ -48,10 +48,16 @@ describe("computer panel view availability", () => {
it("drops the tabs the current mode does not render", () => {
expect(resolveComputerPanelView("routines", { advanced: false, androidConnected: false })).toBe("computer");
- expect(resolveComputerPanelView("android", { advanced: false, androidConnected: true })).toBe("computer");
expect(resolveComputerPanelView("files", { advanced: true, androidConnected: true })).toBe("computer");
});
+ it("shows Simple the Android tab, after Computer, only while a device is connected", () => {
+ expect(computerPanelTabs({ advanced: false, androidConnected: true })).toEqual(["computer", "android", "browser", "data", "files"]);
+ expect(computerPanelTabs({ advanced: false, androidConnected: false })).toEqual(["computer", "browser", "data", "files"]);
+ expect(resolveComputerPanelView("android", { advanced: false, androidConnected: true })).toBe("android");
+ expect(resolveComputerPanelView("android", { advanced: false, androidConnected: false })).toBe("computer");
+ });
+
it("keeps a view whose trigger is on the row", () => {
for (const view of ["computer", "browser", "data"] as const) {
expect(resolveComputerPanelView(view, { advanced: true, androidConnected: true })).toBe(view);
diff --git a/src/lib/computer-panel-view.ts b/src/lib/computer-panel-view.ts
index 61ca71943c..d63a418d3d 100644
--- a/src/lib/computer-panel-view.ts
+++ b/src/lib/computer-panel-view.ts
@@ -3,9 +3,10 @@ export type ComputerPanelView = "computer" | "android" | "browser" | "routines"
type PanelTabsContext = { advanced: boolean; androidConnected: boolean };
export function computerPanelTabs({ advanced, androidConnected }: PanelTabsContext): ComputerPanelView[] {
+ const android = androidConnected ? (["android"] as const) : [];
return advanced
- ? ["computer", "routines", ...(androidConnected ? (["android"] as const) : []), "browser", "data"]
- : ["computer", "browser", "data", "files"];
+ ? ["computer", "routines", ...android, "browser", "data"]
+ : ["computer", ...android, "browser", "data", "files"];
}
export function resolveComputerPanelView(view: ComputerPanelView, context: PanelTabsContext): ComputerPanelView {
diff --git a/src/locales/de.json b/src/locales/de.json
index 2bd3509880..8091652138 100644
--- a/src/locales/de.json
+++ b/src/locales/de.json
@@ -3434,5 +3434,9 @@
"botPanel.heavy": "Dieser Bot lädt bei jedem Zug sehr viel.",
"botPanel.tidyMemory": "Gedächtnis aufräumen",
"memory.journal.instructions": "die Anweisungen",
- "memory.journal.actor.teamSetup": "Die Team-Einrichtung"
+ "memory.journal.actor.teamSetup": "Die Team-Einrichtung",
+ "settings.simple.more.title": "Weitere Einstellungen",
+ "settings.simple.more.subtitle": "Backups, Limits und Einstellungen, die du selten änderst.",
+ "settings.simple.more.limits": "Limits",
+ "settings.simple.more.open": "Öffnen"
}
diff --git a/src/locales/en.json b/src/locales/en.json
index a2095866d7..fef042199b 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -6584,6 +6584,10 @@
"settings.simple.themes.followHint": "Follows your computer: Daylight when it is light, Midnight when it is dark.",
"settings.simple.themes.fixedHint": "Stays as it is. Choose Follow system to switch between Daylight and Midnight on its own.",
"settings.simple.looks.back": "Back",
+ "settings.simple.more.title": "More settings",
+ "settings.simple.more.subtitle": "Backups, limits and settings you rarely change.",
+ "settings.simple.more.limits": "Limits",
+ "settings.simple.more.open": "Open",
"settings.simple.theme.system": "Follow system",
"settings.simple.language.system": "Follow system",
"settings.simple.language.partial": "Only part of the app is translated so far.",
diff --git a/src/locales/es.json b/src/locales/es.json
index e5d9bf65f0..0764503373 100644
--- a/src/locales/es.json
+++ b/src/locales/es.json
@@ -6083,5 +6083,9 @@
"botPanel.heavy": "Este bot carga mucho en cada turno.",
"botPanel.tidyMemory": "Ordenar la memoria",
"memory.journal.instructions": "las instrucciones",
- "memory.journal.actor.teamSetup": "La configuración del equipo"
+ "memory.journal.actor.teamSetup": "La configuración del equipo",
+ "settings.simple.more.title": "Más ajustes",
+ "settings.simple.more.subtitle": "Copias de seguridad, límites y ajustes que cambias poco.",
+ "settings.simple.more.limits": "Límites",
+ "settings.simple.more.open": "Abrir"
}
diff --git a/src/locales/fr.json b/src/locales/fr.json
index 645a32d95e..49bba2f69b 100644
--- a/src/locales/fr.json
+++ b/src/locales/fr.json
@@ -3300,5 +3300,9 @@
"botPanel.heavy": "Ce bot charge beaucoup à chaque tour.",
"botPanel.tidyMemory": "Ranger la mémoire",
"memory.journal.instructions": "les instructions",
- "memory.journal.actor.teamSetup": "La configuration de l'équipe"
+ "memory.journal.actor.teamSetup": "La configuration de l'équipe",
+ "settings.simple.more.title": "Plus de paramètres",
+ "settings.simple.more.subtitle": "Sauvegardes, limites et paramètres que vous modifiez rarement.",
+ "settings.simple.more.limits": "Limites",
+ "settings.simple.more.open": "Ouvrir"
}
diff --git a/src/locales/hi.json b/src/locales/hi.json
index 16b2906599..71a6c844a0 100644
--- a/src/locales/hi.json
+++ b/src/locales/hi.json
@@ -3152,5 +3152,9 @@
"botPanel.heavy": "यह बॉट हर बार बहुत कुछ लोड करता है।",
"botPanel.tidyMemory": "मेमोरी व्यवस्थित करें",
"memory.journal.instructions": "निर्देश",
- "memory.journal.actor.teamSetup": "टीम सेटअप"
+ "memory.journal.actor.teamSetup": "टीम सेटअप",
+ "settings.simple.more.title": "और सेटिंग्स",
+ "settings.simple.more.subtitle": "बैकअप, सीमाएँ और वे सेटिंग्स जिन्हें आप कभी-कभार ही बदलते हैं।",
+ "settings.simple.more.limits": "सीमाएँ",
+ "settings.simple.more.open": "खोलें"
}
diff --git a/src/locales/it.json b/src/locales/it.json
index d65c9b9e8b..9ab23de917 100644
--- a/src/locales/it.json
+++ b/src/locales/it.json
@@ -6707,5 +6707,9 @@
"phone.code.pairingCode": "Codice di abbinamento",
"phone.code.typeIntro": "Apri l'app {app} e inserisci questo codice di abbinamento.",
"phone.signIn.emailCode": "Codice di accesso dalla tua email",
- "computer.linux.metaOmarchy": "Sperimentale · Omarchy (Hyprland) · Wayland"
+ "computer.linux.metaOmarchy": "Sperimentale · Omarchy (Hyprland) · Wayland",
+ "settings.simple.more.title": "Altre impostazioni",
+ "settings.simple.more.subtitle": "Backup, limiti e impostazioni che cambi di rado.",
+ "settings.simple.more.limits": "Limiti",
+ "settings.simple.more.open": "Apri"
}
diff --git a/src/locales/ja.json b/src/locales/ja.json
index d05cb44b5f..c760fe6675 100644
--- a/src/locales/ja.json
+++ b/src/locales/ja.json
@@ -6339,6 +6339,10 @@
"settings.simple.looks.title": "その他の外観",
"settings.simple.looks.change": "変更",
"settings.simple.looks.back": "戻る",
+ "settings.simple.more.title": "その他の設定",
+ "settings.simple.more.subtitle": "バックアップ、上限、あまり変更しない設定。",
+ "settings.simple.more.limits": "上限",
+ "settings.simple.more.open": "開く",
"settings.simple.theme.system": "システムに合わせる",
"settings.simple.language.system": "システムに合わせる",
"settings.simple.language.partial": "翻訳されているのは、まだアプリの一部だけです。",
diff --git a/src/locales/ko.json b/src/locales/ko.json
index 8fb3f308db..b16ad48d42 100644
--- a/src/locales/ko.json
+++ b/src/locales/ko.json
@@ -6092,6 +6092,10 @@
"settings.simple.looks.title": "더 많은 모양",
"settings.simple.looks.change": "변경",
"settings.simple.looks.back": "뒤로",
+ "settings.simple.more.title": "기타 설정",
+ "settings.simple.more.subtitle": "백업, 한도, 자주 바꾸지 않는 설정이에요.",
+ "settings.simple.more.limits": "한도",
+ "settings.simple.more.open": "열기",
"settings.simple.theme.system": "시스템 설정 따르기",
"settings.simple.language.system": "시스템 설정 따르기",
"settings.simple.language.partial": "아직 앱의 일부만 번역되어 있어요.",
diff --git a/src/locales/pl.json b/src/locales/pl.json
index e63cf4eb7b..0fcba14797 100644
--- a/src/locales/pl.json
+++ b/src/locales/pl.json
@@ -6845,5 +6845,9 @@
"remote.client.endsDec7": "Ten rodzaj połączenia kończy się 7 grudnia. Potem sparuj ten komputer ponownie z Telefon i urządzenia na drugim komputerze.",
"phone.code.pairingCode": "Kod parowania",
"phone.code.typeIntro": "Otwórz aplikację {app} i wpisz ten kod parowania.",
- "phone.signIn.emailCode": "Kod logowania z Twojego e-maila"
+ "phone.signIn.emailCode": "Kod logowania z Twojego e-maila",
+ "settings.simple.more.title": "Więcej ustawień",
+ "settings.simple.more.subtitle": "Kopie zapasowe, limity i ustawienia, które rzadko zmieniasz.",
+ "settings.simple.more.limits": "Limity",
+ "settings.simple.more.open": "Otwórz"
}
diff --git a/src/locales/pt-br.json b/src/locales/pt-br.json
index 0b078b35d7..37faadbe34 100644
--- a/src/locales/pt-br.json
+++ b/src/locales/pt-br.json
@@ -6315,6 +6315,10 @@
"settings.simple.themes.followHint": "Segue o seu computador: Daylight quando está claro, Midnight quando está escuro.",
"settings.simple.themes.fixedHint": "Fica como está. Escolha Seguir o sistema para alternar entre Daylight e Midnight sozinho.",
"settings.simple.looks.back": "Voltar",
+ "settings.simple.more.title": "Mais configurações",
+ "settings.simple.more.subtitle": "Backups, limites e configurações que você raramente muda.",
+ "settings.simple.more.limits": "Limites",
+ "settings.simple.more.open": "Abrir",
"settings.simple.theme.system": "Seguir o sistema",
"settings.simple.language.system": "Seguir o sistema",
"settings.simple.language.partial": "Só parte do app está traduzida por enquanto.",
diff --git a/src/locales/ru.json b/src/locales/ru.json
index 54efed041c..005c0f35f1 100644
--- a/src/locales/ru.json
+++ b/src/locales/ru.json
@@ -6907,5 +6907,9 @@
"remote.client.endsDec7": "Этот тип подключения перестанет работать 7 декабря. После этого снова сопрягите этот компьютер из раздела «Телефон и устройства» на другом компьютере.",
"phone.code.pairingCode": "Код сопряжения",
"phone.code.typeIntro": "Откройте приложение {app} и введите этот код сопряжения.",
- "phone.signIn.emailCode": "Код входа из письма"
+ "phone.signIn.emailCode": "Код входа из письма",
+ "settings.simple.more.title": "Другие настройки",
+ "settings.simple.more.subtitle": "Резервные копии, ограничения и настройки, которые вы меняете редко.",
+ "settings.simple.more.limits": "Ограничения",
+ "settings.simple.more.open": "Открыть"
}
diff --git a/src/locales/tr.json b/src/locales/tr.json
index 7ca7e6a600..49005010be 100644
--- a/src/locales/tr.json
+++ b/src/locales/tr.json
@@ -5583,5 +5583,9 @@
"botPanel.heavy": "Bu bot her turda çok şey yüklüyor.",
"botPanel.tidyMemory": "Belleği düzenle",
"memory.journal.instructions": "talimatlar",
- "memory.journal.actor.teamSetup": "Ekip kurulumu"
+ "memory.journal.actor.teamSetup": "Ekip kurulumu",
+ "settings.simple.more.title": "Diğer ayarlar",
+ "settings.simple.more.subtitle": "Yedekler, sınırlar ve nadiren değiştirdiğiniz ayarlar.",
+ "settings.simple.more.limits": "Sınırlar",
+ "settings.simple.more.open": "Aç"
}
diff --git a/src/locales/uk.json b/src/locales/uk.json
index 7158f40f10..46336d7241 100644
--- a/src/locales/uk.json
+++ b/src/locales/uk.json
@@ -3593,5 +3593,9 @@
"botPanel.heavy": "Цей бот завантажує багато на кожному ході.",
"botPanel.tidyMemory": "Упорядкувати пам'ять",
"memory.journal.instructions": "інструкції",
- "memory.journal.actor.teamSetup": "Налаштування команди"
+ "memory.journal.actor.teamSetup": "Налаштування команди",
+ "settings.simple.more.title": "Інші налаштування",
+ "settings.simple.more.subtitle": "Резервні копії, обмеження та налаштування, які ви змінюєте рідко.",
+ "settings.simple.more.limits": "Обмеження",
+ "settings.simple.more.open": "Відкрити"
}
diff --git a/src/locales/vi.json b/src/locales/vi.json
index b724d86151..96b4b4673e 100644
--- a/src/locales/vi.json
+++ b/src/locales/vi.json
@@ -5583,5 +5583,9 @@
"botPanel.heavy": "Bot này tải rất nhiều mỗi lượt.",
"botPanel.tidyMemory": "Dọn bộ nhớ",
"memory.journal.instructions": "chỉ dẫn",
- "memory.journal.actor.teamSetup": "Thiết lập nhóm"
+ "memory.journal.actor.teamSetup": "Thiết lập nhóm",
+ "settings.simple.more.title": "Cài đặt khác",
+ "settings.simple.more.subtitle": "Sao lưu, giới hạn và các cài đặt bạn ít khi thay đổi.",
+ "settings.simple.more.limits": "Giới hạn",
+ "settings.simple.more.open": "Mở"
}
diff --git a/src/locales/zh-tw.json b/src/locales/zh-tw.json
index 902415e6ba..27ae024be9 100644
--- a/src/locales/zh-tw.json
+++ b/src/locales/zh-tw.json
@@ -6540,6 +6540,10 @@
"settings.simple.looks.title": "更多外觀",
"settings.simple.looks.change": "變更",
"settings.simple.looks.back": "返回",
+ "settings.simple.more.title": "更多設定",
+ "settings.simple.more.subtitle": "備份、上限,以及不常變更的設定。",
+ "settings.simple.more.limits": "上限",
+ "settings.simple.more.open": "開啟",
"settings.simple.theme.system": "跟隨系統",
"settings.simple.language.system": "跟隨系統",
"settings.simple.language.partial": "目前只翻譯了應用程式的一部分。",
diff --git a/src/locales/zh.json b/src/locales/zh.json
index 8c45d963a6..5fbf04619a 100644
--- a/src/locales/zh.json
+++ b/src/locales/zh.json
@@ -6299,6 +6299,10 @@
"settings.simple.looks.title": "更多外观",
"settings.simple.looks.change": "更改",
"settings.simple.looks.back": "返回",
+ "settings.simple.more.title": "更多设置",
+ "settings.simple.more.subtitle": "备份、限额,以及不常更改的设置。",
+ "settings.simple.more.limits": "限额",
+ "settings.simple.more.open": "打开",
"settings.simple.theme.system": "跟随系统",
"settings.simple.language.system": "跟随系统",
"settings.simple.language.partial": "目前只有部分界面已翻译。",