mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-02 12:22:40 +02:00
feat: close report panel when switching chats in NewChatPage component
This commit is contained in:
parent
30a1063a14
commit
83d7c8204b
1 changed files with 4 additions and 0 deletions
|
|
@ -40,6 +40,7 @@ import { LinkPreviewToolUI } from "@/components/tool-ui/link-preview";
|
||||||
import { ScrapeWebpageToolUI } from "@/components/tool-ui/scrape-webpage";
|
import { ScrapeWebpageToolUI } from "@/components/tool-ui/scrape-webpage";
|
||||||
import { RecallMemoryToolUI, SaveMemoryToolUI } from "@/components/tool-ui/user-memory";
|
import { RecallMemoryToolUI, SaveMemoryToolUI } from "@/components/tool-ui/user-memory";
|
||||||
import { ReportPanel } from "@/components/report-panel/report-panel";
|
import { ReportPanel } from "@/components/report-panel/report-panel";
|
||||||
|
import { closeReportPanelAtom } from "@/atoms/chat/report-panel.atom";
|
||||||
import { Skeleton } from "@/components/ui/skeleton";
|
import { Skeleton } from "@/components/ui/skeleton";
|
||||||
import { useChatSessionStateSync } from "@/hooks/use-chat-session-state";
|
import { useChatSessionStateSync } from "@/hooks/use-chat-session-state";
|
||||||
import { useMessagesElectric } from "@/hooks/use-messages-electric";
|
import { useMessagesElectric } from "@/hooks/use-messages-electric";
|
||||||
|
|
@ -161,6 +162,7 @@ export default function NewChatPage() {
|
||||||
const setCurrentThreadState = useSetAtom(currentThreadAtom);
|
const setCurrentThreadState = useSetAtom(currentThreadAtom);
|
||||||
const setTargetCommentId = useSetAtom(setTargetCommentIdAtom);
|
const setTargetCommentId = useSetAtom(setTargetCommentIdAtom);
|
||||||
const clearTargetCommentId = useSetAtom(clearTargetCommentIdAtom);
|
const clearTargetCommentId = useSetAtom(clearTargetCommentIdAtom);
|
||||||
|
const closeReportPanel = useSetAtom(closeReportPanelAtom);
|
||||||
|
|
||||||
// Get current user for author info in shared chats
|
// Get current user for author info in shared chats
|
||||||
const { data: currentUser } = useAtomValue(currentUserAtom);
|
const { data: currentUser } = useAtomValue(currentUserAtom);
|
||||||
|
|
@ -254,6 +256,7 @@ export default function NewChatPage() {
|
||||||
setMentionedDocuments([]);
|
setMentionedDocuments([]);
|
||||||
setMessageDocumentsMap({});
|
setMessageDocumentsMap({});
|
||||||
clearPlanOwnerRegistry(); // Reset plan ownership for new chat
|
clearPlanOwnerRegistry(); // Reset plan ownership for new chat
|
||||||
|
closeReportPanel(); // Close report panel when switching chats
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (urlChatId > 0) {
|
if (urlChatId > 0) {
|
||||||
|
|
@ -318,6 +321,7 @@ export default function NewChatPage() {
|
||||||
setMentionedDocumentIds,
|
setMentionedDocumentIds,
|
||||||
setMentionedDocuments,
|
setMentionedDocuments,
|
||||||
hydratePlanState,
|
hydratePlanState,
|
||||||
|
closeReportPanel,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Initialize on mount
|
// Initialize on mount
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue