feat: show a busy spinner during slow TUI git operations#18
Merged
Conversation
The dashboard runs several git operations that can take seconds — creating a worktree, cloning a project, fetching a project's remote branches. Until each finished the TUI kept the previous screen on display with no sign of progress, so a slow clone or fetch looked like the dashboard had hung. Worse, keystrokes typed during that window were handled against soon-to-be-stale state, and the operations cannot be cancelled once dispatched. A single shared busy label now drives a centered animated spinner. While the label is set, View short-circuits to the spinner and overrides the current screen without mutating it, so the underlying view reappears untouched once the operation completes. An enterBusy helper sets the label and batches a spinner tick alongside the dispatched command, keeping the three slow sites — worktree-create submit, clone, and remote-branch fetch — identical and the tick loop self-terminating once busy clears. Every result message clears the label: the success paths for clone, create and fetch, plus errMsg, which leaves the underlying screen unchanged as before and merely stops the spinner. While busy, all input except quit is swallowed, since no key should mutate state that the pending result relies on and the git operation cannot be aborted anyway; quit still works so the user is never trapped. This replaces the remote picker's own ad-hoc "Fetching…" placeholder and its loading flag, which only covered one of the three slow paths, with the shared spinner that covers all of them. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
The dashboard runs several git operations that can take seconds — creating a worktree, cloning a project, fetching a project's remote branches. Until each finished the TUI kept the previous screen on display with no sign of progress, so a slow clone or fetch looked like the dashboard had hung. Worse, keystrokes typed during that window were handled against soon-to-be-stale state, and the operations cannot be cancelled once dispatched.
A single shared busy label now drives a centered animated spinner. While the label is set, View short-circuits to the spinner and overrides the current screen without mutating it, so the underlying view reappears untouched once the operation completes. An enterBusy helper sets the label and batches a spinner tick alongside the dispatched command, keeping the three slow sites — worktree-create submit, clone, and remote-branch fetch — identical and the tick loop self-terminating once busy clears.
Every result message clears the label: the success paths for clone, create and fetch, plus errMsg, which leaves the underlying screen unchanged as before and merely stops the spinner. While busy, all input except quit is swallowed, since no key should mutate state that the pending result relies on and the git operation cannot be aborted anyway; quit still works so the user is never trapped.
This replaces the remote picker's own ad-hoc "Fetching…" placeholder and its loading flag, which only covered one of the three slow paths, with the shared spinner that covers all of them.