Skip to content

Commit e277b21

Browse files
🤖 fix: show tier-specific count when age section is expanded (#1111)
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. **Before (confusing):** ``` ▶ Older than 1 day (5) ← 5 total hidden, good ▼ Older than 1 day (5) ← still says 5, but only 2 visible here workspace-a workspace-b ▶ Older than 7 days (3) ← the other 3 are hidden here ``` **After (clear):** ``` ▶ Older than 1 day (5) ← 5 total hidden, good (unchanged) ▼ Older than 1 day (2) ← now matches the 2 visible items workspace-a workspace-b ▶ Older than 7 days (3) ``` _Generated with `mux`_
1 parent c805e61 commit e277b21

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/browser/components/ProjectSidebar.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ const ProjectSidebarInner: React.FC<ProjectSidebarProps> = ({
641641
// Empty tiers are skipped automatically
642642
const renderTier = (tierIndex: number): React.ReactNode => {
643643
const bucket = buckets[tierIndex];
644-
// Sum remaining workspaces from this tier onward
644+
// Sum remaining workspaces from this tier onward (for collapsed state)
645645
const remainingCount = buckets
646646
.slice(tierIndex)
647647
.reduce((sum, b) => sum + b.length, 0);
@@ -652,6 +652,8 @@ const ProjectSidebarInner: React.FC<ProjectSidebarProps> = ({
652652
const isExpanded = expandedOldWorkspaces[key] ?? false;
653653
const thresholdDays = AGE_THRESHOLDS_DAYS[tierIndex];
654654
const thresholdLabel = formatDaysThreshold(thresholdDays);
655+
// When expanded, show only this tier's count; when collapsed, show cumulative
656+
const displayCount = isExpanded ? bucket.length : remainingCount;
655657

656658
return (
657659
<>
@@ -668,7 +670,7 @@ const ProjectSidebarInner: React.FC<ProjectSidebarProps> = ({
668670
<div className="flex items-center gap-1.5">
669671
<span>Older than {thresholdLabel}</span>
670672
<span className="text-dim font-normal">
671-
({remainingCount})
673+
({displayCount})
672674
</span>
673675
</div>
674676
<span

0 commit comments

Comments
 (0)