Skip to content

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

Name Ctrl + Alt for push to talk off the Mac

aivsomkar63228c789930
diff --git a/src/components/CallView.availability.test.ts b/src/components/CallView.availability.test.ts
index b872016378..6bfab4ab94 100644
--- a/src/components/CallView.availability.test.ts
+++ b/src/components/CallView.availability.test.ts
@@ -70,7 +70,7 @@ describe("call capability guidance", () => {
}, "other"), false, false);
expect(help).toEqual({
label: "Calls where you take turns need the desktop app",
- reason: "They listen from this computer, so they need the MausBot app on a Mac, Windows or Linux computer.",
+ reason: "They listen from this computer, so they need MausBot on a Mac, Windows or Linux computer.",
});
});
diff --git a/src/components/CallView.mode-menu.test.ts b/src/components/CallView.mode-menu.test.ts
index 3b78095a59..52646b3dae 100644
--- a/src/components/CallView.mode-menu.test.ts
+++ b/src/components/CallView.mode-menu.test.ts
@@ -205,14 +205,14 @@ describe("the call mode menu", () => {
it("shows Take turns disabled with its reason where this page can't take turns", () => {
const turnsUnavailable = {
label: "Calls where you take turns need the desktop app",
- reason: "They listen from this computer, so they need the MausBot app on a Mac, Windows or Linux computer.",
+ reason: "They listen from this computer, so they need MausBot on a Mac, Windows or Linux computer.",
};
const markup = renderToStaticMarkup(createElement(CallModeMenu, { id: "m", mode: "live", turnsUnavailable, onChoose: vi.fn(), onClose: vi.fn() }));
const [turns, live] = markup.split('role="menuitemradio"').slice(1);
expect(turns).toMatch(/^ aria-checked="false" aria-disabled="true"/);
expect(turns).not.toContain('disabled=""');
expect(turns).toContain(">Take turns<");
- expect(turns).toContain("Calls where you take turns need the desktop app. They listen from this computer, so they need the MausBot app on a Mac, Windows or Linux computer.");
+ expect(turns).toContain("Calls where you take turns need the desktop app. They listen from this computer, so they need MausBot on a Mac, Windows or Linux computer.");
expect(turns).not.toContain("Listening stays on this computer");
expect(live).toMatch(/^ aria-checked="true"/);
expect(live).not.toMatch(/aria-disabled="true"|disabled=""/);
diff --git a/src/components/CallView.tsx b/src/components/CallView.tsx
index 17f4c240b6..87ba324a7a 100644
--- a/src/components/CallView.tsx
+++ b/src/components/CallView.tsx
@@ -16,7 +16,7 @@ import { t } from "@/lib/i18n";
import { speaker } from "@/lib/tts";
import { localSystemVoiceActive } from "@/lib/local-voice";
import { useSpeech } from "@/lib/tts/useSpeech";
-import { usePushToTalk } from "@/lib/push-to-talk";
+import { pushToTalkKeys, usePushToTalk } from "@/lib/push-to-talk";
import { BotAvatar } from "./Avatar";
import { navigateThreadMenu } from "./BotProjects";
import { LiveKeyNeeded } from "./LiveKeyNeeded";
@@ -799,7 +799,7 @@ function Call({ bot }: { bot: Bot }) {
{phase === "listening" ? (
heard || (
<span className="text-ink-secondary">
- {pushToTalk ? "Release Control + Option to send…" : "Say something…"}
+ {pushToTalk ? `Release ${pushToTalkKeys()} to send…` : "Say something…"}
</span>
)
) : (
@@ -842,7 +842,7 @@ function Call({ bot }: { bot: Bot }) {
</div>
<div className="text-[12px] text-ink-tertiary">
- Hold Control + Option to talk · Space interrupts · Esc hangs up
+ Hold {pushToTalkKeys()} to talk · Space interrupts · Esc hangs up
</div>
</>
);
diff --git a/src/components/GroupCallView.tsx b/src/components/GroupCallView.tsx
index f112b6554b..ac032042ee 100644
--- a/src/components/GroupCallView.tsx
+++ b/src/components/GroupCallView.tsx
@@ -9,7 +9,7 @@ import { track } from "@/lib/analytics";
import { normalizeState } from "@/lib/mascot";
import { speaker } from "@/lib/tts";
import { useSpeech } from "@/lib/tts/useSpeech";
-import { usePushToTalk } from "@/lib/push-to-talk";
+import { pushToTalkKeys, usePushToTalk } from "@/lib/push-to-talk";
import { useStore, type Bot, type Group, type Message } from "@/state/store";
import { cn } from "@/lib/cn";
import { BotAvatar } from "./Avatar";
@@ -527,7 +527,7 @@ function GroupCall({ group, members }: { group: Group; members: Bot[] }) {
heard || (
<span className="text-ink-secondary">
{pushToTalk
- ? "Release Control + Option to send…"
+ ? `Release ${pushToTalkKeys()} to send…`
: "Say a name, say “everyone,” or just talk to the group…"}
</span>
)
@@ -569,7 +569,7 @@ function GroupCall({ group, members }: { group: Group; members: Bot[] }) {
</div>
<div className="text-[12px] text-ink-tertiary">
- Hold Control + Option to talk · Say a member’s name to direct the turn · Space interrupts · Esc hangs up
+ Hold {pushToTalkKeys()} to talk · Say a member’s name to direct the turn · Space interrupts · Esc hangs up
</div>
</div>
);
diff --git a/src/lib/push-to-talk.ts b/src/lib/push-to-talk.ts
index e56e89869c..f04aeeeac9 100644
--- a/src/lib/push-to-talk.ts
+++ b/src/lib/push-to-talk.ts
@@ -1,10 +1,13 @@
import { useEffect, useRef, useState } from "react";
import { currentCall } from "./call";
+import { isMacPlatform } from "./keyboard-shortcuts";
import { speechBridge } from "./speech";
type ModifierEvent = Pick<KeyboardEvent, "altKey" | "ctrlKey" | "code" | "repeat">;
+export const pushToTalkKeys = () => (isMacPlatform() ? "Control + Option" : "Ctrl + Alt");
+
export function isPushToTalkPress(event: ModifierEvent): boolean {
const modifier =
event.code === "AltLeft" ||