Skip to content

Add a Cancel button to long-running scans (Duplicates, Smart Scan) #3

@iliyami

Description

@iliyami

Right now if a user starts the Duplicates scan and it's taking too long, they have to force-quit. We should let them cancel cleanly.

Task

  1. In ScanCoordinator.swift, the cancel() method exists but isn't exposed in views.
  2. Add a small "Cancel" button next to the ScanProgressRing in:
    • SmartScanView.swift (scanning state)
    • DuplicatesView.swift (scanning state)
  3. The button should call appState.scanCoordinator.cancel() and transition back to .idle.

Acceptance criteria

  • Clicking Cancel during a scan returns to the idle view within 1 second
  • No crashes or orphan tasks

Files to change

  • Sources/MacClean/Views/SmartScan/SmartScanView.swift
  • Sources/MacClean/Views/Files/DuplicatesView.swift

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions