From f4c51de0f43b6ceb50653ab9c871efcca45ab35d Mon Sep 17 00:00:00 2001 From: ethan Date: Fri, 12 Dec 2025 18:51:22 +1100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20fix:=20show=20tier-specific=20co?= =?UTF-8?q?unt=20when=20age=20section=20is=20expanded?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When an 'Older than X days' section is expanded, the count now shows only workspaces in that specific tier rather than the cumulative count of all nested tiers. This makes the number match what's visible. - Collapsed: shows cumulative count (for discovery) - Expanded: shows tier's own count (matches visible items) _Generated with mux_ --- src/browser/components/ProjectSidebar.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/browser/components/ProjectSidebar.tsx b/src/browser/components/ProjectSidebar.tsx index 2fcbd84acb..2f4e657f46 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})