Skip to content

🤖 feat: optional flat chat list for the sidebar with project badges - #3994

Open
ibetitsmike wants to merge 17 commits into
mainfrom
mike/sidebar-flat-mode
Open

🤖 feat: optional flat chat list for the sidebar with project badges#3994
ibetitsmike wants to merge 17 commits into
mainfrom
mike/sidebar-flat-mode

Conversation

@ibetitsmike

Copy link
Copy Markdown
Contributor

Summary

Adds an optional flat sidebar mode: a new "Flat chat list" setting replaces the project-folder grouping with one globally sorted list of chats, keeping pinned chats in a single unified block at the top and tagging each root chat card with a project-name badge tinted by the project's folder color. The General settings page is also reorganized from three monolithic headers into logical groups (Appearance, Sidebar, Transcript, Terminal, Archiving, Editor & debugging, Projects).

Background

Users working across many projects lose vertical space and orientation to per-project folders when they mostly care about "all my recent chats". The flat mode drops the folders while badges preserve project attribution; grouped mode stays the default and is unchanged.

Implementation

  • sidebarFlatMode persists via usePersistedState (key in src/common/constants/storage.ts, default off) with a command palette toggle for parity with the sibling sidebar options.
  • buildSortedWorkspacesFlat (workspaceFiltering.ts) reuses the existing comparators: pinned roots first in global pinnedAt order, then recency with deterministic tie-breakers, then the tree flatten that keeps sub-agents under their parents. Age grouping and hide-sub-agents both compose with flat mode.
  • Pinned drag-reorder in flat mode uses one shared reorder group; workspaceService.reorderPinned now scopes its timestamp re-deal to the union of project buckets referenced by the input ids (grouped drags keep exact single-bucket behavior), fixing cross-project reorders reverting on reload.
  • Root chat cards and drafts render a truncating badge (resolveSectionColor of the project's configured color); scratch chats get no badge, multi-project chats a neutral one, sub-agent rows none.
  • Folder expansion state is left untouched while flat, so toggling back restores the prior grouped layout.

Validation

  • Remote dogfood UAT (2 rounds) on dev.coder.com against the exact pushed SHAs: grouped-default regression, live toggle, unified pinned block, badge colors matching folder colors, 240px truncation, sub-agent nesting, hide/age toggles, expansion-state restoration, keyboard nav, drafts, rapid toggling, and cross-project pinned reorder persistence incl. reload (round 2, after the fix).
  • Cross-project reorder fix is red-green covered: the new reorderPinned cross-bucket test fails without the service change.

Risks

  • reorderPinned is the only backend touch; scope generalization is covered by new unit tests plus the pre-existing single-bucket suite (defensive contract unchanged).
  • Grouped sidebar rendering paths are gated behind the (default-off) flag; largest regression surface is ProjectSidebar render wiring, exercised by the updated UI tests and a new Storybook story.

Generated with xum • Model: anthropic:claude-fable-5 • Thinking: xhigh

Loading
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.

1 participant