feat: improve session sidebar archive and pagination controls

Add a toggle for displaying archived sessions in the sidebar menu
Load more sessions in smaller increments
Reset expanded session counts when collapsing groups or projects
This commit is contained in:
Bohdan Triapitsyn
2026-06-02 13:25:28 +03:00
parent 6a88cd09cc
commit 2f3d5107e8
12 changed files with 99 additions and 31 deletions
@@ -6,9 +6,12 @@ export type SessionDisplayMode = 'default' | 'minimal';
type SessionDisplayStore = {
displayMode: SessionDisplayMode;
showRecentSection: boolean;
showArchivedSessions: boolean;
setDisplayMode: (mode: SessionDisplayMode) => void;
setShowRecentSection: (show: boolean) => void;
setShowArchivedSessions: (show: boolean) => void;
toggleRecentSection: () => void;
toggleArchivedSessions: () => void;
};
export const useSessionDisplayStore = create<SessionDisplayStore>()(
@@ -16,9 +19,12 @@ export const useSessionDisplayStore = create<SessionDisplayStore>()(
(set) => ({
displayMode: 'default',
showRecentSection: true,
showArchivedSessions: true,
setDisplayMode: (mode) => set({ displayMode: mode }),
setShowRecentSection: (show) => set({ showRecentSection: show }),
setShowArchivedSessions: (show) => set({ showArchivedSessions: show }),
toggleRecentSection: () => set((state) => ({ showRecentSection: !state.showRecentSection })),
toggleArchivedSessions: () => set((state) => ({ showArchivedSessions: !state.showArchivedSessions })),
}),
{
name: 'session-display-mode',