Skip to content

feat: group worktrees by name across repos with rename support#20

Merged
malaporte merged 3 commits into
mainfrom
group-by-branch-name
Jul 1, 2026
Merged

feat: group worktrees by name across repos with rename support#20
malaporte merged 3 commits into
mainfrom
group-by-branch-name

Conversation

@malaporte

Copy link
Copy Markdown
Owner

Summary

Adds a new view mode that groups worktrees from multiple repositories when they share the same directory name, making it easy to see related work across repos at a glance. Also adds the ability to rename worktrees (move their directory on disk via git worktree move).

Changes

  • View toggle: SegmentedControl in the header switches between "Repos" (existing) and "Names" (new grouped view)
  • NameGroupDashboard: New component that collects worktrees from all repos, groups them by directory name, and renders collapsible sections
  • Repo badge on cards: In the name-grouped view, each card shows a gray badge with the repo name for easy identification
  • Rename worktree: New pencil icon on worktree cards opens a modal to rename the worktree directory (git worktree move)
  • Backend: New renameWorktree service function and git:renameWorktree RPC channel

Testing

  • All 68 existing tests pass with the new viewMode and onRenamed props added to test fixtures
  • Typecheck passes cleanly
  • Manual verification: toggle between views, search filtering works in both modes, rename validates input (no slashes, non-empty, must differ from current)

Reviewer Notes

  • The name-grouped view uses invisible RepoLoader sub-components (one per repo) to call useWorktrees since React hooks can't be called dynamically. Data flows up via callbacks to the parent which computes the groups.
  • Drag-and-drop reordering only applies to the Repos view (not meaningful for auto-grouped names).
  • View mode state is ephemeral (resets on app restart). Can be persisted in AppConfig later if desired.

@malaporte malaporte marked this pull request as ready for review July 1, 2026 08:57
@malaporte malaporte merged commit 1528fac into main Jul 1, 2026
2 checks passed
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.13.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant