From bf22156664dc59ab00cecbb6d8dfacc1b89f8c0e Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Thu, 25 Dec 2025 12:18:45 +0530 Subject: [PATCH] refactor: update navigation and chat initialization logic - Changed navigation from researcher to new-chat in EditorPage. - Updated NewChatPage to support lazy thread creation on first message. - Adjusted breadcrumb to not display thread ID for new-chat sections. - Improved user experience by modifying error messages and loading states. - Enhanced styling in model-selector component for better visibility. --- .../editor/[documentId]/page.tsx | 8 +-- .../new-chat/[[...chat_id]]/page.tsx | 54 ++++++++++++------- .../components/assistant-ui/thread.tsx | 19 ++++--- .../components/dashboard-breadcrumb.tsx | 5 +- .../components/new-chat/model-selector.tsx | 2 +- 5 files changed, 53 insertions(+), 35 deletions(-) diff --git a/surfsense_web/app/dashboard/[search_space_id]/editor/[documentId]/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/editor/[documentId]/page.tsx index 8fc2fb825..235420fcb 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/editor/[documentId]/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/editor/[documentId]/page.tsx @@ -323,7 +323,7 @@ export default function EditorPage() { if (hasUnsavedChanges) { setShowUnsavedDialog(true); } else { - router.push(`/dashboard/${searchSpaceId}/researcher`); + router.push(`/dashboard/${searchSpaceId}/new-chat`); } }; @@ -333,12 +333,12 @@ export default function EditorPage() { setGlobalHasUnsavedChanges(false); setHasUnsavedChanges(false); - // If there's a pending navigation (from sidebar), use that; otherwise go back to researcher + // If there's a pending navigation (from sidebar), use that; otherwise go back to chat if (pendingNavigation) { router.push(pendingNavigation); setPendingNavigation(null); } else { - router.push(`/dashboard/${searchSpaceId}/researcher`); + router.push(`/dashboard/${searchSpaceId}/new-chat`); } }; @@ -379,7 +379,7 @@ export default function EditorPage() {