Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Improves sidebar UX by hiding workspaces that haven't been used in more than 24 hours, while keeping them accessible via an expandable section per project.

Changes

New utility:

  • workspaceFiltering.ts: Partitions workspaces into recent (<24h) and old (≥24h) based on recency timestamps

Component updates:

  • ProjectSidebar: Added collapsible old workspaces section with toggle button
  • LeftSidebar/App: Pass workspaceRecency through component tree

State management:

  • Per-project expansion state persisted in localStorage (expandedOldWorkspaces)
  • Fully reversible toggle

Tests:

  • Comprehensive unit tests for partitioning logic (5 tests, all passing)

UX Flow

  1. Recent workspaces (<24h activity) display normally
  2. If old workspaces exist, shows: "Show N older workspaces" button
  3. Click to expand and reveal old workspaces
  4. Button changes to "Hide N older workspaces" when expanded
  5. State persists across sessions

Generated with cmux

- Hide workspaces inactive for >24 hours by default per project
- Add 'Show N older workspaces' toggle button with count
- Persist expansion state in localStorage
- Fully reversible expansion/collapse
- Includes comprehensive unit tests

Improves sidebar UX by reducing clutter from stale workspaces while
keeping them accessible when needed.
- Change text from 'Show N older workspaces' to 'Show workspaces older than 1 day (N)'
- Add formatOldWorkspaceThreshold() for human-readable cutoff display
- Enhance button styling with better colors, border-top separator, and spacing
- Use CSS classes for arrow and count styling
- Fix boundary condition: workspaces at exactly 24 hours are now correctly marked as old

Design improvements:
- Clearer visual separation with border-top
- Better hover states with subtle background change
- Count displayed in parentheses as secondary info
- More professional, less cluttered appearance
- Text stays constant: 'OLDER THAN 1 DAY (N)'
- Only arrow changes: ▶ when collapsed, ▼ when expanded
- Styled as section header with uppercase text
- Better visual hierarchy with consistent spacing
- Added aria-expanded for accessibility
- Arrow moved to right side and rotates in place
- Text 'Older than 1 day (N)' stays constant on left
- Arrow rotates 90° from ▶ to ▼ when expanded
- Restored normal font weight (not uppercase)
- Perfect symmetry: all elements stay in same position
- When all workspaces are old, show the most recent one
- Prevents empty workspace list in sidebar
- Updated tests to cover this behavior
- Improves UX by ensuring projects always show their most recent workspace
- Changed from Set to Record<string, boolean> for clearer per-project tracking
- Now properly scoped: each project path has its own expansion state
- Simplified toggle logic
- Extract workspace rendering into renderWorkspace helper
- Reduce nesting depth by restructuring JSX
- Eliminate duplicate WorkspaceListItem code
- Move WorkspacesContainer outside IIFE
- Clearer separation of concerns
@ammario ammario enabled auto-merge October 20, 2025 23:50
@ammario ammario added this pull request to the merge queue Oct 20, 2025
Merged via the queue into main with commit b61737f Oct 21, 2025
9 checks passed
@ammario ammario deleted the hide-old-workspaces branch October 21, 2025 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants