@@ -502,7 +502,8 @@ export function useSettingsRestore(onRestored?: () => void) {
502502 ...( theme !== "system" ? [ "Theme" ] : [ ] ) ,
503503 ...( ! followSystem ? [ "Follow system" ] : [ ] ) ,
504504 ...( themeHalves !== null ? [ "Theme mix" ] : [ ] ) ,
505- ...( settings . compactSidebarEnabled !== DEFAULT_UNIFIED_SETTINGS . compactSidebarEnabled
505+ ...( settings . compactSidebarEnabled !== DEFAULT_UNIFIED_SETTINGS . compactSidebarEnabled ||
506+ settings . sidebarCompactThreadRows !== DEFAULT_UNIFIED_SETTINGS . sidebarCompactThreadRows
506507 ? [ "Compact sidebar" ]
507508 : [ ] ) ,
508509 ...( settings . appearanceContrast !== DEFAULT_UNIFIED_SETTINGS . appearanceContrast
@@ -644,6 +645,7 @@ export function useSettingsRestore(onRestored?: () => void) {
644645 settings . continueThreadsAfterServerUpdate ,
645646 settings . sidebarAutoSettleAfterDays ,
646647 settings . sidebarAutoSettleOnMerge ,
648+ settings . sidebarCompactThreadRows ,
647649 settings . sidebarProjectGroupingMode ,
648650 settings . sidebarThreadPreviewCount ,
649651 settings . showSkillsInSlashMenu ,
@@ -739,6 +741,7 @@ export function useSettingsRestore(onRestored?: () => void) {
739741 panelAnimationDurationMs : DEFAULT_UNIFIED_SETTINGS . panelAnimationDurationMs ,
740742 sidebarThreadPreviewCount : DEFAULT_UNIFIED_SETTINGS . sidebarThreadPreviewCount ,
741743 sidebarProjectGroupingMode : DEFAULT_UNIFIED_SETTINGS . sidebarProjectGroupingMode ,
744+ sidebarCompactThreadRows : DEFAULT_UNIFIED_SETTINGS . sidebarCompactThreadRows ,
742745 sidebarAutoSettleAfterDays : DEFAULT_UNIFIED_SETTINGS . sidebarAutoSettleAfterDays ,
743746 sidebarAutoSettleOnMerge : DEFAULT_UNIFIED_SETTINGS . sidebarAutoSettleOnMerge ,
744747 enableLegacyTokenStreaming : DEFAULT_UNIFIED_SETTINGS . enableLegacyTokenStreaming ,
@@ -1081,6 +1084,19 @@ export function AppearanceSettingsPanel() {
10811084 const [ isImportThemeOpen , setIsImportThemeOpen ] = useState ( false ) ;
10821085 const settings = useScopedSettings ( ) ;
10831086 const updateSettings = useUpdateScopedSettings ( ) ;
1087+ const compactSidebarMode = settings . compactSidebarEnabled
1088+ ? settings . sidebarCompactThreadRows
1089+ ? "both"
1090+ : "rail"
1091+ : settings . sidebarCompactThreadRows
1092+ ? "threads"
1093+ : "off" ;
1094+ const compactSidebarModes = {
1095+ off : "Off" ,
1096+ rail : "Rail only" ,
1097+ threads : "Threads only" ,
1098+ both : "Both" ,
1099+ } ;
10841100 const environmentStageLabel = useEnvironmentStageLabel ( ) ;
10851101 const showEnvironmentIdentification =
10861102 resolveEnvironmentIdentificationPillLabel ( environmentStageLabel ) !== null ;
@@ -1370,19 +1386,56 @@ export function AppearanceSettingsPanel() {
13701386 < SettingsSection id = "appearance-sidebar" title = "Sidebar" >
13711387 < SettingsRow
13721388 { ...searchableSetting ( "compact-sidebar" ) }
1373- description = "Keep an icon rail when the sidebar is collapsed. Click the preview to try it."
1389+ description = "Choose a collapsed icon rail, denser thread rows, or both. Click the preview to collapse or expand."
1390+ resetAction = {
1391+ settings . compactSidebarEnabled !== DEFAULT_UNIFIED_SETTINGS . compactSidebarEnabled ||
1392+ settings . sidebarCompactThreadRows !==
1393+ DEFAULT_UNIFIED_SETTINGS . sidebarCompactThreadRows ? (
1394+ < SettingResetButton
1395+ label = "compact sidebar"
1396+ onClick = { ( ) =>
1397+ updateSettings ( {
1398+ compactSidebarEnabled : DEFAULT_UNIFIED_SETTINGS . compactSidebarEnabled ,
1399+ sidebarCompactThreadRows : DEFAULT_UNIFIED_SETTINGS . sidebarCompactThreadRows ,
1400+ } )
1401+ }
1402+ />
1403+ ) : null
1404+ }
13741405 control = {
1375- < div className = "grid w-full grid-cols-[5rem_auto] items-center justify-end gap-3 sm:w-auto sm:grid-cols-[7rem_auto] sm:gap-4" >
1376- < CompactSidebarPreview />
1377- < div className = "flex justify-end" >
1378- < Switch
1379- checked = { settings . compactSidebarEnabled }
1380- onCheckedChange = { ( checked ) =>
1381- updateSettings ( { compactSidebarEnabled : Boolean ( checked ) } )
1382- }
1383- aria-label = "Compact sidebar"
1384- />
1385- </ div >
1406+ < div className = "grid w-full grid-cols-[5rem_1fr] items-center gap-3 sm:w-auto sm:grid-cols-[7rem_10rem] sm:gap-4" >
1407+ < CompactSidebarPreview
1408+ key = { compactSidebarMode }
1409+ railEnabled = { settings . compactSidebarEnabled }
1410+ compactRows = { settings . sidebarCompactThreadRows }
1411+ />
1412+ < Select
1413+ value = { compactSidebarMode }
1414+ onValueChange = { ( value ) => {
1415+ if (
1416+ value !== "off" &&
1417+ value !== "rail" &&
1418+ value !== "threads" &&
1419+ value !== "both"
1420+ )
1421+ return ;
1422+ updateSettings ( {
1423+ compactSidebarEnabled : value === "rail" || value === "both" ,
1424+ sidebarCompactThreadRows : value === "threads" || value === "both" ,
1425+ } ) ;
1426+ } }
1427+ >
1428+ < SelectTrigger size = "sm" className = "w-full" aria-label = "Compact sidebar" >
1429+ < SelectValue > { compactSidebarModes [ compactSidebarMode ] } </ SelectValue >
1430+ </ SelectTrigger >
1431+ < SelectPopup align = "end" alignItemWithTrigger = { false } >
1432+ { Object . entries ( compactSidebarModes ) . map ( ( [ value , label ] ) => (
1433+ < SelectItem key = { value } hideIndicator value = { value } >
1434+ { label }
1435+ </ SelectItem >
1436+ ) ) }
1437+ </ SelectPopup >
1438+ </ Select >
13861439 </ div >
13871440 }
13881441 />
0 commit comments