From e1d25d8bf4bd634a61a11932418d355d2d8ba043 Mon Sep 17 00:00:00 2001 From: Steven Enamakel <31011319+senamakel@users.noreply.github.com> Date: Thu, 4 Jun 2026 18:58:01 -0400 Subject: [PATCH] Persist thread sidebar visibility (#3390) --- app/src/pages/Conversations.tsx | 17 ++++++++---- .../__tests__/Conversations.render.test.tsx | 26 ++++++++++++++++--- app/src/store/index.ts | 6 ++++- app/src/store/threadSlice.ts | 6 +++++ 4 files changed, 46 insertions(+), 9 deletions(-) diff --git a/app/src/pages/Conversations.tsx b/app/src/pages/Conversations.tsx index 2c203b8a5..fc741fcef 100644 --- a/app/src/pages/Conversations.tsx +++ b/app/src/pages/Conversations.tsx @@ -57,6 +57,7 @@ import { persistReaction, setActiveThread, setSelectedThread, + setThreadSidebarVisible, THREAD_NOT_FOUND_MESSAGE, updateThreadTitle, } from '../store/threadSlice'; @@ -187,10 +188,16 @@ const Conversations = ({ const dispatch = useAppDispatch(); const navigate = useNavigate(); const location = useLocation(); - const { threads, selectedThreadId, messages, isLoadingMessages, messagesError, activeThreadId } = - useAppSelector(state => state.thread); + const { + threads, + selectedThreadId, + threadSidebarVisible = false, + messages, + isLoadingMessages, + messagesError, + activeThreadId, + } = useAppSelector(state => state.thread); - const [showSidebar, setShowSidebar] = useState(false); const [inputValue, setInputValue] = useState(''); const [attachments, setAttachments] = useState([]); const fileInputRef = useRef(null); @@ -1224,7 +1231,7 @@ const Conversations = ({ labelTabs.find(tab => tab.value === selectedLabel)?.label ?? selectedLabel; const isSidebar = variant === 'sidebar'; - const effectiveShowSidebar = showSidebar; + const effectiveShowSidebar = threadSidebarVisible; // Stable title resolver used by both the sidebar thread list and the header. const resolveThreadDisplayTitle = (threadId: string | null): string => { @@ -1405,7 +1412,7 @@ const Conversations = ({