diff --git a/src/browser/components/ProjectSidebar.tsx b/src/browser/components/ProjectSidebar.tsx index 2fcbd84ac..2f4e657f4 100644 --- a/src/browser/components/ProjectSidebar.tsx +++ b/src/browser/components/ProjectSidebar.tsx @@ -627,7 +627,7 @@ const ProjectSidebarInner: React.FC = ({ // Empty tiers are skipped automatically const renderTier = (tierIndex: number): React.ReactNode => { const bucket = buckets[tierIndex]; - // Sum remaining workspaces from this tier onward + // Sum remaining workspaces from this tier onward (for collapsed state) const remainingCount = buckets .slice(tierIndex) .reduce((sum, b) => sum + b.length, 0); @@ -638,6 +638,8 @@ const ProjectSidebarInner: React.FC = ({ const isExpanded = expandedOldWorkspaces[key] ?? false; const thresholdDays = AGE_THRESHOLDS_DAYS[tierIndex]; const thresholdLabel = formatDaysThreshold(thresholdDays); + // When expanded, show only this tier's count; when collapsed, show cumulative + const displayCount = isExpanded ? bucket.length : remainingCount; return ( <> @@ -654,7 +656,7 @@ const ProjectSidebarInner: React.FC = ({
Older than {thresholdLabel} - ({remainingCount}) + ({displayCount})