Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: prevent UI lockup when deleting a branch#25

Merged
wesbillman merged 1 commit intomainfrom
delete-branch-lockup
Feb 10, 2026
Merged

fix: prevent UI lockup when deleting a branch#25
wesbillman merged 1 commit intomainfrom
delete-branch-lockup

Conversation

@wesbillman
Copy link
Collaborator

Problem

Deleting a branch blocks the main thread because delete_branch runs synchronous git worktree removal on the Tauri main thread. This causes the UI to freeze until the operation completes.

Solution

Backend

  • Make delete_branch a Tauri async command so the git worktree removal runs on a background thread instead of blocking the main thread.

Frontend

  • Add a deleting state that shows a spinner overlay on the branch card while the backend operation runs.
  • The confirm dialog dismisses immediately after the user confirms.
  • The branch card shows a "Deleting…" spinner overlay while the async operation is in progress.
  • On success, the card is removed from the list.
  • On failure, the deleting state is cleared and the card returns to normal.

Changes

  • src-tauri/src/lib.rs — Mark delete_branch as async
  • src/lib/BranchCard.svelte — Accept deleting prop, render spinner overlay when active
  • src/lib/ProjectHome.svelte — Track deletingBranches set, manage async delete lifecycle
  • src/lib/ProjectSection.svelte — Pass deletingBranches through to BranchCard

Make delete_branch a Tauri async command so the git worktree removal
runs on a background thread instead of blocking the main thread.

On the frontend, add a 'deleting' state that shows a spinner overlay
on the branch card while the backend operation runs. The confirm dialog
dismisses immediately, the card shows 'Deleting…', and the card is
removed from the list on success. On failure the deleting state is
cleared so the card returns to normal.
@wesbillman wesbillman merged commit 4d61f2f into main Feb 10, 2026
2 checks passed
@wesbillman wesbillman deleted the delete-branch-lockup branch February 10, 2026 23:40
loganj added a commit that referenced this pull request Feb 26, 2026
Add In Review section to project page
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