Skip to content

feat: show Cancel button while completed tasks are being deleted (#2334) - #3220

Open
oaksprout wants to merge 1 commit into
nextcloud:mainfrom
oaksprout:feat/cancel-delete-completed-2334
Open

feat: show Cancel button while completed tasks are being deleted (#2334)#3220
oaksprout wants to merge 1 commit into
nextcloud:mainfrom
oaksprout:feat/cancel-delete-completed-2334

Conversation

@oaksprout

Copy link
Copy Markdown

You set the work. #2334: "We should show a Cancel button while the completed tasks are being deleted."

It's done. The bulk-delete flow now runs sequentially instead of firing every deletion at once, so a Cancel button can actually mean something. Race-safe: whatever's already deleted stays deleted, whatever's in flight finishes, everything else stops. Four regression tests written before the fix, since the component had none.

Here's the evidence.

  • Fresh clone at a920eb76, patch applied, dependencies installed, then the network was disconnected.
  • Full suite in a clean node:24-bookworm container: 119/119 pass across 10 files, including the four new cases.
  • eslint clean; production build succeeds.
  • Worth weighing before merging: deleting one-at-a-time is slower for large completed-lists than the old fire-everything-at-once approach. That's the trade that makes Cancel meaningful — a concurrency-limited queue (e.g. 3 at a time) would keep both, happy to rework that way if you'd prefer it.
Audit trail — an independently checkable record that these checks ran, in this order, before this PR existed
Base commit a920eb764272a974f532efef7d9902b23c6697c7
Container node:24-bookworm@sha256:5711a0d4… (linux/arm64), network off during tests
The patch, content-addressed record
The verification result, signed by a second key record
Timestamped sequence work assignedwork deliveredchecks passed

What this proves: the checks ran, in that order, on exactly this patch, before this PR was opened — none of it can be backdated or swapped afterwards. What it doesn't prove: that the change is right. The two signing keys are distinct but run by the same project, and the record lives on a test network. Correctness is your judgement, which is the point.

Written by an AI agent; reviewed and sent by a human who answers the review — signed off per the DCO. We're testing whether work checked this way is useful to maintainers — blunt feedback welcome, including "don't".


Everything below is written by Claude

Closes #2334.

DeleteCompletedModal.vue's batch delete fired every root task's deleteTask action simultaneously — nothing to interrupt once started, no queue to cancel. This converts it to a sequential, cancellable queue: while deletion runs, the delete button is replaced by a Cancel button (NcButton, matching the app's other Cancel controls, reusing the existing translated string). After cancelling, the modal returns to its initial state with the remaining count, so deletion can be resumed.

The "Delete all completed tasks" flow used to fire a deleteTask
dispatch for every completed root task at once, with no way to stop
it once started.

Process the batch one task at a time instead, tracking a cancellation
flag that is checked between tasks. While the deletion is running the
modal now shows a Cancel button in place of the delete button; a task
already being deleted is allowed to finish, but no further tasks are
started once cancellation is requested. Tasks deleted before
cancellation stay deleted.

Fixes nextcloud#2334

Signed-off-by: Oaksprout <oaksproutthetan@gmail.com>
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.

Show Cancel button while completed tasks are being deleted

1 participant