Skip to content

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

feat: add ⌘⇧N shortcut to start a new thread with the selected bot

quang.tranminhf525f7ae2762
diff --git a/src/App.tsx b/src/App.tsx
index 4c1fef2d46..9d62166766 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -182,9 +182,14 @@ function Shell({ viewer }: { viewer: WelcomeViewer | null }) {
if (!mod) return;
const bots = shortcutBots(state.bots.filter((b) => !b.hidden), shownBotIds(document.querySelector("[data-sidebar-root]")));
const step = e.shiftKey ? botCycleStep(e) : null;
- if (e.key === "n" && !e.shiftKey) {
+ if (e.key.toLowerCase() === "n" && !e.altKey) {
e.preventDefault();
- dispatch({ type: "newBot" });
+ if (e.shiftKey) {
+ const selected = state.bots.find((bot) => bot.id === state.selectedId && !bot.hidden);
+ if (selected && selected.yourAccess !== "view") dispatch({ type: "newTask", botId: selected.id });
+ } else {
+ dispatch({ type: "newBot" });
+ }
} else if (/^[1-9]$/.test(e.key)) {
const target = bots[Number(e.key) - 1];
if (target) {
diff --git a/src/lib/keyboard-shortcuts.ts b/src/lib/keyboard-shortcuts.ts
index 14a6d729b4..f93d404854 100644
--- a/src/lib/keyboard-shortcuts.ts
+++ b/src/lib/keyboard-shortcuts.ts
@@ -30,6 +30,12 @@ export const SHORTCUT_GROUPS: readonly ShortcutGroup[] = [
macKeys: ["⌘", "N"],
winKeys: ["Ctrl", "N"],
},
+ {
+ id: "new-thread",
+ description: "Start a new thread with the selected bot",
+ macKeys: ["⌘", "⇧", "N"],
+ winKeys: ["Ctrl", "Shift", "N"],
+ },
{
id: "jump-bot",
description: "Jump to bot 1–9 in the roster",
diff --git a/src/locales/en.json b/src/locales/en.json
index eba521b983..2e1b50aa78 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -8306,6 +8306,7 @@
"shortcuts.category.groups": "Management & Groups",
"shortcuts.command-palette": "Open command palette (switcher & transcript search)",
"shortcuts.new-bot": "Create a new bot",
+ "shortcuts.new-thread": "Start a new thread with the selected bot",
"shortcuts.jump-bot": "Jump to bot 1–9 in the roster",
"shortcuts.switch-bot": "Switch to previous / next bot",
"shortcuts.find-conversation": "Find in conversation",