From d930ab2fb3502a5704e0e1c7f86c9881ec02329d Mon Sep 17 00:00:00 2001 From: shatfield4 Date: Fri, 24 Apr 2026 17:03:33 -0700 Subject: [PATCH] fix: white flash when switching between workspaces --- .../Sidebar/ActiveWorkspaces/index.jsx | 13 +++++++---- .../components/Sidebar/SearchBox/index.jsx | 1 - frontend/src/pages/WorkspaceChat/index.jsx | 23 ++++++++++--------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx b/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx index a19ad063f..1050a21ae 100644 --- a/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx +++ b/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx @@ -6,7 +6,7 @@ import ManageWorkspace, { useManageWorkspaceModal, } from "../../Modals/ManageWorkspace"; import paths from "@/utils/paths"; -import { useParams, useNavigate, useMatch } from "react-router-dom"; +import { Link, useParams, useNavigate, useMatch } from "react-router-dom"; import { GearSix, UploadSimple, DotsSixVertical } from "@phosphor-icons/react"; import useUser from "@/hooks/useUser"; import ThreadContainer from "./ThreadContainer"; @@ -117,12 +117,15 @@ export default function ActiveWorkspaces() { role="listitem" >
- { + if (isActive) e.preventDefault(); + }} aria-current={isActive ? "page" : ""} className={` transition-all duration-[200ms] @@ -208,7 +211,7 @@ export default function ActiveWorkspaces() {
)} - + {isActive && ( window.dispatchEvent(new Event(SEARCH_RESULT_SELECTED))} className="hover:bg-[#FFF]/10 light:hover:bg-[#000]/10 transition-all duration-300 rounded-sm px-[8px] py-[2px]" > diff --git a/frontend/src/pages/WorkspaceChat/index.jsx b/frontend/src/pages/WorkspaceChat/index.jsx index a94d67b0d..b77c3474b 100644 --- a/frontend/src/pages/WorkspaceChat/index.jsx +++ b/frontend/src/pages/WorkspaceChat/index.jsx @@ -9,6 +9,7 @@ import { FullScreenLoader } from "@/components/Preloader"; import { LAST_VISITED_WORKSPACE } from "@/utils/constants"; export default function WorkspaceChat() { + const { slug } = useParams(); const { loading, requiresAuth, mode } = usePasswordModal(); if (loading) return ; @@ -16,7 +17,12 @@ export default function WorkspaceChat() { return <>{requiresAuth !== null && }; } - return ; + return ( +
+ {!isMobile && } + +
+ ); } function ShowWorkspaceChat() { @@ -52,15 +58,10 @@ function ShowWorkspaceChat() { }, []); return ( - <> -
- {!isMobile && } - -
- + ); }