perf: parallelize onMount calls and show loading spinner in NewBranchModal#92
Merged
perf: parallelize onMount calls and show loading spinner in NewBranchModal#92
Conversation
The New Branch dialog previously ran detectDefaultBranch and listGitBranches sequentially in onMount, causing a visible pause before the dialog content appeared. - Use Promise.allSettled to fetch both in parallel - Add a loading state with a spinner shown while data is being fetched - Add .loading-state CSS for centered spinner layout
The New Branch dialog still blocked the UI because: 1. list_git_branches and detect_default_branch_cmd were synchronous Tauri commands (fn, not async fn), which run on the main thread and freeze the entire window until they return. 2. list_branches() called `git remote prune origin` on every open — a network operation that adds significant latency to what should be a fast local operation. Changes: - Make list_git_branches and detect_default_branch_cmd async so they run on Tauri's async thread pool instead of the main thread - Extract `git remote prune origin` into a separate prune_remote() function and expose it as a new prune_remote_refs Tauri command - Call pruneRemoteRefs as fire-and-forget in the background after the dialog has loaded, then silently refresh the branch list when done - Errors from pruning are silently ignored (best-effort, e.g. no network or no remote configured)
wesbillman
approved these changes
Feb 13, 2026
loganj
pushed a commit
that referenced
this pull request
Feb 26, 2026
* fix: add Rust/cargo check to ensure-deps Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix: export ~/.cargo/bin in PATH so all recipes see cargo after install Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix: use CARGO_HOME to locate cargo bin dir Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Parallelizes the two async calls in the NewBranchModal's
onMount(detectDefaultBranchandlistGitBranches) usingPromise.allSettledinstead of sequential awaits. Adds a loading state with a spinner so the modal body isn't rendered until initialization completes.Changes:
detectDefaultBranchandlistGitBranchesin parallel viaPromise.allSettledloadingstate variable that gates the modal body content.loading-stateCSS for the spinner display