tui: a preview you can watch, a cancel that says so, and a scope you chose - #40
Merged
Merged
Conversation
…chose
Pressing p on a big local directory showed a bar stuck at 0% over an empty
list for as long as rsync took to walk the tree, and pressing esc ended it
with "Transfer stopped by signal SIGINT" in red. Neither was a fault. A dry
run transfers no bytes, so rsync's percentage is 0 by definition until the
end; and when the other side already matches, rsync prints nothing per file
at all. The panel's clock only advanced when rsync said something. And esc
does send SIGINT: the runner's generic wording for any signal exit was
landing in the panel as a failure.
Four changes:
- A preview counts files. rsync's `to-chk=remaining/total` is what moves
during a dry run; it now drives the bar (`checked ███ 1204/5300 files`),
with "N changes found so far" beside it. The clock runs off the wall from
the moment rsync starts, on a one-second timer, and stops when it stops,
so a silent walk still visibly takes time rather than looking dead.
- A preview that finds nothing says "Already in sync", with the count of
files it checked, instead of a full bar over an empty list.
- Esc is reported as a cancel, in the warning colour, with the reassurance
that stopping changed nothing on either side. It is detected from the
AbortController, not from rsync's exit, so a signal from anywhere else
is still a failure.
- Preview and sync cover the row under the cursor, mirrored to the same
relative path in the other pane: a directory to the directory of the
same name, a file into the directory that holds it, and the whole pane
only when nothing is under the cursor. The panel title says what
("Scanning src"), and `--mkpath` lets a nested target be created. After
a sync the other pane is re-read in place, keeping every unfolded
directory open, so the result appears under the rows that were already
showing; `r` uses the same refresh.
The scope is a pure function of the two panes and is tested on its own in
both directions. The interaction tests run the real rsync against two
directories under tmpdir: a scoped preview, an "already in sync" preview, a
single-file sync with the in-place refresh, and an esc that lands while a
4000-file dry run is still walking.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DWtLsmAescX4Nb8QiBJd37
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.
Pressing
pon a big local directory showed a bar stuck at 0% over an empty list, andescended it with "Transfer stopped by signal SIGINT" in red. Neither was a fault: a dry run transfers no bytes so rsync's percentage is 0 by definition, rsync prints nothing per file when the other side already matches, the panel's clock only advanced when rsync spoke, and esc does send SIGINT.to-chkdrives the bar (checked ███ 1204/5300 files) with "N changes found so far" beside it, and the clock runs off the wall on a one-second timer from start to stop.--mkpathlets nested targets be created, and after a sync the other pane is re-read in place with every unfolded directory kept open.ruses the same refresh.The scope is a pure function with its own tests in both directions. The interaction tests run the real rsync against two
tmpdirtrees: a scoped preview, an "already in sync" preview, a single-file sync with in-place refresh, and an esc landing mid-walk on 4000 files.Verified:
pnpm build,pnpm -r typecheck,pnpm test(636 tests).🤖 Generated with Claude Code
https://claude.ai/code/session_01DWtLsmAescX4Nb8QiBJd37