Repository navigation
Conversation
Adding a project while "Hide default branch" was on silently turned the filter off, because an ungrouped project whose only worktree is the default checkout had no sidebar presence under that filter. Treat the filter as hiding rows, not projects: a repo whose only live rows are default checkouts keeps its header like an empty project, and the add-project handoff reveals that header (revealSidebarRow, which also switches non-repo groupings) instead of flipping the filter. An explicitly picked folder inside the checkout still opens, with the existing "hidden by sidebar filters" toast. The skip finalizer no longer resets the filter and only skips the sleeping exemption flip for imports the filter actually hides. The dead setHideDefaultBranchWorkspace handoff parameter is removed. Telemetry: new add_repo_default_checkout_handoff reason default_checkout_hidden.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe project-add flow no longer changes the default-branch filter during import. Sidebar row construction preserves project headers when hidden default checkouts are the only rows. Project-add handoff logic reveals project headers or opens selected hidden checkouts without changing filters. Tests cover import finalization, sidebar placeholders, telemetry, and end-to-end project creation. Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The reviewed change introduces no identified merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 42e12065-ef0d-411c-8d97-fef37f1e6c2d
📒 Files selected for processing (20)
src/renderer/src/components/sidebar/AddProjectFromFolderDialog.test.tsxsrc/renderer/src/components/sidebar/AddProjectFromFolderDialog.tsxsrc/renderer/src/components/sidebar/AddRepoDialog.tsxsrc/renderer/src/components/sidebar/ProjectAddedDialog.test.tsxsrc/renderer/src/components/sidebar/ProjectAddedDialog.tsxsrc/renderer/src/components/sidebar/WorktreeList.empty-project-rows.test.tssrc/renderer/src/components/sidebar/WorktreeList.tsxsrc/renderer/src/components/sidebar/add-repo-skip-finalization.test.tssrc/renderer/src/components/sidebar/add-repo-skip-finalization.tssrc/renderer/src/components/sidebar/empty-project-placeholder-repos.test.tssrc/renderer/src/components/sidebar/empty-project-placeholder-repos.tssrc/renderer/src/components/sidebar/project-added-default-checkout.test.tssrc/renderer/src/components/sidebar/project-added-default-checkout.tssrc/renderer/src/components/sidebar/sidebar-filter-actions.tssrc/renderer/src/components/sidebar/use-complete-git-repo-add.tssrc/renderer/src/components/sidebar/visible-worktree-kinds.tssrc/renderer/src/components/sidebar/worktree-list/listing/use-section-rows.tssrc/shared/telemetry-events.test.tssrc/shared/telemetry-property-schemas.tstests/e2e/add-project-hide-default-branch.spec.ts
💤 Files with no reviewable changes (2)
- src/renderer/src/components/sidebar/visible-worktree-kinds.ts
- src/renderer/src/components/sidebar/AddRepoDialog.tsx
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Placeholder scope —
empty-project-placeholder-repos.tskeeps a Project header under repo grouping whenhideDefaultBranchWorkspaceis on and the repo's only live rows are default checkouts (hasOnlyDefaultCheckoutRows, which ignores archived rows). The new arg is threaded throughuse-section-rows.ts/WorktreeList.tsxwith correct memo deps. - Handoff behavior —
project-added-default-checkout.tsaddsrevealImportedProjectand, when the found default checkout is hidden by the filter and no in-checkout path was picked, reveals the header (default_checkout_hidden) instead of flipping the filter. An explicit in-checkout subfolder still opens, with the existing filtered-notice toast. - Skip finalizer —
add-repo-skip-finalization.tsno longer resetshideDefaultBranchWorkspace; it skips the sleeping-exemption flip only when the default filter already hides the import.setHideDefaultBranchWorkspaceis removed from the contract and all prop plumbing. - Telemetry —
default_checkout_hiddenadded to the reason enum, with schema coverage. - Tests — unit coverage for the placeholder rule, finalizer guards, handoff branches (reveal / subfolder / host collision / provisioned-root / detached-HEAD / hide-sleeping),
WorktreeListrows, and a headless-Electron E2E that asserts the filter survives and the row stays hidden.
The load-bearing invariant holds: the placeholder header key matches getProjectHeaderRevealTarget(...).key, so the reveal does not fall through to useSidebarRevealRequests → clearFilters() and silently revert the filter. shouldFiltersHideAllRows also suppresses the empty state once a placeholder exists. The sleeping-exemption branch is correct because hideDefaultBranchWorkspace filters independently of isSleepingSweepExemptWorkspace, and branchless / provisioned-root mains are not hidden by it.
openrouter/deepseek/deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
…exits afterEach runs before the electronApp fixture tears down, so removing the temp repo could race Electron's watchers; on Windows that surfaces as an EPERM that masks the real assertion. Register the removal with registerPostElectronShutdownCleanup instead.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes (since the prior pullfrog review at 3e50a08)
- E2E teardown hardening —
tests/e2e/add-project-hide-default-branch.spec.tsnow registers its temp-repo cleanup through theregisterPostElectronShutdownCleanupfixture and awaitsrm(root, { recursive: true, force: true, maxRetries: 5 })instead of a synchronoustest.afterEach+rmSync. That runs the deletion after theelectronAppfixture releases watchers/daemons, which is the codebase-wide pattern, and avoids the WindowsEPERMlock that could otherwise mask the real assertion. The fixture'selectronApp-dependency ordering guarantees teardown order, andtempRoots.splice(0)makes the callback idempotent. Test-only; no product behavior touched.
openrouter/deepseek/deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

ELI5
If you tell the sidebar to hide default-branch workspaces, adding a new project used to quietly switch that filter back off and open the new project's
mainat the bottom of the list. Now the filter stays exactly as you set it: the new project shows up as a project header (with its + to create a workspace), and its hiddenmainrow stays hidden.What Changed
empty-project-placeholder-repos.ts): a repo whose only live rows are default checkouts keeps its header while Hide default branch is on, the same way empty projects and filtered Project Group members ([Bug]: Project Group hides member projects when Hide sleeping filters their workspaces #8865) already do. Rows hidden by any other filter (Hide sleeping, host scope) do not earn a placeholder, so the [Bug]: Project Group hides member projects when Hide sleeping filters their workspaces #8865 policy for ungrouped projects is unchanged.project-added-default-checkout.ts): when the default checkout is hidden by that filter, the handoff no longer flips the filter. It selects the project and issuesrevealSidebarRowfor its header, so under Status / PR / None grouping the existing reveal hook switches to project grouping and scrolls there (same path as Cmd+J project selection). Telemetry:revealed_projectwith new reasondefault_checkout_hidden. A folder the user explicitly picked inside the checkout was their real target, so it still opens, with the existing "hidden by sidebar filters" toast.add-repo-skip-finalization.ts): never resets the filter. The Hide-sleeping exemption flip is skipped only for imports the filter actually hides (isDefaultBranchWorkspace), so a detached-HEAD or provisioned-root main still gets the exemption instead of vanishing.setHideDefaultBranchWorkspaceparameter from the handoff and its callers; threadedhideDefaultBranchWorkspaceintouseSidebarSectionRows; dropped a stale doc comment whose rationale this change falsified.Why
The filter is a row filter, but the handoff treated it as something it had to override to make the new project visible, because an ungrouped project whose only worktree is the default checkout had no sidebar presence under it. Keeping a header for that project (like an empty project) removes the reason to touch the user's setting at all, and unifies grouped vs. ungrouped behavior. Opening the hidden checkout with a toast was considered, but a user who hides default branches did not ask to land on one; the header with its create-workspace button is the natural next step.
Linked Issue
Fixes #20394
Visual Proof
Same flow in both: Hide default branch on, then add
hidden-default-source(a repo whose only checkout ismain) via the folder dialog. Headless Electron build driven over CDP (tests/e2e/add-project-hide-default-branch.spec.tswith a screenshot step).mainrow is back, and the new project'smainis opened.hidden-default-sourcelands as a header with no rows, the seeded project'smainstays hidden, and the active workspace is unchanged.Testing
Platform: macOS (local host). SSH / runtime hosts are covered by unit tests on the host-qualified handoff (colliding repo IDs across
localandruntime:*), not by a live SSH session.empty-project-placeholder-repos.test.ts— default-checkout-only repo keeps its header under the filter; archived rows ignored; no placeholder when a non-default row is hidden by another filter, when a row is visible, outside repo grouping, or for a provisioned-root checkout; repo filter still applies.add-repo-skip-finalization.test.ts— filter never reset; sleeping exemption skipped only for filter-hidden imports (branchless main still exempted).project-added-default-checkout.test.ts— hidden checkout reveals the header (revealSidebarRow('repo:…'), no activation, no filter flip, no exemption flip); explicit subfolder still opens with toast; detached-HEAD and provisioned-root mains still open; colliding host IDs reveal once.WorktreeList.empty-project-rows.test.ts— real render: header present, no card, no empty state.telemetry-events.test.ts— new reason accepted by the strict schema.tests/e2e/add-project-hide-default-branch.spec.ts— end-to-end: filter stays on, header renders, checkout row hidden and not activated.pnpm typecheck, the changed-file code-quality gate, and the sidebar / telemetry / cmd-j suites (319 files, 2775 tests) pass locally.AI Disclosure
Written with Claude Code (Claude Fable 5.1); reviewed with opus-model review agents (code, test coverage, comment accuracy). Their two real findings — the finalizer guard dropping detached-HEAD mains, and no landing spot outside project grouping — are fixed and covered by the tests above. All code was read and verified by me.
Review
executionHostIdfiltering; the hidden-checkout branch runs after host-qualified default-checkout selection, and the colliding-ID test proves one reveal per add. The placeholder readsworktreesByRepoacross hosts, same as the existing zero-worktree rule.isDefaultBranchWorkspaceis false for branchless rows, so they keep the old activation path.reposinside an existinguseMemo, keyed on the new flag..strict()schema.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
useSidebarRevealRequestsbehavior for project targets, not new logic.add_repo_default_checkout_handoffgains one enum reason; no wire or persisted-state changes.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)🤖 Generated with Claude Code