From c95a4dbff8a1a41c4c7626ef709fcde9eff156c1 Mon Sep 17 00:00:00 2001 From: aristachauhan Date: Mon, 2 Feb 2026 16:52:06 +0000 Subject: [PATCH 1/6] button navigation fix --- web/src/components/layout/collapsibleSidebar.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/src/components/layout/collapsibleSidebar.tsx b/web/src/components/layout/collapsibleSidebar.tsx index 90fb33a3..a4b088de 100644 --- a/web/src/components/layout/collapsibleSidebar.tsx +++ b/web/src/components/layout/collapsibleSidebar.tsx @@ -66,9 +66,10 @@ const CollapsibleSidebarComponent: React.FC = ({ {!hideNewChatButton && ( { - if (!isLargeScreen) { - closeSidebar(); + onClick={(e) => { + if (window.location.pathname === newChatUrl) { + e.preventDefault(); + window.location.assign(newChatUrl); } }} href={newChatUrl} From 5880ae53361fe423d9eae8f618bac246529e4a50 Mon Sep 17 00:00:00 2001 From: aristachauhan Date: Mon, 2 Feb 2026 21:02:33 +0000 Subject: [PATCH 2/6] changed conditional + removed default --- web/src/components/layout/collapsibleSidebar.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/src/components/layout/collapsibleSidebar.tsx b/web/src/components/layout/collapsibleSidebar.tsx index a4b088de..bfd0d293 100644 --- a/web/src/components/layout/collapsibleSidebar.tsx +++ b/web/src/components/layout/collapsibleSidebar.tsx @@ -66,10 +66,11 @@ const CollapsibleSidebarComponent: React.FC = ({ {!hideNewChatButton && ( { + onClick={() => { if (window.location.pathname === newChatUrl) { - e.preventDefault(); window.location.assign(newChatUrl); + } else if (!isLargeScreen) { + closeSidebar(); } }} href={newChatUrl} From 54b144e86374707d1d606468861eb250bbd68e11 Mon Sep 17 00:00:00 2001 From: aristachauhan Date: Mon, 2 Feb 2026 23:46:27 +0000 Subject: [PATCH 3/6] comment --- web/src/components/layout/collapsibleSidebar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/layout/collapsibleSidebar.tsx b/web/src/components/layout/collapsibleSidebar.tsx index bfd0d293..5e1b679d 100644 --- a/web/src/components/layout/collapsibleSidebar.tsx +++ b/web/src/components/layout/collapsibleSidebar.tsx @@ -68,7 +68,7 @@ const CollapsibleSidebarComponent: React.FC = ({ className='btn btn-icon btn-lg btn-link' onClick={() => { if (window.location.pathname === newChatUrl) { - window.location.assign(newChatUrl); + window.location.assign(newChatUrl); // next navigation prevents reloading the same page } else if (!isLargeScreen) { closeSidebar(); } From 492e9ee5eaa22ad8a1145e9d091f86256af21e50 Mon Sep 17 00:00:00 2001 From: aristachauhan Date: Wed, 4 Feb 2026 22:44:50 +0000 Subject: [PATCH 4/6] url updates now --- web/src/components/chat/main.tsx | 4 ++-- web/src/components/layout/collapsibleSidebar.tsx | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/web/src/components/chat/main.tsx b/web/src/components/chat/main.tsx index 5f0db42f..82ad60d8 100644 --- a/web/src/components/chat/main.tsx +++ b/web/src/components/chat/main.tsx @@ -25,12 +25,12 @@ const MainContent = () => { React.useEffect(() => { if ( // on first response from AI - pathname === '/chat/new' && + pathname === `/${aiState.group}/chat/new` && aiState.id !== '' // id is set only once the chat has been saved to the db ) { // reloads the sidebar, which repulls from the db now that the chat has been saved router.refresh(); - window.history.pushState({}, '', `/chat/${aiState.id}`); + window.history.pushState({}, '', `/ucdavis/chat/${aiState.id}`); // change to group } }, [aiState.messages, router, aiState.id, pathname]); diff --git a/web/src/components/layout/collapsibleSidebar.tsx b/web/src/components/layout/collapsibleSidebar.tsx index 5e1b679d..90fb33a3 100644 --- a/web/src/components/layout/collapsibleSidebar.tsx +++ b/web/src/components/layout/collapsibleSidebar.tsx @@ -67,9 +67,7 @@ const CollapsibleSidebarComponent: React.FC = ({ { - if (window.location.pathname === newChatUrl) { - window.location.assign(newChatUrl); // next navigation prevents reloading the same page - } else if (!isLargeScreen) { + if (!isLargeScreen) { closeSidebar(); } }} From 87aa7faffbcebfec3f457fdda83bf1dd78cf6b91 Mon Sep 17 00:00:00 2001 From: aristachauhan Date: Thu, 19 Feb 2026 00:04:07 +0000 Subject: [PATCH 5/6] changed order of reloads --- web/src/components/chat/main.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/chat/main.tsx b/web/src/components/chat/main.tsx index 82ad60d8..1632a213 100644 --- a/web/src/components/chat/main.tsx +++ b/web/src/components/chat/main.tsx @@ -29,8 +29,8 @@ const MainContent = () => { aiState.id !== '' // id is set only once the chat has been saved to the db ) { // reloads the sidebar, which repulls from the db now that the chat has been saved + router.push(`/${aiState.group}/chat/${aiState.id}`); router.refresh(); - window.history.pushState({}, '', `/ucdavis/chat/${aiState.id}`); // change to group } }, [aiState.messages, router, aiState.id, pathname]); From 95c62944f0743d748c8485ab40317f4361bfd663 Mon Sep 17 00:00:00 2001 From: aristachauhan Date: Thu, 19 Feb 2026 00:15:05 +0000 Subject: [PATCH 6/6] change to replace --- web/src/components/chat/main.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/chat/main.tsx b/web/src/components/chat/main.tsx index 1632a213..152bcbe8 100644 --- a/web/src/components/chat/main.tsx +++ b/web/src/components/chat/main.tsx @@ -29,7 +29,7 @@ const MainContent = () => { aiState.id !== '' // id is set only once the chat has been saved to the db ) { // reloads the sidebar, which repulls from the db now that the chat has been saved - router.push(`/${aiState.group}/chat/${aiState.id}`); + router.replace(`/${aiState.group}/chat/${aiState.id}`); router.refresh(); } }, [aiState.messages, router, aiState.id, pathname]);