Files
hermes-agent/apps/desktop/src/store/session-list-density.ts
T
Teknium 865e4e7178 fix(desktop): default session list density to compact
Keeps the sidebar byte-identical for existing users until they opt into
comfortable/detailed themselves — per the no-default-change salvage rule.
2026-08-15 00:34:57 -07:00

19 lines
726 B
TypeScript

import { type Codec, persistentAtom } from '@/lib/persisted'
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<SessionListDensity> = {
decode: raw => (raw === 'comfortable' || raw === 'detailed' ? raw : 'compact'),
encode: value => value
}
export const $sessionListDensity = persistentAtom<SessionListDensity>(STORAGE_KEY, 'compact', densityCodec)
export function setSessionListDensity(density: SessionListDensity) {
$sessionListDensity.set(density)
}