feat(desktop): promote worktrees & submodules to header + harden worktree engine#35
feat(desktop): promote worktrees & submodules to header + harden worktree engine#35t1gu1 wants to merge 14 commits into
Conversation
|
@devlint I feel like we could almost keep it hide in the BranchMenu "Advanced" just because i think it dont works as flawlessly as it should. WDYT? But submodules seems to works fine for what I test of it. |
|
Hey @t1gu1 — totally agree with the "hub" framing, keeping both buttons in the header. ✅ While reviewing I took the opportunity to harden the worktree engine alongside your UI changes. Here's what was updated:
Feel free to take a look — happy to merge once you're good with it. |
2defce5 to
bf974de
Compare
Move worktree and submodule actions out of the BranchMenu "Advanced" accordion into standalone header buttons, matching tags/stash visibility. Removes the accordion disclosure pattern from BranchMenu entirely. 🪄 Commit via GitWand
🪄 Commit via GitWand
…ree' button This change streamlines the worktree management interface by removing the dedicated cleanup and prune functionalities. The primary 'New Worktree' action is now repositioned to the modal footer with a distinct style for improved prominence and user experience.
Enrich WorktreeEntry and WorkspaceRepoStatus with lock reason, prunable state, upstream presence and conflict count; fix porcelain parser and return real HEAD on add. Surface prune action, prunable alerts, conflict pills and remote branches in WorktreeManager, with matching i18n keys. 🪄 Commit via GitWand
Extract pure parsing helpers from ops.rs into a TS module so the porcelain, status, and quick-path derivation logic can be covered by vitest without a real git repo or Tauri runtime. 🪄 Commit via GitWand
Silently runs `git worktree repair` when the manager opens to recover from repos moved manually on disk. Idempotent and near-free when the links are already valid. 🪄 Commit via GitWand
Automatically creates missing parent directories when adding a new worktree, preventing `git worktree add` failures.
Derives new worktree paths into a dedicated `.{main}.worktrees` directory for better organization.
Pre-fills the worktree path in the UI based on the selected or new branch.
…data WorktreeManager and SearchPalette now emit events on mount to trigger a refresh of relevant data (branches, repository log) from the parent `App.vue`. This prevents stale information from being displayed if data has changed while these components were not active.
Branches already associated with an existing worktree are now disabled in the branch selection dropdown and marked as 'already in use'. This prevents accidental creation of duplicate worktrees and improves user guidance. The manual path input field has also been removed from the creation form, as worktree paths are now automatically derived and pre-filled, simplifying the user interface.
Introduces a new icon to visually mark branches that are currently checked out in a Git worktree. This enhances visibility in the branch selector, commit graph, and search palette, providing better context for repository management.
Previously, Git command failures in the backend would often return generic error messages (e.g., "Command failed with exit code 1"). This change updates the backend to capture and return the `stderr` output from executed Git commands, which typically contains much more informative error details directly from Git. The frontend now consumes these richer error messages, allowing for more specific and user-friendly error feedback. A dedicated translation has been added to handle cases where a user attempts to switch to a branch already checked out in another worktree. This significantly improves the diagnostic clarity for users encountering Git-related issues.
a8ea22d to
10364d8
Compare
|
@devlint I just fix the conflict. ✅ |




Changes
lock_reason,prunablestatus,is_mainattributegitWorktreeAdd: return real HEAD SHA instead of empty stringhas_upstreamgitWorktreeRepairAPI (Rust + TS), called silently on modal mount