From 865e4e71787f8d02e58b87d70fe4920bce92555b Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Fri, 14 Aug 2026 23:20:04 -0700 Subject: [PATCH] fix(desktop): default session list density to compact MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keeps the sidebar byte-identical for existing users until they opt into comfortable/detailed themselves — per the no-default-change salvage rule. --- apps/desktop/src/store/session-list-density.test.ts | 8 ++++---- apps/desktop/src/store/session-list-density.ts | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/desktop/src/store/session-list-density.test.ts b/apps/desktop/src/store/session-list-density.test.ts index 0a1107dea4..bde020789a 100644 --- a/apps/desktop/src/store/session-list-density.test.ts +++ b/apps/desktop/src/store/session-list-density.test.ts @@ -11,10 +11,10 @@ describe('session list density preference', () => { window.localStorage.clear() }) - it('defaults to comfortable and persists changes', async () => { + it('defaults to compact (pre-density behavior) and persists changes', async () => { const first = await loadStore() - expect(first.$sessionListDensity.get()).toBe('comfortable') + expect(first.$sessionListDensity.get()).toBe('compact') first.setSessionListDensity('detailed') @@ -22,9 +22,9 @@ describe('session list density preference', () => { expect((await loadStore()).$sessionListDensity.get()).toBe('detailed') }) - it('falls back to comfortable for an unknown stored value', async () => { + it('falls back to compact for an unknown stored value', async () => { window.localStorage.setItem('hermes.desktop.sessionListDensity', 'tiny') - expect((await loadStore()).$sessionListDensity.get()).toBe('comfortable') + expect((await loadStore()).$sessionListDensity.get()).toBe('compact') }) }) diff --git a/apps/desktop/src/store/session-list-density.ts b/apps/desktop/src/store/session-list-density.ts index 5a703d390b..a2d0b355a4 100644 --- a/apps/desktop/src/store/session-list-density.ts +++ b/apps/desktop/src/store/session-list-density.ts @@ -4,12 +4,14 @@ export type SessionListDensity = 'compact' | 'comfortable' | 'detailed' const STORAGE_KEY = 'hermes.desktop.sessionListDensity' +// Compact is the pre-density row exactly as it shipped, so existing users see +// no change until they opt into a denser-information mode themselves (#68119). const densityCodec: Codec = { - decode: raw => (raw === 'compact' || raw === 'detailed' ? raw : 'comfortable'), + decode: raw => (raw === 'comfortable' || raw === 'detailed' ? raw : 'compact'), encode: value => value } -export const $sessionListDensity = persistentAtom(STORAGE_KEY, 'comfortable', densityCodec) +export const $sessionListDensity = persistentAtom(STORAGE_KEY, 'compact', densityCodec) export function setSessionListDensity(density: SessionListDensity) { $sessionListDensity.set(density)