Skip to content

DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.

Merge pull request #500: Guided Learning (mastery-based tutoring subsystem)

Bingxi Zhao (Frank)b2ce70db6999
diff --cc web/app/(workspace)/book/page.tsx
index ad5483848,4f68d5a54..ae6dfdadd
--- a/web/app/(workspace)/book/page.tsx
+++ b/web/app/(workspace)/book/page.tsx
@@@ -9,9 -9,8 +9,9 @@@ import
useRef,
useState,
} from "react";
- import { useSearchParams } from "next/navigation";
+ import { useSearchParams, useRouter } from "next/navigation";
import { Loader2, MessageSquare } from "lucide-react";
+import { notify } from "@/lib/notifications";
import { useTranslation } from "react-i18next";
import { bookApi, openBookSocket } from "@/lib/book-api";
diff --cc web/components/sidebar/SidebarShell.tsx
index 75970e6f3,5c3977d56..94103a4e8
--- a/web/components/sidebar/SidebarShell.tsx
+++ b/web/components/sidebar/SidebarShell.tsx
@@@ -8,10 -8,9 +8,11 @@@ import { useAppShell } from "@/context/
import {
BookOpen,
Bot,
+ BookText,
Brain,
+ ChevronDown,
Github,
+ GraduationCap,
LayoutGrid,
Library,
MessageSquare,
diff --cc web/components/sidebar/WorkspaceSidebar.tsx
index 5a9ced44e,e84ee471a..47f420e3c
--- a/web/components/sidebar/WorkspaceSidebar.tsx
+++ b/web/components/sidebar/WorkspaceSidebar.tsx
@@@ -72,6 -73,12 +73,14 @@@ export default function WorkspaceSideba
})
.map(({ session }) => session);
- const handleNewChat = () => {
++ // Cancel any in-flight streaming turn before starting a fresh session, so a
++ // new chat never inherits a still-running turn (mirrors handleDeleteSession).
++ const handleNewChat = useCallback(() => {
+ cancelStreamingTurn();
+ newSession();
+ router.push("/chat");
- };
++ }, [cancelStreamingTurn, newSession, router]);
+
const handleSelectSession = useCallback(
async (sessionId: string) => {
router.push(`/chat/${sessionId}`);