Skip to content

🤖 feat: add flat-card sidebar display style - #3747

Open
ibetitsmike wants to merge 4 commits into
mainfrom
mike/flat-sidebar-cards
Open

🤖 feat: add flat-card sidebar display style#3747
ibetitsmike wants to merge 4 commits into
mainfrom
mike/flat-sidebar-cards

Conversation

@ibetitsmike

Copy link
Copy Markdown
Contributor

Summary

Adds an alternative left sidebar display style: a flat list of taller workspace cards showing the GitHub repo logo (owner avatar), repo name, chat title, and the unchanged status label and actions. The default project-sections style is untouched; the new style is opt-in via Settings > General or the command palette.

Background

Grouping chats by project usually makes sense, but a flat cross-project view keeps the most recent chats in one list. The new style still respects the existing sidebar age-grouping ("Older than") toggle.

Implementation

  • sidebarDisplayStyle (projects | flat, default projects) is local persisted state like sidebarAgeGrouping, surfaced in Settings > General and as command palette actions.
  • Repo identity comes from one bulk oRPC call (projects.githubRepoInfo): the backend runs git remote get-url origin per configured project (spawn args, 2s timeout), parses GitHub HTTPS/SSH/SCP remotes with a pure tested helper, and returns Record<projectPath, { owner, repo, avatarUrl } | null> with a 5 minute in-memory TTL cache and request coalescing. Failures yield null per project.
  • The logo is the GitHub owner avatar (https://github.com/{owner}.png?size=64, public even for private repos, no REST rate limits); image bytes rely on the Chromium HTTP cache, with an SVG folder fallback on error or missing identity.
  • ProjectSidebar branches at the outer collection boundary into a flat renderer that reuses the existing visible-tree, task-group, age-partition, and draft logic; AgentListItem gains a small flat-card presentation variant so selection, keyboard, rename, pin, status, and menu behavior stay shared.
  • Scratch workspaces are included with the fallback icon; task/sub-agent nesting is preserved; multi-project workspaces use the primary project path.
  • The recency comparator used by project sections is now shared with the flat list (compareWorkspacesByRecency).

Validation

  • Dogfood UAT in a dev-server-sandbox instance via agent-browser: default mode unchanged, Settings and palette switching, reload persistence, flat rendering (avatars, fallbacks, status labels, actions menu), card selection/navigation, mobile width (375px) truncation, and project-mode regression pass.
  • Storybook stories cover flat mode with age grouping on/off, avatar fallback and broken URL, long titles, an actions-menu play test, and a pinned phone-width Pixel variant.

Risks

Low for the default path: project-sections rendering is untouched apart from a large JSX re-indent (review with whitespace hidden) and the extracted shared comparator, which preserves ordering semantics. Flat mode is new and opt-in; the main functional risk is ordering/grouping drift in the flat list, bounded by unit tests on the flat-list builder and comparator.


Generated with mux • Model: anthropic:claude-fable-5 • Thinking: xhigh • Cost: $11.75

Alternative left sidebar layout selectable in Settings > General and the
command palette. Flat mode drops project sections and renders taller
workspace cards with the GitHub owner avatar (resolved from the origin
remote by a bulk oRPC call with TTL caching), repo name, chat title, and
the unchanged status label and actions. The existing age-grouping toggle
still applies in flat mode.
… edges

Polish pass on the flat sidebar branch: reuse one recency comparator for
project sections and the flat list, let flattenWorkspaceTree sort roots,
simplify the avatar fallback to component-local state, respect draft
visibility in the flat empty state, show current bucket counts on
expanded age tiers, and prune repo-info cache entries for removed
projects.
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 37a18827e7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/browser/components/ProjectSidebar/flatWorkspaceList.ts Outdated
Codex review: flat cards for sub-agent children created under a
sub-project labeled the parent project and fetched the wrong avatar.
Reuse resolveEffectiveSectionId so subProjectPath is honored only when
configured and inherited through the parent chain, matching the section
renderer.
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

Addressed in 75f96d5: the flat-list builder now resolves the effective sub-project via resolveEffectiveSectionId (configured sections only, inherited through the parent chain, stale ids fall back to the project path), so child cards get the sub-project label and avatar. Added a unit test covering inheritance and stale sections.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 75f96d5860

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/browser/components/ProjectSidebar/ProjectSidebar.tsx
Codex review: flat cards were draggable but never received
pinnedReorderGroup/onPinnedReorderDrop, so pinned chats lost
drag-to-reorder in flat mode. Derive the same group keys as the section
renderer (project+section, scratch and multi-project sentinels) and
reuse handlePinnedReorderDrop so both layouts share reorder semantics.
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

Addressed in 5f984a5: flat cards now pass pinnedReorderGroup (same project+section keys and scratch/multi-project sentinels as the section renderer) and onPinnedReorderDrop, so pinned drag-to-reorder works identically in both layouts.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 5f984a556b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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