-
-
Notifications
You must be signed in to change notification settings - Fork 683
Git branch flow improvements #370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Rewrite checkout, create, delete, and merge branch operations to use the git CLI instead of git2 library - This fixes the 'cannot locate local branch' error when checking out remote branches that haven't been fetched yet, since git CLI handles this automatically - Remove merge.rs and unused get_branch_by_name helper - Make branch functions async to match other git operations
Git dropdown: - Add branch rename functionality - Add 'New Branch...' option in branch submenus (creates from selected branch) - Add delete remote branch functionality - Branch submenus now open on click instead of hover - Add ellipses to menu items that open dialogs (View History..., etc.) - Fix 'UNKNOWN' branch flash while loading Dropdown component: - Add submenuOpenOnClick option for click-to-open submenus - Submenus now close entire menu hierarchy when item selected - Submenus flip upward when near bottom of screen - Filter cleared when dropdown opens useFastMutation: - Default onSuccess/onError callbacks now run alongside custom ones
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates git branch operations from libgit2 to the git CLI binary and significantly enhances the Git dropdown UI with new features including branch submenus with contextual actions.
Changes:
- Migrated git operations (checkout, create branch, delete branch, merge, rename) from libgit2 to git binary
- Added new git operations: rename branch, delete remote branch, create branch from a specific base
- Enhanced Git dropdown with branch submenus containing contextual actions (checkout, merge, new branch, rename, delete)
- Improved dropdown component with click-to-open submenu support and better positioning logic
- Updated callback handling in useFastMutation to run both default and custom callbacks
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src-web/hooks/useFastMutation.ts | Modified callback handling to execute both default and custom callbacks sequentially |
| src-web/components/git/GitDropdown.tsx | Replaced top-level git actions with branch-specific submenus, added new branch operations (rename, delete remote), removed old branch management UI |
| src-web/components/core/Dropdown.tsx | Added submenuOpenOnClick feature, onCloseAll callback propagation, filter clearing on open, and improved submenu positioning |
| crates/yaak-git/src/util.rs | Removed unused get_branch_by_name function |
| crates/yaak-git/src/merge.rs | Deleted entire file as merge logic is now handled by git binary |
| crates/yaak-git/src/lib.rs | Removed merge module, updated exports to include new branch operations and BranchDeleteResult type |
| crates/yaak-git/src/branch.rs | Rewrote all branch operations to use git CLI instead of libgit2, added git_rename_branch and git_delete_remote_branch functions |
| crates/yaak-git/index.ts | Updated TypeScript bindings for new branch operations API signatures |
| crates/yaak-git/bindings/gen_git.ts | Added BranchDeleteResult TypeScript type definition |
| crates-tauri/yaak-app/src/lib.rs | Registered new git commands for rename and delete remote branch |
| crates-tauri/yaak-app/src/git_ext.rs | Added command handlers for new branch operations, updated signatures to match new async functions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR adds cloning, ports git branch operations from libgit2 to use the git binary directly, and significantly enhances the Git dropdown with new features and UX improvements.
Git Clone
It is now possible to clone a new repository into Yaak, instead of having to clone via CLI and open in Yaak.

Git Operations
git branch -m)git push origin --delete)git branch <name> <base>)Git Dropdown Enhancements