diff --git a/src/components/workspace-canvas/SidebarQuickActions.tsx b/src/components/workspace-canvas/SidebarQuickActions.tsx index f21aa315..f60e941d 100644 --- a/src/components/workspace-canvas/SidebarQuickActions.tsx +++ b/src/components/workspace-canvas/SidebarQuickActions.tsx @@ -18,6 +18,7 @@ import { useRef, useState, useCallback } from "react"; import { toast } from "sonner"; import type { PdfData } from "@/lib/workspace-state/types"; import { CreateYouTubeDialog } from "@/components/modals/CreateYouTubeDialog"; +import { focusComposerInput } from "@/lib/utils/composer-utils"; interface SidebarQuickActionsProps { currentWorkspaceId: string; @@ -91,8 +92,19 @@ export function SidebarQuickActions({ currentWorkspaceId, isChatExpanded, setIsC }, [api, isChatExpanded, setIsChatExpanded, setSelectedActions]); const handleQuizClick = useCallback(() => { - toast.info("Quizzes coming soon!"); - }, []); + // Open chat if closed + if (setIsChatExpanded && !isChatExpanded) { + setIsChatExpanded(true); + } + + // Fill composer with quiz creation prompt + api.composer().setText("Create a quiz about "); + + // Focus the composer input + focusComposerInput(); + + toast.success("Quiz creation started"); + }, [api, isChatExpanded, setIsChatExpanded]); // PDF Upload Logic (Adapted from WorkspaceSection/BottomActionBar) const handlePDFUpload = async (event: React.ChangeEvent) => { diff --git a/src/components/workspace-canvas/WorkspaceHeader.tsx b/src/components/workspace-canvas/WorkspaceHeader.tsx index 1f331ccb..dacf2d21 100644 --- a/src/components/workspace-canvas/WorkspaceHeader.tsx +++ b/src/components/workspace-canvas/WorkspaceHeader.tsx @@ -1,6 +1,8 @@ import type React from "react"; import { useState, useRef, useEffect, useCallback } from "react"; -import { Search, X, ChevronRight, ChevronDown, FolderOpen, ChevronLeft, Plus, Upload, Layers, FileText, Folder, Settings, Share2, Play, MoreHorizontal, Globe } from "lucide-react"; +import { Search, X, ChevronRight, ChevronDown, FolderOpen, ChevronLeft, Plus, Upload, Layers, FileText, Folder, Settings, Share2, Play, MoreHorizontal, Globe, Brain } from "lucide-react"; +import { LuBook } from "react-icons/lu"; +import { PiCardsThreeFill } from "react-icons/pi"; import { cn } from "@/lib/utils"; import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; import { SidebarTrigger } from "@/components/ui/sidebar"; @@ -10,6 +12,7 @@ import ChatFloatingButton from "@/components/chat/ChatFloatingButton"; import { useUIStore } from "@/lib/stores/ui-store"; import { IconRenderer } from "@/hooks/use-icon-picker"; import { useAssistantApi } from "@assistant-ui/react"; +import { focusComposerInput } from "@/lib/utils/composer-utils"; import { DropdownMenu, DropdownMenuContent, @@ -654,8 +657,8 @@ export default function WorkspaceHeader({ - - Other + + Learn - + Flashcards + { + // Open chat if closed + if (setIsChatExpanded && !isChatExpanded) { + setIsChatExpanded(true); + } + // Fill composer with quiz creation prompt + api?.composer().setText("Create a quiz about "); + // Focus the composer input + focusComposerInput(); + toast.success("Quiz creation started"); + }} + className="flex items-center gap-2 cursor-pointer" + > + + Quiz + + + + + + + Other + + { setShowYouTubeDialog(true); diff --git a/src/components/workspace-canvas/WorkspaceSection.tsx b/src/components/workspace-canvas/WorkspaceSection.tsx index 16a59586..d1d8deb4 100644 --- a/src/components/workspace-canvas/WorkspaceSection.tsx +++ b/src/components/workspace-canvas/WorkspaceSection.tsx @@ -33,7 +33,9 @@ import { ContextMenuSubTrigger, } from "@/components/ui/context-menu"; -import { FileText, Layers, Folder, Upload, Play, Plus, MoreHorizontal, Globe } from "lucide-react"; +import { FileText, Layers, Folder, Upload, Play, Plus, MoreHorizontal, Globe, Brain } from "lucide-react"; +import { LuBook } from "react-icons/lu"; +import { PiCardsThreeFill } from "react-icons/pi"; import WorkspaceSettingsModal from "@/components/workspace/WorkspaceSettingsModal"; import ShareWorkspaceDialog from "@/components/workspace/ShareWorkspaceDialog"; import { CreateYouTubeDialog } from "@/components/modals/CreateYouTubeDialog"; @@ -42,6 +44,7 @@ import type { WorkspaceWithState } from "@/lib/workspace-state/types"; import { ItemOpenPrompt } from "./ItemOpenPrompt"; import { createPortal } from "react-dom"; import { useAssistantApi } from "@assistant-ui/react"; +import { focusComposerInput } from "@/lib/utils/composer-utils"; interface WorkspaceSectionProps { // Loading states @@ -558,8 +561,8 @@ export function WorkspaceSection({ - - Other + + Learn - + Flashcards + { + // Open chat if closed + if (setIsChatExpanded && !isChatExpanded && isDesktop) { + setIsChatExpanded(true); + } + // Fill composer with quiz creation prompt + api.composer().setText("Create a quiz about "); + // Focus the composer input + focusComposerInput(); + toast.success("Quiz creation started"); + }} + className="flex items-center gap-2 cursor-pointer" + > + + Quiz + + + + + + + Other + + setShowYouTubeDialog(true)} className="flex items-center gap-2 cursor-pointer"