Skip to content

fix(sidebar): Show single-workspace projects as one row - #45518

Open
jtalborough wants to merge 1 commit into
stablyai:mainfrom
jtalborough:fix/sidebar-single-workspace-projects
Open

jtalborough wants to merge 1 commit into
stablyai:mainfrom
jtalborough:fix/sidebar-single-workspace-projects

Conversation

@jtalborough

Copy link
Copy Markdown

ELI5

A project with one workspace takes up one row inside its group. The card still opens the workspace and gives you the project controls.

What Changed

  • In Group by → Project, render a project's only workspace directly inside its named group. Projects with multiple workspaces keep their collapsible headings.
  • Put Create Workspace and the project menu, including Project Settings, on the single workspace card. Keep the card's existing workspace actions.
  • Use project membership before visibility filters to count workspaces. Use the same grouping rule in desktop and mobile sidebar projections and update reveal and drag ordering to account for the missing heading.

Why

Named groups can hold many projects. Removing a redundant heading makes single-workspace projects easier to scan, while multi-workspace projects retain a collapse control.

Linked Issue

Fixes #45515

Visual Proof

Same synthetic projects, 1280 × 800 macOS Electron viewport, 380px sidebar. The single project is hovered in each view to show its controls.

Before After
Before: Infrastructure has a separate project heading and workspace card After: Infrastructure is a single card with its project actions

Testing

  • The owner tried the layout in an installed Apple Silicon build.
  • All 40 checks in pnpm check:changed --base=orca-upstream/main --maxWorkers=2 passed on the rebased branch, including affected tests, TypeScript, lint, and design-system checks.
  • pnpm --dir mobile run typecheck passed.
  • A focused hidden Electron run on the rebased branch verified single-row rendering, multi-workspace expand and collapse, workspace opening, the workspace context menu, Create Workspace, and keyboard access to Project Settings.
  • Existing tests and a local Electron scenario provided coverage. The branch adds no persistent tests.

To verify, put a folder project and a Git project with at least two workspaces in the same named group. Select Group by → Project, open the sole workspace, check its context menu and project buttons, then collapse and expand the multi-workspace project.

Risk

Level: Medium. The shared sidebar model changes row placement and reveal paths. A regression could affect keyboard navigation, drag targeting, or reveal within a project group. This change adds no persisted fields or wire protocol changes. A standard revert restores the previous rows.

AI Disclosure

OpenAI Codex implemented, rebased, and validated the change and drafted this description. The owner reviewed the installed layout.

Review

  • UI: The single card keeps workspace click and context actions. Project actions use the existing controls and remain reachable by keyboard.
  • Platforms and hosts: Desktop and mobile use the common project membership rule. No platform APIs or host routing changed. Rendered interaction checks ran on macOS. Windows, Linux, live SSH, and a paired mobile device remain untested.
  • Compatibility and security: No provider, credential, session protocol, or persistent state changes.
  • Performance: Counting uses the existing project ownership index. The additional catalog pass runs when a separate unfiltered workspace list is supplied.

Agent skill upstream boundary

  • Not applicable. The change copies no upstream skill-installer code or assets.

Notes

The visual proof was captured with disposable profiles. Full CI is tracked on this PR.

Checklist

  • One user-facing change with rationale and risk documented
  • Before and after screenshots attached
  • Local validation and platform limits documented
  • Scoped checks, mobile typecheck, and macOS interaction checks passed

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

Project grouping now supports showing a single-workspace project as an inline row, with its project name and project actions. Row planning uses full worktree data to calculate project ownership and reveal paths. Sidebar and host views support hidden section headers and inline project labels. Drag grouping and row navigation recognize these rows. The context-menu click handler now suppresses pointer events only for clicks inside the menu element.

Severity of issue fixed: Low

Merge Risk: Low · up to 238ac

Single-workspace projects now render as one row. On mobile, a long workspace name can hide the project name, and a project that also has a workspace in the Bots section may lose its heading. Both are small presentation issues that are easy to fix, and neither blocks merging.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title uses the conventional fix(sidebar) prefix and states the main change: a single-workspace project now renders as one row in the sidebar. The changeset matches this, since the summaries show s…
Description check Passed The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue (Fixes #45515), Visual Proof with before and after images, Testing with checked items, Risk with a le…
Linked Issues check Passed Issue #45515 is the only directly linked, active issue. Its coding requirements are covered by the reviewed summary: (1) Single-workspace rendering: isSingleWorkspaceProject in src/shared/sidebar-list…
Out of Scope Changes check Passed Most changes support the single-row feature: shared row-type fields (inlineProjectName, hideHeader), reveal-path and drag-group updates needed because the heading no longer exists, ProjectHeaderAction…
Full details: Title check

Explanation

The title uses the conventional fix(sidebar) prefix and states the main change: a single-workspace project now renders as one row in the sidebar. The changeset matches this, since the summaries show single-workspace project detection, hidden section headers, and inline project names on rows. The title is specific and concise, so it passes.

Full details: Description check

Explanation

The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue (Fixes #45515), Visual Proof with before and after images, Testing with checked items, Risk with a level, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. The content is specific and matches the changeset. The Risk section names the shared sidebar model as the riskiest part and gives a revert path. The Level is set to Medium. Minor gaps: the Testing section lists no automated tests and says the branch adds none, though the template asks for an explanation of why not, and the Visual Proof section links images only. These gaps are non-critical, so the check passes.

Full details: Linked Issues check

Explanation

Issue #45515 is the only directly linked, active issue. Its coding requirements are covered by the reviewed summary: (1) Single-workspace rendering: isSingleWorkspaceProject in src/shared/sidebar-list/sections/project-section-grouping.ts returns true only when workspaceCount is 1 and exactly one item is displayed. group-sections.ts then omits the group header and passes the project label to appendWorktreeRows as inlineProjectName. (2) Project name visibility: WorktreeCardRepoChip and WorktreeCardMetaRepoBadge accept a name that falls back to repo.displayName, and build-workspace-card-facts.ts uses card.inlineProjectName. (3) Card actions: ProjectActions is added to the card header through default-workspace-card.json, and item-row.tsx renders RepoProjectActionButtons (Create Workspace and project menu with Project Settings). (4) Workspace actions: the card keeps its existing click and context-menu behavior. (5) Multi-workspace projects: they keep the collapsible heading because workspaceCount is greater than 1. Workspace counts use allItems (project membership before visibility filters), so a project with hidden workspaces is not misclassified. Automated tests were not added on this branch. The author reports the focused Electron run and the 40 scoped checks passed, but I did not execute them. Those reports are supporting evidence only, not verified here.

Full details: Out of Scope Changes check

Explanation

Most changes support the single-row feature: shared row-type fields (inlineProjectName, hideHeader), reveal-path and drag-group updates needed because the heading no longer exists, ProjectHeaderActions inline mode, the repo-header action refactor, and rendered-row key and reveal changes. Mobile changes (host-sidebar-feed-sections.ts, host-workspace-list.tsx, project-group-tree-sections.ts, WorktreeListRow.tsx, use-workspace-sections.ts) apply the same project-membership rule through the shared projection. The issue text targets the Workspaces sidebar. The PR description states that mobile uses the same rule, so these changes are consistent with the stated PR scope. WorktreeContextMenuView.tsx changes click-capture suppression so it applies only to clicks inside the element. This supports the nested project action controls. No change was found that is unrelated to the linked issue. Mobile and the context-menu change were not checked at runtime beyond the author's report.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2c63b549-7fb1-4d28-8370-55d97775cf62
Commits

Reviewing files that changed from the base of the PR and between e4548df and 238ac82.

Files selected for processing: 39

  • mobile/src/host-screen/sidebar-feed/host-sidebar-feed-sections.ts
  • mobile/src/host-screen/workspace-list/host-workspace-list.tsx
  • mobile/src/worktree/project-sections/project-group-tree-sections.ts
  • mobile/src/worktree/row-presentation/WorktreeListRow.tsx
  • mobile/src/worktree/use-workspace-sections.ts
  • mobile/src/worktree/workspace-list/workspace-list-sections.ts
  • mobile/src/worktree/workspace-list/workspace-list-types.ts
  • src/renderer/src/components/sidebar/workspace-actions/context-menu/WorktreeContextMenuView.tsx
  • src/renderer/src/components/sidebar/workspace-card/controller/worktree-card-model.ts
  • src/renderer/src/components/sidebar/workspace-card/identity/worktree-card-header-items.tsx
  • src/renderer/src/components/sidebar/workspace-card/metadata/worktree-card-meta-items.tsx
  • src/renderer/src/components/sidebar/workspace-card/surface/WorktreeCard.tsx
  • src/renderer/src/components/sidebar/workspace-card/template/build-workspace-card-facts.ts
  • src/renderer/src/components/sidebar/workspace-card/template/card-identity-parts.tsx
  • src/renderer/src/components/sidebar/workspace-card/template/default-workspace-card.json
  • src/renderer/src/components/sidebar/worktree-list/drag/groups.ts
  • src/renderer/src/components/sidebar/worktree-list/drag/worktree-drag-units.ts
  • src/renderer/src/components/sidebar/worktree-list/listing/rendered-row-keys.ts
  • src/renderer/src/components/sidebar/worktree-list/listing/rendered-sidebar-worktree-order.ts
  • src/renderer/src/components/sidebar/worktree-list/listing/sidebar-list-model.ts
  • src/renderer/src/components/sidebar/worktree-list/listing/use-section-rows.ts
  • src/renderer/src/components/sidebar/worktree-list/listing/use-window-list-model.ts
  • src/renderer/src/components/sidebar/worktree-list/navigation/render-row-lookup.ts
  • src/renderer/src/components/sidebar/worktree-list/navigation/use-pending-reveal.ts
  • src/renderer/src/components/sidebar/worktree-list/navigation/worktree-reveal-group-keys.ts
  • src/renderer/src/components/sidebar/worktree-list/rows/ProjectHeaderActions.tsx
  • src/renderer/src/components/sidebar/worktree-list/rows/SectionHeader.tsx
  • src/renderer/src/components/sidebar/worktree-list/rows/item-row.tsx
  • src/renderer/src/components/sidebar/worktree-list/rows/repo-header-project-actions.tsx
  • src/renderer/src/components/sidebar/worktree-list/viewport/virtual-row-context.ts
  • src/shared/sidebar-list/feed/sidebar-feed-rows.ts
  • src/shared/sidebar-list/hosts/host-section-rows.ts
  • src/shared/sidebar-list/row-types.ts
  • src/shared/sidebar-list/sections/group-sections.ts
  • src/shared/sidebar-list/sections/project-group-sections.ts
  • src/shared/sidebar-list/sections/project-section-grouping.ts
  • src/shared/sidebar-list/sections/row-builders.ts
  • src/shared/sidebar-list/sections/worktree-grouping.ts
  • src/shared/sidebar-list/sidebar-row-plan.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

numberOfLines={1}
>
{item.displayName || item.repo}
{cardDetails.repoInTitle && view.inlineProjectName ? ` — ${projectName}` : ''}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor · Functional Correctness · Quick win

Keep the inline project name visible.

If the workspace name fills the one-line title, truncation removes the appended project name. The hidden heading no longer provides that name. Reserve space for a separate project label so users can distinguish the project from its workspace.

Comment on lines +192 to +195
allItems:
projectCatalog.projectGroups.length > 0
? worktrees.filter((w) => !w.isArchived && w.workspaceKind !== 'folder-workspace')
: undefined,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor · Functional Correctness · Quick win

Count Bots-listed workspaces toward project membership.

allItems covers only displayWorktrees, so a workspace listed in the Bots section is excluded from the project count. A project with one displayed workspace and one Bots-listed workspace gets workspaceCount 1. isSingleWorkspaceProject then returns true, and the project header is hidden. The project has two workspaces, so its heading should remain.

Pass the host's non-archived, non-folder rows from allHostRows into the planner for the allItems count. Keep the displayed rows for the visible items. Keep the catalog filtering as it is.

@mbkkong

mbkkong commented Nov 23, 2026

Copy link
Copy Markdown

Thanks for this, @jtalborough. My setup is exactly this case: a few plain folder projects sorted into project groups, so every one of them shows its name twice, first as the header and then as its only workspace. This PR fixes that.

The branch had fallen behind main and now conflicts, so I opened jtalborough#2 against it. It merges main in, fixes the two CodeRabbit findings on the phone, and keeps the project name off the card when it matches the title, which still repeated for folder projects. It also notes two edge cases I found in project drag-reorder and in the numbered shortcuts. Checks pass, and there's a screenshot in that PR.

Other requests this PR answers or touches:

@nwparker @AmoabaKelvin, sorry for the direct ping. Could one of you take a look, or approve the CI run for this fork? The change is focused, and it makes grouped sidebars a lot easier to read.

This branch has not been deployed

No deployments
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.

[Feature]: Show single-workspace projects as one row inside project groups

2 participants