feat(floating-ai): step 3 — create double-click hook

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Roberto Musso
2026-02-27 22:49:16 +01:00
parent b4e97e14f3
commit 28a5d65f1a
3 changed files with 56 additions and 3 deletions

View File

@@ -18,6 +18,7 @@ import {
Palette
} from 'lucide-react';
import { trpc } from '@/lib/trpc';
import { useDoubleClickAI } from '@/hooks/useDoubleClickAI';
import {
Sidebar,
SidebarContent,
@@ -84,6 +85,16 @@ function findScrollableAncestor(el: Element | null): Element | null {
}
export function AppShell({ children }: AppShellProps) {
return (
<FloatingChatProvider>
<AppShellInner>{children}</AppShellInner>
</FloatingChatProvider>
);
}
function AppShellInner({ children }: AppShellProps) {
useDoubleClickAI();
const collapsedQuery = trpc.settings.getSidebarCollapsed.useQuery(undefined, {
staleTime: Infinity,
});
@@ -209,7 +220,6 @@ export function AppShell({ children }: AppShellProps) {
}, [openCurtain, closeCurtain]);
return (
<FloatingChatProvider>
<>
<SidebarProvider open={open} onOpenChange={handleOpenChange}>
<AppSidebar
@@ -301,7 +311,6 @@ export function AppShell({ children }: AppShellProps) {
</DialogContent>
</Dialog>
</>
</FloatingChatProvider>
);
}