Skip to content

Capture batch: one progress bar from start to end, with each step in plain words and Done in at the end (#952) - #1025

Merged
ccoventry merged 4 commits into
devfrom
fix/capture-progress-bar-952
Oct 25, 2026
Merged

ccoventry merged 4 commits into
devfrom
fix/capture-progress-bar-952

Conversation

@ccoventry

Copy link
Copy Markdown
Owner

Release note: Fixed: The capture batch's progress bar fills once from start to end and says each step in plain words ("Getting demos ready", "Starting the game", "Loading…", "Capturing clip 3 of 12", "Checking the takes"), with a clock and "Done in 6 min 12 s: 12 clips captured" at the end.

Closes #952 (from the #942 audit).

What changes

  • One bar for the whole batch. Getting the demos ready fills the first tenth, the clips the rest (10–98%), and checking the takes the last bit. The bar never goes backwards, and the made-up 50% is gone.
  • A step it can't measure keeps the fill and slides a block over that step's share: the decal pass while a demo is patched, starting the game, loading a demo, and the clip being recorded (the block covers the next clip's share).
  • Plain step lines. These come from messages.rs, with the step texts from the plan:
    • "Getting demos ready…" shows the moment the batch starts.
    • "Reading name.dem again for its clip times (1 of 3)".
    • "Getting demos ready: 2 of 5 (name.dem, 40%)". "Patching" and "clearing decals" are gone.
    • "Starting the game for name.dem (demo 1 of 3)".
    • "Loading name.dem…". This comes from the DEMO_START marker, which used to reach only OS notifications.
    • "Capturing clip 3 of 12 (name.dem) · about 4 min left".
    • "Checking the takes: 12 of 12".
  • A clock runs on the line (· m:ss) from the first report to the end.
  • The end line: "Done in 6 min 12 s: 12 clips captured", or "10 of 12 clips captured" when some takes are missing. A cancelled or failed batch reads as before.
  • The activity log gets [capture] started and [capture] completed after 372.0 s: 12 of 12 clip(s) captured.

How

  • Backend (Rust): every running capture_status now carries a stage (preparing, reading_again, starting, loading, capturing, checking) and its count. The patch line keeps its ~33 ms throttle (PatchProgress), and the take check is throttled the same way.
  • Takes are checked before the batch reports its end. The order is now: "Checking the takes" → running: false with clips_captured/clips_total → capture_takes_verified. Start stays greyed out through the check, and the footer's last line still comes before what Finish clips puts on it.
  • Frontend: the logic lives in a new module, capture_progress.js (shares, the never-go-back rule, the end line, the clock and the time left). capture_pane.js only calls it, and its own 50% fallback and 15 s timer are gone.
  • Shared pieces:

Decisions

Other open PRs touching the same files

Test done

  • cargo test --locked -p desktop-studio: 236 passed. New tests cover the getting-ready line and the step texts.
  • rustup run 1.98.1 cargo clippy --locked -p desktop-studio --all-targets -- -D warnings: clean. rustup run 1.98.1 cargo fmt --all: no changes.
  • npm run test:unit: 864 passed. New: capture_progress.test.js (the shares, the never-go-back rule across a whole batch, the end line, the clock and the log lines) and durationWords.
  • Playwright (CI=1): capture-progress.spec.js (new), capture-precheck, finish-clips, batch-results and app-boot: 19 passed. The new spec has the e2e check the plan asks for: the bar never goes backwards across the stages and ends at 100% on "Done in". It also checks the sliding block and the cancelled line.
  • No live batch was run (an unattended pass, no game).

Test steps for you (no hook DLL change, either install)

  1. A batch that seeks between clips (the default), 2+ demos, 3+ clips, on PRE:
    • Start Capture Batch: after the checks, the line says "Getting demos ready…" with a block sliding over the start of the bar.
    • The game starting: "Starting the game for X.dem (demo 1 of N)".
    • Each demo: "Loading X.dem…".
    • Each clip: "Capturing clip k of N (X.dem) · about … left · m:ss". The bar fills by clips and a block slides over the clip being recorded.
    • After the game closes: "Checking the takes: N of N", then "Done in … : N clips captured". The bar never jumps back at any point.
  2. The same with Seek Between Clips off (a patched batch): "Getting demos ready: 1 of N (X.dem, 40%)" fills the first tenth, then the clips carry on from there without dropping to 0.
  3. Cancel partway: the line says "Cancelled" and the bar empties.
  4. The activity log: it has [capture] started and [capture] completed after … s: … clip(s) captured.

🤖 Generated with Claude Code

… Done in (#952)

The footer bar no longer fills once for getting the demos ready and again
for the clips, and never shows a made-up 50%. Each capture_status now
carries a stage; capture_progress.js puts getting ready on the first tenth
and the clips on the rest, holds the fill so it never goes back, and slides
a block over a step it can't measure (starting the game, loading a demo,
the clip being recorded). The lines are plain ("Getting demos ready: 2 of 5
(name.dem, 40%)", "Starting the game for name.dem (demo 1 of 3)",
"Loading name.dem…", "Capturing clip 3 of 12 (name.dem)", "Checking the
takes: 12 of 12"), a clock runs on the line, the end says "Done in 6 min
12 s: 12 clips captured", and [capture] start and end go to the log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ccoventry and others added 2 commits October 25, 2026 01:11
A Cancel resolves before the game closes and clears capturingInFlight, so
the take check's running reports re-entered the first-report branch: they
re-enabled Cancel and reset Last Batch. The progress module knows the batch
is still running; Cancel is greyed out for the check, which can't be stopped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ccoventry

Copy link
Copy Markdown
Owner Author

Review (night pass 2026-10-25)

Read: the whole diff: the Rust (PatchProgress, check_takes/finish_batch, the step lines) and capture_progress.js, capture_pane.js, step_bar.js and progress_view.js.

  • main.js is untouched.
  • Every capture_status comes from the blocking or listener threads.
  • The take check is throttled to 33 ms.
  • log_frontend_event already has its .catch.
  • DEMO_START's 1-based index counts only jobs with clips (the primer has none), so demo_names lines up for both patched and hook-run batches.

Found and fixed: Cancel came back on while the takes were checked (d47417ab).

  • The Cancel click's .then clears capturingInFlight straight away, before the game closes. The check that follows sends running: true ("Checking the takes"), so it re-entered the "first report of a batch" branch.
  • That branch turned Cancel back on and called batchStarted() again.
  • On a normal end, Cancel was also on during the check, which can't be stopped.
  • Fix: a running report starts a batch only when captureProgress isn't already running one, and Cancel is greyed out for the checking stage.
  • Test: a new e2e test in capture-progress.spec.js. It fails without the fix.

Ran (after merging dev in, head 955aa269):

  • cargo test --locked -p desktop-studio: 236 pass.
  • Pinned clippy and fmt: clean.
  • npm run test:unit: 864 pass.
  • Playwright: capture-progress, capture-precheck, finish-clips, batch-results and app-boot, 20 pass.
  • CI is green.

Screenshots: from the harness, with Studio's CSS, one per step from "Getting demos ready…" to "Done in": local\review-images\952\. The real app wasn't driven: a capture batch can't be faked there, and another dev server holds port 5173.

#885 conflict, for whichever merges second: git merges the two cleanly, but the build then fails. #885's new test calls verify_capture_takes(&manifest), and this PR gives that function a second argument. The fix is verify_capture_takes(&manifest, &mut |_| {}). I checked this with a trial merge plus cargo test --no-run. #885's rendered-and-deleted takes count as captured, so "Done in …: N clips captured" stays right after both land.

Left as is: "No jobs produced" is sent as running: false with no error. It used to read "Completed" and now reads "Done in 0.2 s". That path was already wrong before this PR, and it's rare.

Verdict: ready to merge. The look follows #952's plan.

@ccoventry
ccoventry merged commit 5451661 into dev Oct 25, 2026
5 checks passed
@ccoventry
ccoventry deleted the fix/capture-progress-bar-952 branch October 25, 2026 07:57
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.

Capture batch bar fills twice and sits at a made-up 50%: one bar with plain steps

1 participant