diff --git a/apps/desktop/src/settings/DesktopClientSettings.test.ts b/apps/desktop/src/settings/DesktopClientSettings.test.ts index 90c8740f83725..2c4b103a25322 100644 --- a/apps/desktop/src/settings/DesktopClientSettings.test.ts +++ b/apps/desktop/src/settings/DesktopClientSettings.test.ts @@ -66,6 +66,7 @@ const clientSettings: ClientSettings = { threadDetailsUsageEnabled: false, threadDetailsItems: {}, sidebarWorkingShelfEnabled: false, + sidebarCompactThreadCards: false, loadBalancingEnabled: false, loadBalancingWeights: { "environment-1": 75, "environment-2": 0 }, pullRequestMergeMethodOverrides: {}, diff --git a/apps/web/src/components/settings/SettingsPanels.tsx b/apps/web/src/components/settings/SettingsPanels.tsx index 633e18a567b2f..70a3b17733ee7 100644 --- a/apps/web/src/components/settings/SettingsPanels.tsx +++ b/apps/web/src/components/settings/SettingsPanels.tsx @@ -496,6 +496,9 @@ export function useSettingsRestore(onRestored?: () => void) { ...(settings.sidebarWorkingShelfEnabled !== DEFAULT_UNIFIED_SETTINGS.sidebarWorkingShelfEnabled ? ["Working section"] : []), + ...(settings.sidebarCompactThreadCards !== DEFAULT_UNIFIED_SETTINGS.sidebarCompactThreadCards + ? ["Compact thread cards"] + : []), ...(settings.sidebarAutoSettleAfterDays !== DEFAULT_UNIFIED_SETTINGS.sidebarAutoSettleAfterDays ? ["Auto-settle inactive threads"] : []), @@ -677,6 +680,7 @@ export function useSettingsRestore(onRestored?: () => void) { sidebarProjectGroupingMode: DEFAULT_UNIFIED_SETTINGS.sidebarProjectGroupingMode, sidebarProjectSortOrder: DEFAULT_UNIFIED_SETTINGS.sidebarProjectSortOrder, sidebarWorkingShelfEnabled: DEFAULT_UNIFIED_SETTINGS.sidebarWorkingShelfEnabled, + sidebarCompactThreadCards: DEFAULT_UNIFIED_SETTINGS.sidebarCompactThreadCards, sidebarAutoSettleAfterDays: DEFAULT_UNIFIED_SETTINGS.sidebarAutoSettleAfterDays, sidebarAutoSettleKeepPullRequests: DEFAULT_UNIFIED_SETTINGS.sidebarAutoSettleKeepPullRequests, sidebarAutoSettleOnMerge: DEFAULT_UNIFIED_SETTINGS.sidebarAutoSettleOnMerge, @@ -930,6 +934,37 @@ export function GeneralSettingsPanel() { /> } /> + + Drop the branch line from sidebar cards. Environment and provider icons move next to + the project name, and PRs next to the title. Hover a card for the details. + + } + resetAction={ + settings.sidebarCompactThreadCards !== + DEFAULT_UNIFIED_SETTINGS.sidebarCompactThreadCards ? ( + + updateSettings({ + sidebarCompactThreadCards: DEFAULT_UNIFIED_SETTINGS.sidebarCompactThreadCards, + }) + } + /> + ) : null + } + control={ + + updateSettings({ sidebarCompactThreadCards: Boolean(checked) }) + } + aria-label={gt("Compact thread cards")} + /> + } + /> diff --git a/apps/web/src/components/settings/settingsSearch.ts b/apps/web/src/components/settings/settingsSearch.ts index 7d7939e7f21f9..bd10b9d15e243 100644 --- a/apps/web/src/components/settings/settingsSearch.ts +++ b/apps/web/src/components/settings/settingsSearch.ts @@ -465,6 +465,12 @@ export const SETTINGS_SEARCH_ITEMS = [ to: "/settings/general", searchTerms: ["hide fold running monitoring threads inbox sidebar shelf"], }, + { + id: "compact-thread-cards", + title: msg("Compact thread cards"), + to: "/settings/general", + searchTerms: ["sidebar dense smaller hide branch worktree provider environment row"], + }, { id: "boring-sidebar", title: "Boring sidebar (group by project)", diff --git a/apps/web/src/components/sidebar/SidebarThreadRow.tsx b/apps/web/src/components/sidebar/SidebarThreadRow.tsx index 2a3893737c0b0..0878695d05246 100644 --- a/apps/web/src/components/sidebar/SidebarThreadRow.tsx +++ b/apps/web/src/components/sidebar/SidebarThreadRow.tsx @@ -122,6 +122,7 @@ import { Menu, MenuItem, MenuItemDetail, MenuPopup, MenuSeparator, MenuTrigger } import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; import { MiddleTruncate } from "../ui/middle-truncate"; import { useThreadHasUnsentDraft } from "../../composerDraftStore"; +import { useClientSettings } from "../../hooks/useSettings"; // The fields thread rows show. Provider status pushes refresh `checkedAt`, // status and auth on every provider; leaving those out keeps each @@ -188,6 +189,7 @@ function terminalProcessLabel(count: number): string { function SidebarProviderStack(props: { thread: SidebarThreadSummary; providerEntryByInstanceId: ReadonlyMap; + compact?: boolean; }) { const stack = resolveThreadProviderStack(props.thread); const currentInstanceId = stack[stack.length - 1]!; @@ -206,7 +208,7 @@ function SidebarProviderStack(props: { acpRegistryIconUrl={currentEntry.acpRegistryIconUrl} showBadge={showInstanceBadge} size="compact" - iconClassName="opacity-60" + iconClassName={props.compact ? "size-3 opacity-60" : "opacity-60"} /> ); if (stack.length === 1) { @@ -831,6 +833,8 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP const isRemote = thread.environmentId !== props.currentEnvironmentId; const showsScratchMachine = !checkoutThread.branch && props.scratchMachineLabel !== null; + const compactCard = + useClientSettings((settings) => settings.sidebarCompactThreadCards) && variant === "card"; const detailsTooltip = ( ); - const titleLineIcons = metaLineEmpty ? ( + const compactHeaderIcons = compactCard ? ( + + {isRemote || showsScratchMachine ? ( + + ) : null} + + + ) : null; + const titleLineIcons = compactCard ? ( + <> + {terminalStatusIcon} + {prBadge} + + ) : metaLineEmpty ? ( {remoteMachineIcon} @@ -1452,7 +1476,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
@@ -1465,13 +1489,18 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP {pinIndicator} {props.projectDisplayName ? ( {props.projectDisplayName} - ) : ( + ) : compactCard ? null : ( )} + {compactHeaderIcons} + {compactCard ? : null} {sortable?.isDragging ? ( dragDestination ) : ( @@ -1615,7 +1644,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP ) : null} {titleLineIcons}
- {metaLine} + {compactCard ? null : metaLine}
{detailsTooltip} diff --git a/packages/contracts/src/settings.ts b/packages/contracts/src/settings.ts index 7bbb03595d4bb..33fee2d7307f2 100644 --- a/packages/contracts/src/settings.ts +++ b/packages/contracts/src/settings.ts @@ -545,6 +545,7 @@ export const ClientSettingsSchema = Schema.Struct({ Schema.withDecodingDefault(Effect.succeed({})), ), sidebarWorkingShelfEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))), + sidebarCompactThreadCards: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))), sidebarProjectGroupingMode: SidebarProjectGroupingMode.pipe( Schema.withDecodingDefault(Effect.succeed(DEFAULT_SIDEBAR_PROJECT_GROUPING_MODE)), ), @@ -2092,6 +2093,7 @@ export const ClientSettingsPatch = Schema.Struct({ threadDetailsUsageEnabled: Schema.optionalKey(Schema.Boolean), threadDetailsItems: Schema.optionalKey(Schema.Record(Schema.String, Schema.Boolean)), sidebarWorkingShelfEnabled: Schema.optionalKey(Schema.Boolean), + sidebarCompactThreadCards: Schema.optionalKey(Schema.Boolean), sidebarProjectGroupingMode: Schema.optionalKey(SidebarProjectGroupingMode), sidebarProjectGroupingOverrides: Schema.optionalKey( Schema.Record(TrimmedNonEmptyString, SidebarProjectGroupingMode),