Skip to content

Fix nested workspace card indentation - #5684

Merged
brennanb2025 merged 3 commits into
mainfrom
brennanb2025/fix-worktree-card-indent
Jun 18, 2026
Merged

brennanb2025 merged 3 commits into
mainfrom
brennanb2025/fix-worktree-card-indent

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes the experimental worktree card lineage layout so nested child workspace cards advance by the immediate parent step instead of accumulating global lineage depth. The shared sidebar indentation helpers now own the lineage geometry, and WorktreeCard renders caller-resolved child-wrapper styles.

Also updates the right-sidebar folder-workspace lineage caller so it uses the same geometry contract rather than relying on a stale card default.

Design / Review

  • Design approach: move lineage indentation math into worktree-list-indentation.ts, pass resolved row/card/child-wrapper geometry from callers, and keep non-experimental card layout unchanged.
  • Design review: auto-design-review-fix completed clean after tightening the design around caller-owned geometry.
  • Implementation deviation: none material. The implementation uses the reviewed lineageChildrenStyle prop shape.

Verification

  • Completeness verification: confirmed implementation satisfies the design after two small contract cleanups so callers only pass lineage child-wrapper styles when children render.
  • Code review loop: one round with two independent reviewers; both returned No issues found.
  • Brennan test changes: land.

Tests

  • pnpm vitest run --config config/vitest.config.ts src/renderer/src/components/sidebar/worktree-list-indentation.test.ts src/renderer/src/components/sidebar/WorktreeList.lineage-child-real-card.test.tsx src/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.test.tsx
  • pnpm vitest run --config config/vitest.config.ts src/renderer/src/components/sidebar/WorktreeCard.compact-hover.test.tsx src/renderer/src/components/sidebar/WorktreeList.lineage-child-card.test.ts
  • pnpm run typecheck
  • pnpm run lint (passed; one pre-existing unrelated SourceControl.tsx hook warning observed)
  • git diff --check
  • Electron validation on this exact worktree via CDP, identity verified as branch brennanb2025/fix-worktree-card-indent, root /Users/thebr/orca/workspaces/orca/staghorn
  • Live visual reproduction in demo-project with experimental card style enabled: main -> demo/gh-issue -> demo/linear-task

Evidence / Notes

  • Screenshot captured locally at validation-screenshots/worktree-lineage-level-2-indent.png and intentionally not committed.
  • Live validation covered compact cards and project grouping.
  • Inline-agent lineage visuals were not live-tested because the reproduction did not involve running agents.
  • Right-sidebar folder-workspace geometry was covered by focused tests rather than a separate live right-sidebar visual pass.
  • No SSH/runtime/provider/agent behavior changed; this is renderer layout-only.

Made with Orca 🐋

Screenshots

  • Latest validation screenshot captured locally at validation-screenshots/worktree-lineage-level-2-indent.png and intentionally not committed.

AI Review Report

  • Addressed CodeRabbit's actionable nit by documenting why folder-workspace lineage forces the in-card geometry contract.
  • Cross-platform impact is renderer layout-only; no keyboard, shell, path, SSH transport, or provider-specific behavior changed.

Security Audit

  • No security-sensitive code paths changed. The updates are limited to sidebar layout geometry and focused tests.

Notes

  • Preserves the pre-refactor level-1 lineage anchor while keeping nested descendants on the immediate-parent step.
  • Synthetic Electron validation used a seeded in-memory sidebar state; expected access-denied console noise came from the fake repo path, not the layout code.

@ghost

ghost commented Jun 18, 2026 •

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 5 individual chapters for you:

Title
1 Centralize lineage indentation logic and geometry
2 Update WorktreeCard to accept external lineage styles
3 Wire lineage geometry into WorktreeList
4 Apply lineage geometry to right-sidebar panel
5 Update integration tests for lineage indentation
Open in Stage

Chapters generated by Stage for commit bda2d2d on Jun 18, 2026 7:02am UTC.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b9a53975-b7a0-4ede-b6f5-e9b5c8d9941e

📥 Commits

Reviewing files that changed from the base of the PR and between 7e7799b and bda2d2d.

📒 Files selected for processing (1)
  • src/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.tsx

📝 Walkthrough

Walkthrough

The PR introduces new exported constants (WORKTREE_CARD_SURFACE_MARGIN, LINEAGE_IMMEDIATE_PARENT_STEP, LINEAGE_NESTED_ROW_SURFACE_INSET, LINEAGE_CHILDREN_INLINE_OFFSET) and three helper functions (getLineageNestedRowGeometry, getLineageChildrenInlineStyle, getLineageEffectiveChildStart) to worktree-list-indentation.ts for computing multi-level worktree lineage layout. WorktreeCard gains an optional lineageChildrenStyle prop, replacing its internal style derivation with caller-supplied values. Both WorktreeList and FolderWorkspaceWorktreesPanel are updated to call the new helpers and pass lineageChildrenStyle through to WorktreeCard. Tests are extended to cover three-level lineage scenarios and the new geometry invariants.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fixing nested workspace card indentation in the experimental worktree card lineage layout.
Description check ✅ Passed The description covers the core changes and includes screenshots/testing sections, but lacks visual change details and incomplete testing checklist documentation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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

🧹 Nitpick comments (1)
src/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.tsx (1)

60-63: ⚡ Quick win

Add a short “Why” comment for the hard-coded experimental lineage mode.

Line 61 forces experimentalNewWorktreeCardStyle: true; this is a non-obvious constraint and should be documented inline so future edits don’t “fix” it incorrectly.

Suggested patch
     const lineageGeometry = getLineageNestedRowGeometry({
+      // Why: folder-workspace lineage uses the in-card geometry contract
+      // regardless of the main sidebar experimental toggle.
       experimentalNewWorktreeCardStyle: true,
       inheritedCardContentIndent: 0,
       lineageDepth: ancestorIds.size
     })

As per coding guidelines, “When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does.”

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 637acd74-dc38-4438-95b6-e23711045f15

📥 Commits

Reviewing files that changed from the base of the PR and between 06d674b and e746970.

📒 Files selected for processing (7)
  • src/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.test.tsx
  • src/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.tsx
  • src/renderer/src/components/sidebar/WorktreeCard.tsx
  • src/renderer/src/components/sidebar/WorktreeList.lineage-child-real-card.test.tsx
  • src/renderer/src/components/sidebar/WorktreeList.tsx
  • src/renderer/src/components/sidebar/worktree-list-indentation.test.ts
  • src/renderer/src/components/sidebar/worktree-list-indentation.ts

@brennanb2025
brennanb2025 merged commit 048fc8c into main Jun 18, 2026
1 check passed
@brennanb2025
brennanb2025 deleted the brennanb2025/fix-worktree-card-indent branch June 18, 2026 07:16
carlosbaraza added a commit to carlosbaraza/orca that referenced this pull request Jun 18, 2026
* upstream/main: (220 commits)
  Show and Filter Automation-Created Workspaces (stablyai#5697)
  Fix premature project header truncation
  Send review notes to any running agent of a worktree (stablyai#5654)
  Fix workspace sidebar appearance setting (stablyai#5725)
  Highlight the open file in the Source Control sidebar (stablyai#5667)
  release: v1.4.80-rc.1
  Fix premature Codex completion notifications (stablyai#5682)
  Improve Codex startup prompt reliability (stablyai#5686)
  Keep hibernated agent completions visible (stablyai#5689)
  Move Prompt Cache Timer setting to Agents pane, simplify expired state (stablyai#5691)
  release: v1.4.80-rc.0
  Skip GitHub CLI preflight checks if no GitHub projects exist
  fix: restore font family keyboard navigation in settings
  Update README downloads badge
  fix(landing): make GitHub CLI setup nudge dismissible and provider-aware (stablyai#5688)
  Fix nested workspace card indentation (stablyai#5684)
  Fix flaky e2e tests (stablyai#5680)
  Replace plus icon with play button on quick command entry (stablyai#5674)
  Use managed Pi and OMP extensions (stablyai#5681)
  Narrow computer-use e2e trigger (stablyai#5685)
  ...

# Conflicts:
#	mobile/src/terminal/TerminalWebView.tsx
#	mobile/src/terminal/terminal-webview-text-zoom.test.ts
carlosbaraza added a commit to carlosbaraza/orca that referenced this pull request Jun 18, 2026
* upstream/main: (78 commits)
  Show and Filter Automation-Created Workspaces (stablyai#5697)
  Fix premature project header truncation
  Send review notes to any running agent of a worktree (stablyai#5654)
  Fix workspace sidebar appearance setting (stablyai#5725)
  Highlight the open file in the Source Control sidebar (stablyai#5667)
  release: v1.4.80-rc.1
  Fix premature Codex completion notifications (stablyai#5682)
  Improve Codex startup prompt reliability (stablyai#5686)
  Keep hibernated agent completions visible (stablyai#5689)
  Move Prompt Cache Timer setting to Agents pane, simplify expired state (stablyai#5691)
  release: v1.4.80-rc.0
  Skip GitHub CLI preflight checks if no GitHub projects exist
  fix: restore font family keyboard navigation in settings
  Update README downloads badge
  fix(landing): make GitHub CLI setup nudge dismissible and provider-aware (stablyai#5688)
  Fix nested workspace card indentation (stablyai#5684)
  Fix flaky e2e tests (stablyai#5680)
  Replace plus icon with play button on quick command entry (stablyai#5674)
  Use managed Pi and OMP extensions (stablyai#5681)
  Narrow computer-use e2e trigger (stablyai#5685)
  ...

# Conflicts:
#	mobile/app/h/[hostId]/session/[worktreeId].tsx
#	mobile/src/terminal/TerminalWebView.tsx
#	mobile/src/terminal/terminal-webview-html.ts
carlosbaraza added a commit to carlosbaraza/orca that referenced this pull request Jun 18, 2026
* upstream/main: (220 commits)
  Show and Filter Automation-Created Workspaces (stablyai#5697)
  Fix premature project header truncation
  Send review notes to any running agent of a worktree (stablyai#5654)
  Fix workspace sidebar appearance setting (stablyai#5725)
  Highlight the open file in the Source Control sidebar (stablyai#5667)
  release: v1.4.80-rc.1
  Fix premature Codex completion notifications (stablyai#5682)
  Improve Codex startup prompt reliability (stablyai#5686)
  Keep hibernated agent completions visible (stablyai#5689)
  Move Prompt Cache Timer setting to Agents pane, simplify expired state (stablyai#5691)
  release: v1.4.80-rc.0
  Skip GitHub CLI preflight checks if no GitHub projects exist
  fix: restore font family keyboard navigation in settings
  Update README downloads badge
  fix(landing): make GitHub CLI setup nudge dismissible and provider-aware (stablyai#5688)
  Fix nested workspace card indentation (stablyai#5684)
  Fix flaky e2e tests (stablyai#5680)
  Replace plus icon with play button on quick command entry (stablyai#5674)
  Use managed Pi and OMP extensions (stablyai#5681)
  Narrow computer-use e2e trigger (stablyai#5685)
  ...

# Conflicts:
#	src/renderer/src/i18n/locales/en.json
#	src/renderer/src/i18n/locales/es.json
#	src/renderer/src/i18n/locales/ja.json
#	src/renderer/src/i18n/locales/ko.json
#	src/renderer/src/i18n/locales/zh.json
carlosbaraza added a commit to carlosbaraza/orca that referenced this pull request Jun 18, 2026
* upstream/main: (341 commits)
  Show and Filter Automation-Created Workspaces (stablyai#5697)
  Fix premature project header truncation
  Send review notes to any running agent of a worktree (stablyai#5654)
  Fix workspace sidebar appearance setting (stablyai#5725)
  Highlight the open file in the Source Control sidebar (stablyai#5667)
  release: v1.4.80-rc.1
  Fix premature Codex completion notifications (stablyai#5682)
  Improve Codex startup prompt reliability (stablyai#5686)
  Keep hibernated agent completions visible (stablyai#5689)
  Move Prompt Cache Timer setting to Agents pane, simplify expired state (stablyai#5691)
  release: v1.4.80-rc.0
  Skip GitHub CLI preflight checks if no GitHub projects exist
  fix: restore font family keyboard navigation in settings
  Update README downloads badge
  fix(landing): make GitHub CLI setup nudge dismissible and provider-aware (stablyai#5688)
  Fix nested workspace card indentation (stablyai#5684)
  Fix flaky e2e tests (stablyai#5680)
  Replace plus icon with play button on quick command entry (stablyai#5674)
  Use managed Pi and OMP extensions (stablyai#5681)
  Narrow computer-use e2e trigger (stablyai#5685)
  ...

# Conflicts:
#	src/main/text-generation/commit-message-text-generation.test.ts
#	src/main/text-generation/commit-message-text-generation.ts
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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