Skip to content

Add a user-facing Cancel control for the scenario Open-from-folder scan #656

Description

@jschick04

Context

The scenario "Open from folder" flow (ScenarioLaunchService.LaunchFromFolderAsync) now plumbs a CancellationToken through the off-thread folder enumeration and the parallel per-file channel probe. Cancellation is currently wired to the dashboard's component lifetime: EmptyStateDashboard owns a CancellationTokenSource that is cancelled and disposed in DisposeAsyncCore, so an in-flight scan is abandoned when the user navigates away from or closes the dashboard.

Follow-up

There is no in-place way for the user to cancel a scan while remaining on the dashboard. For a large or slow (for example, network) folder, the only escape today is to navigate away. Add a user-reachable Cancel affordance:

  • A per-launch CancellationTokenSource linked to the lifetime token (CancellationTokenSource.CreateLinkedTokenSource), so a single launch can be cancelled independently of disposal.
  • A visible Cancel control (and/or progress/busy indication) shown while RunGuardedAsync is busy on a folder launch.
  • Tests covering user-initiated cancellation (Cancelled outcome, no logs opened, no filter dispatch).

Origin

Deferred from the folder-launch cancellation change after a review panel: 3 of 4 reviewers considered lifetime-only cancellation sufficient to ship; one reviewer recommended a user-facing Cancel affordance. The product decision was to ship lifetime-only cancellation now and track the affordance here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions