diff --git a/packages/ui/src/stores/useSessionTabsStore.test.ts b/packages/ui/src/stores/useSessionTabsStore.test.ts index 5df0aa31..83bec001 100644 --- a/packages/ui/src/stores/useSessionTabsStore.test.ts +++ b/packages/ui/src/stores/useSessionTabsStore.test.ts @@ -32,11 +32,11 @@ describe('useSessionTabsStore', () => { expect(useSessionTabsStore.getState().tabIds).toBe(before); }); - test('caps the working set at 20, evicting the oldest tab', () => { - useSessionTabsStore.setState({ tabIds: Array.from({ length: 20 }, (_, i) => `s${i}`) }); + test('caps the working set at 10, evicting the oldest tab', () => { + useSessionTabsStore.setState({ tabIds: Array.from({ length: 10 }, (_, i) => `s${i}`) }); useSessionTabsStore.getState().ensureTab('s-new'); const ids = useSessionTabsStore.getState().tabIds; - expect(ids).toHaveLength(20); + expect(ids).toHaveLength(10); expect(ids[0]).toBe('s1'); expect(ids.at(-1)).toBe('s-new'); }); diff --git a/packages/ui/src/stores/useSessionTabsStore.ts b/packages/ui/src/stores/useSessionTabsStore.ts index 7c1219ac..2412a960 100644 --- a/packages/ui/src/stores/useSessionTabsStore.ts +++ b/packages/ui/src/stores/useSessionTabsStore.ts @@ -24,7 +24,7 @@ interface SessionTabsStore { removeTabs: (sessionIds: readonly string[]) => void; } -const MAX_SESSION_TABS = 20; +const MAX_SESSION_TABS = 10; type PersistedSessionTabs = { tabIds: string[] };