Skip to content

feat: show a busy spinner during slow TUI git operations#18

Merged
xico42 merged 1 commit into
mainfrom
feat/show-progress
Jul 6, 2026
Merged

feat: show a busy spinner during slow TUI git operations#18
xico42 merged 1 commit into
mainfrom
feat/show-progress

Conversation

@xico42

@xico42 xico42 commented Jul 6, 2026

Copy link
Copy Markdown
Owner

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.

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>
@xico42 xico42 merged commit f08f27d into main Jul 6, 2026
7 checks passed
@xico42 xico42 deleted the feat/show-progress branch July 6, 2026 00:23
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