Skip to content

feat(source-control): add source control tree view - #1658

Merged
brennanb2025 merged 6 commits into
stablyai:mainfrom
MuathJ:feat/source-control-tree-view
May 16, 2026
Merged

brennanb2025 merged 6 commits into
stablyai:mainfrom
MuathJ:feat/source-control-tree-view

Conversation

@MuathJ

@MuathJ MuathJ commented May 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds a Source Control tree/list toggle for uncommitted changes, staged changes, untracked files, and the Committed on Branch list.
  • Brings directory rows in the Source Control tree view up to parity with file rows for staging, unstaging, and reverting changes where those actions apply.
  • Improves Source Control action responsiveness by refreshing active git status immediately after successful git operations.
  • Fixes tooltip/action-button behavior and preserves full icon-button hit targets.
  • Adds deterministic lucide file-type icons across file-list surfaces, including Source Control, Explorer, Quick Open, editor tabs, tab drag previews, search result headers, the remote file browser, and the worktree symlink picker.

Screenshots

  • Source Control flat list view
image
  • Source Control tree view
image
  • Directory-row hover actions
image
  • File-type icons
image
image

Testing

  • pnpm lint
    • Passed with 6 existing React hook warnings in GitHub project components.
  • pnpm typecheck
    • Passed.
  • pnpm test
    • Default parallel run after pulling latest orca/main failed in unrelated timing/resource-sensitive tests:
      • src/cli/orchestration.subprocess.test.ts
      • src/relay/git-handler-staging.test.ts
      • src/relay/git-handler.test.ts
      • src/main/attribution/terminal-attribution.test.ts
      • src/main/daemon/node-pty-fd-leak.test.ts
    • Full serial Vitest run passed:
pnpm exec vitest run --config config/vitest.config.ts --no-file-parallelism --maxWorkers=1 --maxConcurrency=1
  • Result: 406 test files passed, 4,880 tests passed, 9 skipped.
  • pnpm build
    • Passed. The build still prints the existing non-fatal /usr/local/bin/orca-dev permission note.
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed
    • Added Source Control tree builder tests for path grouping, conflict-first ordering, collapsed directory flattening, and descendant file collection for directory actions.
    • Added Source Control tree builder coverage for committed branch entries with branch-scoped directory keys.
    • Added file-type icon resolver tests for known filenames, common extensions, compound archives, media, security/data files, and fallback behavior.
    • Added ActionButton coverage for full-box hover and click target behavior.

Additional focused verification:

pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/right-sidebar/source-control-tree.test.ts src/renderer/src/components/right-sidebar/ActionButton.test.tsx src/renderer/src/components/right-sidebar/useSourceControlSelection.test.ts

Result: passed, 3 test files, 17 tests.

Additional targeted check:

pnpm exec oxlint src/renderer/src/components/right-sidebar/SourceControl.tsx src/renderer/src/components/right-sidebar/source-control-tree.ts src/renderer/src/components/right-sidebar/source-control-tree.test.ts
pnpm exec tsgo --noEmit -p config/tsconfig.tc.web.json

Result: passed.

AI Review Report

Reviewed the staged diff against AGENTS.md, .github/CONTRIBUTING.md, and docs/STYLEGUIDE.md.

Main risks checked:

  • Cross-platform path handling: Source Control tree grouping normalizes relative paths and uses existing path splitting behavior; the file icon resolver supports both / and \ separators.
  • Cross-platform shortcut behavior: Source Control multi-select now uses a guarded runtime platform check, choosing metaKey on macOS and ctrlKey elsewhere.
  • SSH behavior: file-type icons are deterministic from filenames/extensions instead of OS-native file associations, so local and SSH worktrees render consistently.
  • Design-system compliance: UI changes use lucide icons, shadcn Button styling, token-based colors, and the existing tooltip primitive.
  • Tooltip behavior: removed newly added local tooltip providers where the app-level provider should handle timing, kept tooltip content non-interactive, and preserved full icon-button hit targets.
  • Tab drag preview behavior: editor drag icons now resolve from the actual file path rather than rendered labels like file.ts (diff).
  • Source Control tree coverage: the tree/list toggle now applies to the Committed on Branch list as well as uncommitted sections.
  • Sorting behavior: uncommitted tree sections keep conflict-first ordering through the git-status-specific tree builder; committed branch trees sort by path.

Changes made from the review:

  • Replaced a hardcoded remote-browser folder color with text-muted-foreground.
  • Removed redundant local TooltipProvider wrappers from the Source Control compare toolbar.
  • Added iconPath to tab drag data so editor drag previews choose file icons from real paths.
  • Added short comments explaining why the tree builder is entry-shape generic and why uncommitted trees use conflict-first sorting.
  • Addressed the latest review pass; no discrete correctness issue was found in the staged diff.

Security Audit

  • No new IPC channels were added.
  • No new shell command construction was added.
  • Directory actions reuse existing git stage, unstage, discard, and revert flows with existing path filtering and conflict-safety rules.
  • Committed-on-branch directory rows are read-only expand/collapse rows; file rows keep the existing committed diff and reveal behavior.
  • Immediate status refresh uses the existing window.api.git.status call with the active worktree's existing connection ID.
  • File icon resolution is local, deterministic string matching only; it does not read arbitrary files, inspect OS file associations, make network calls, or execute commands.
  • Tooltip and button changes are UI-only and do not expand filesystem, network, auth, or secret access.

No security follow-up is needed from this change.

@MuathJ MuathJ changed the title feat: add source control tree view feat(source-control): add source control tree view May 10, 2026
@AmethystLiang

Copy link
Copy Markdown
Contributor

Tree view is a good idea! Thx for the PR. We might modify the UI a bit before landing them. cc @brennanb2025

MuathJ and others added 4 commits May 15, 2026 12:18
…ree-view

# Conflicts:
#	src/renderer/src/components/sidebar/useWorktreeAgentRows.test.ts
#	src/renderer/src/components/sidebar/useWorktreeAgentRows.ts
@brennanb2025
brennanb2025 force-pushed the feat/source-control-tree-view branch from 66ef634 to 61c4507 Compare May 15, 2026 21:10
brennanb2025 and others added 2 commits May 15, 2026 17:55
…ree-view

# Conflicts:
#	src/renderer/src/components/right-sidebar/SourceControl.tsx
@brennanb2025
brennanb2025 merged commit e6ced0a into stablyai:main May 16, 2026
2 checks passed
@AmethystLiang

Copy link
Copy Markdown
Contributor

@MuathJ this is now in the latest release. Made some slight modification to make the tree view more on the left
image
thx again for the PR!

@MuathJ

MuathJ commented May 17, 2026

Copy link
Copy Markdown
Contributor Author

@MuathJ this is now in the latest release. Made some slight modification to make the tree view more on the left
thx again for the PR!

That's great to hear, UI looks nice, thanks.
I also have another open PR #1690 if you've any feedback on it.

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.

3 participants