2 months ago
f6b4e73#180 — cancel a running single-song separation: - Thread `cancel: &AtomicBool` into `inference::separate_streaming`, checked at the top of each chunk iteration; on cancel it returns `SeparationError::Cancelled` without finalizing writers, so no partial stem set or cache entry is promoted (aborted runs restart from chunk 0). - Add a per-song cancel registry (song_hash -> Arc<AtomicBool>) to SeparationState; jobs register on start and remove on exit on both paths. - New `cancel_separation(song_id)` command — a no-op success when the song is not currently separating. - Batch cancel now flags the in-flight song via `batch_current_song` so it stops mid-song instead of after the current track. - Cancelled jobs emit a `separation-cancelled` event and reset the row to idle — never `separation-error`, and no error toast. - UI: an x affordance beside the inline spinner on the running SongListItem row and on the single-song global progress bar. #181 — surface cache hits: `cache_hit` was already populated end-to-end but never shown. On a `separation-complete` event with cache_hit=true, show a lightweight "Using cached separation" toast. Downgrade sets cache_hit=false so the explicit downgrade action does not raise the cue. i18n: add library.cancelSeparation and library.usingCachedSeparation to en and zh-CN. Tests: inference-level cancellation (pre-set flag and mid-run), cancel-registry unit tests, and frontend tests for the cancel affordance, the cancelled event reducer, and the cache-hit toast. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Parent037a6e6