Skip to content

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

Usage and composer order: Simple-mode app_settings tests, their Settings place, and the DESIGN.md exception

milind-soni7bb9e0552b77
diff --git a/DESIGN.md b/DESIGN.md
index 69f1d040d8..efd1e6202f 100644
--- a/DESIGN.md
+++ b/DESIGN.md
@@ -61,6 +61,10 @@ where they belong instead of adding new places.
Simple mode can turn off one feature at a time without switching to
Advanced. A switch goes there only when its off state is clean: the feature
is hidden whole, and nothing the person made is lost.
+ A second, by the owner's call: two looks a bot changes when the person asks
+ (`app_settings`), in either mode. How plan usage shows beside the model (bars,
+ the default, or one ring) has a row in Appearance in Advanced mode; the order of
+ the composer's end buttons has no row. Both default to what the app drew before.
- **No new asks.** No new permission asks, approval cards, confirm dialogs,
nags or waits that interrupt the person, and no default below Full access.
A bot gets on with the work; a change that needs undoing gets **Undo**.
diff --git a/server/app-settings/host.test.ts b/server/app-settings/host.test.ts
index a787b0188c..756f3b24dc 100644
--- a/server/app-settings/host.test.ts
+++ b/server/app-settings/host.test.ts
@@ -508,6 +508,21 @@ describe("Simple mode: a bot changes settings in the background and never switch
expect((await fx.set(id, value)).status).toBe(200);
});
+ it.each([
+ ["appearance.usageIndicator", "ring", "ring"], ["appearance.composerOrder", JSON.stringify(["mic", "send"]), ["mic", "send"]],
+ ])("changes %s in Simple too, since both modes draw it, without switching modes", async (id, value, stored) => {
+ const fx = simple();
+ expect((await fx.set(id, value)).status).toBe(200);
+ expect(fx.windowValues.get(id)).toEqual(stored);
+ expect(fx.windowValues.get("appearance.advanced")).toBe(false);
+ });
+
+ it("refuses a composer order that names a button twice or one that is not there", async () => {
+ const fx = simple();
+ for (const value of [JSON.stringify(["send", "send"]), JSON.stringify(["keyboard"])]) expect((await fx.set("appearance.composerOrder", value)).status).toBe(400);
+ expect(fx.windowValues.has("appearance.composerOrder")).toBe(false);
+ });
+
it("pins pages in Simple while the window frame's bar shows them", async () => {
const fx = simple();
fx.windowValues.set("appearance.windowFrame", true);
diff --git a/server/app-settings/registry.ts b/server/app-settings/registry.ts
index a373ec3468..54807a08e6 100644
--- a/server/app-settings/registry.ts
+++ b/server/app-settings/registry.ts
@@ -168,9 +168,9 @@ export function createSettingsRegistry(deps: RegistryDeps): SettingEntry[] {
windowPref("appearance.advanced", "Advanced mode", "Advanced shows every setting and tool; Simple keeps the everyday ones. Change it only when the person asks for Simple or Advanced mode by name, never to reach another setting: those change in either mode.", "advanced-mode", ["simple mode", "advanced mode", "interface mode"], "true or false"),
windowPref("appearance.font", "Font", "The app's typeface.", "tool-calls", ["typeface", "typography"], enumOf(WINDOW_PREFS["appearance.font"].options)),
windowPref("appearance.chatWidth", "Chat width", "How wide the chat column is.", "tool-calls", ["layout", "column", "wide"], enumOf(WINDOW_PREFS["appearance.chatWidth"].options)),
- windowPref("appearance.usageIndicator", "Usage beside the model", "How a plan's usage shows beside the model: bars, or one ring for the chat's AI.", "layout", ["usage", "ring", "bars", "quota", "limits"], "bars or ring",
+ windowPref("appearance.usageIndicator", "Usage beside the model", "How a plan's usage shows beside the model: bars, or one ring for the chat's AI.", "tool-calls", ["usage", "ring", "bars", "quota", "limits"], "bars or ring",
{ says: (choice: "bars" | "ring") => (choice === "ring" ? "Show usage beside the model as one ring" : "Show usage beside the model as bars") }),
- windowPref("appearance.composerOrder", "Message box buttons order", "The order of the buttons at the end of the message box. List the ones to put first; the rest keep their order. An empty list is the usual order.", "layout",
+ windowPref("appearance.composerOrder", "Message box buttons order", "The order of the buttons at the end of the message box. List the ones to put first; the rest keep their order. An empty list is the usual order. There is no row for it in Settings: only a bot changes it, when the person asks.", "tool-calls",
["composer", "message box", "buttons", "mic", "send button", "order"], `a list of ${COMPOSER_BUTTONS.map((name) => `"${name}"`).join(", ")}, each once`,
{ says: (order: string[]) => (order.length ? `Put the message box's ${order.join(", ")} button${order.length === 1 ? "" : "s"} first, in that order` : "Put the message box's buttons back in their usual order") }),
windowPref("general.sendKey", "Send key", "Which key sends a message in the composer.", "send-key", ["enter", "typing", "keyboard", "shortcut"], enumOf(WINDOW_PREFS["general.sendKey"].options)),