Skip to content

[feature] Disambiguate duplicate workspace names in the sidebar #2121

Description

@zerob13

Summary

The sidebar uses only the final path segment as a workspace label. Two managed directories with the same basename are therefore visually indistinguishable.

Priority: P2 UX

Current behavior

getProjectGroupLabel() in src/renderer/src/stores/ui/session.ts derives the label with a basename-style split and does not use parent context.

This creates common collisions, for example:

.../team-a/app
.../archive/app

Both groups are rendered as app. Cross-platform history, nested copies, monorepo checkouts, and similarly named client projects make this a normal case rather than an edge case.

Related contracts and documentation

  • docs/features/complete-directory-management/spec.md treats each normalized directory path as a distinct managed environment.
  • docs/architecture/session-management.md states that Project owns directory lifecycle while Session stores only projectDir.

The identity is path-based, but the current presentation removes enough path information to make distinct identities ambiguous.

Impact

  • Users can open or move a conversation under the wrong workspace.
  • Drag/reorder actions have no reliable visual target.
  • Missing and cross-platform environments are especially difficult to identify.
  • Full paths in every row would solve ambiguity but add unnecessary visual noise.

Proposed direction

  • Keep the basename for unique labels.
  • Detect collisions among currently visible/active groups.
  • For collisions only, append the shortest parent suffix that makes the label unique, for example:
app · team-a
app · archive
  • Keep the normalized full path in an accessible tooltip/details surface.
  • Recompute disambiguation when environment or filter state changes.

Acceptance criteria

  • Unique basenames retain their current compact label.
  • Duplicate basenames receive deterministic minimal parent context.
  • Labels remain unique when more than two paths share multiple parent segments.
  • Windows and POSIX separators are handled consistently.
  • Full normalized paths are available to keyboard and assistive-technology users.
  • Tests cover same basename, nested duplicates, cross-platform path strings, and renamed/removed environments.

User benefit

Users can reliably identify the intended project without turning the entire sidebar into a list of long absolute paths.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions