fix: unblock concurrent threads and workspace hydration (#1839)

* fix: unblock concurrent threads and workspace hydration

* fix: restore async title generation

* fix: address PR review feedback

* style: format lead agent prompt
This commit is contained in:
DanielWalnut
2026-04-04 21:19:35 +08:00
committed by GitHub
parent 1c0051c1db
commit 2a150f5d4a
16 changed files with 213 additions and 199 deletions
@@ -6,7 +6,7 @@ import {
SettingsIcon,
} from "lucide-react";
import { useRouter } from "next/navigation";
import { useCallback, useMemo, useState } from "react";
import { useCallback, useEffect, useMemo, useState } from "react";
import {
CommandDialog,
@@ -32,10 +32,15 @@ import { SettingsDialog } from "./settings";
export function CommandPalette() {
const { t } = useI18n();
const router = useRouter();
const [mounted, setMounted] = useState(false);
const [open, setOpen] = useState(false);
const [shortcutsOpen, setShortcutsOpen] = useState(false);
const [settingsOpen, setSettingsOpen] = useState(false);
useEffect(() => {
setMounted(true);
}, []);
const handleNewChat = useCallback(() => {
router.push("/workspace/chats/new");
setOpen(false);
@@ -63,11 +68,14 @@ export function CommandPalette() {
useGlobalShortcuts(shortcuts);
const isMac =
typeof navigator !== "undefined" && navigator.userAgent.includes("Mac");
const isMac = mounted && navigator.userAgent.includes("Mac");
const metaKey = isMac ? "⌘" : "Ctrl+";
const shiftKey = isMac ? "⇧" : "Shift+";
if (!mounted) {
return null;
}
return (
<>
<SettingsDialog open={settingsOpen} onOpenChange={setSettingsOpen} />