Skip to content

feat(content-uploader): Implement cancel all confirmation modal#4579

Merged
mergify[bot] merged 3 commits into
masterfrom
implement-cancel-all-confirmation-modal
May 29, 2026
Merged

feat(content-uploader): Implement cancel all confirmation modal#4579
mergify[bot] merged 3 commits into
masterfrom
implement-cancel-all-confirmation-modal

Conversation

@dealwith
Copy link
Copy Markdown
Collaborator

@dealwith dealwith commented May 20, 2026

4/5 PR in the queue:

  1. feat(uploads-manager): integrate shared feature into ContentUploader #4573
  2. feat(content-uploader): Implement cancel all retry all handlers #4577
  3. feat(content-uploader): Implement cancelled state uploads manager #4578
  4. 👉 feat(content-uploader): Implement cancel all confirmation modal #4579
  5. feat(content-uploader): Implement permission error handling uploads #4580

Summary by CodeRabbit

Release Notes

  • New Features

    • Added a confirmation modal when canceling all uploads, allowing users to confirm the action or keep uploading
    • Full internationalization support for the confirmation dialog
  • Tests

    • Added comprehensive test coverage for the confirmation modal and upload cancellation workflow

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • i18n/en-US.properties is excluded by !i18n/**

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 92ba4043-df41-404a-9d3e-c50df1c18e82

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This PR adds a confirmation modal for canceling all in-progress uploads in the ContentUploader component. A new reusable CancelAllUploadsModal component is created with internationalized text, integrated into ContentUploader with state and handlers, and both the modal and integration are covered by tests.

Changes

Cancel All Uploads Modal and Integration

Layer / File(s) Summary
Cancel All Uploads Modal component and i18n
src/elements/content-uploader/CancelAllUploadsModal.tsx, src/elements/content-uploader/messages.ts, src/elements/content-uploader/__tests__/CancelAllUploadsModal.test.tsx
CancelAllUploadsModal wraps AlertModal with props for isOpen, onConfirm, and onDismiss callbacks. Message IDs, default English text, and descriptions are exported from messages.ts for modal heading, body, button labels, and close-label aria. Tests verify rendering when open, correct callback invocation per button, and no render when closed.
ContentUploader modal wiring and confirmation handlers
src/elements/content-uploader/ContentUploader.tsx, src/elements/content-uploader/__tests__/ContentUploader.test.js
isCancelAllModalOpen state tracks modal visibility. handleCancelAllClick opens the modal from the modernized UploadsManagerBP.onCancelAll callback. handleCancelAllConfirm cancels only in-progress and pending uploads and closes the modal; handleCancelAllDismiss closes without canceling. Integration tests verify modal opens on action, confirm handler cancels and closes, and dismiss handler closes without canceling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • box/box-ui-elements#4577: Adds the underlying bulk cancel and STATUS_CANCELED handlers that the main PR's confirmation modal wraps.
  • box/box-ui-elements#4571: Also modifies ContentUploader.tsx and the modernized UploadsManagerBP manager routing.

Suggested labels

ready-to-merge

Suggested reviewers

  • jpan-box
  • olehrybak
  • reneshen0328

Poem

🐰 A modal so fair, with buttons so bright,
Confirms when you click, dismisses with might,
In upload we trust, with messages true,
No cancellations surprise—we show what we'll do!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description lacks substantive details about the implementation; it only contains PR queue context and merge process guidance from the template. Add a meaningful description explaining what the confirmation modal does, why it was added, and any relevant implementation details or trade-offs.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: implementing a cancel all confirmation modal for the content-uploader component.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch implement-cancel-all-confirmation-modal

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dealwith dealwith changed the base branch from master to implement-cancelled-state-uploads-manager May 21, 2026 09:39
olehrybak
olehrybak previously approved these changes May 27, 2026
@dealwith dealwith marked this pull request as ready for review May 27, 2026 14:26
@dealwith dealwith requested review from a team as code owners May 27, 2026 14:26
@dealwith dealwith changed the title Implement cancel all confirmation modal feat(content-uploader): Implement cancel all confirmation modal May 27, 2026
Comment thread src/elements/content-uploader/ContentUploader.tsx Outdated
Comment thread src/elements/content-uploader/ContentUploader.tsx Outdated
Comment thread src/elements/content-uploader/__tests__/CancelAllUploadsModal.test.tsx Outdated
Comment thread src/elements/content-uploader/messages.ts Outdated
Comment thread src/elements/content-uploader/messages.ts
Comment thread src/elements/content-uploader/ContentUploader.tsx
Comment thread src/elements/content-uploader/__tests__/ContentUploader.test.js Outdated
@dealwith dealwith force-pushed the implement-cancelled-state-uploads-manager branch from c9536b2 to c794314 Compare May 28, 2026 17:40
@dealwith dealwith requested a review from a team as a code owner May 28, 2026 17:40
@dealwith dealwith force-pushed the implement-cancel-all-confirmation-modal branch from 9cc5b98 to 73dcbd7 Compare May 28, 2026 17:48
@dealwith dealwith force-pushed the implement-cancelled-state-uploads-manager branch from c794314 to 011434c Compare May 28, 2026 19:02
@dealwith dealwith force-pushed the implement-cancel-all-confirmation-modal branch 2 times, most recently from e796897 to c88db8e Compare May 28, 2026 19:47
Base automatically changed from implement-cancelled-state-uploads-manager to master May 28, 2026 20:09
@mergify mergify Bot dismissed olehrybak’s stale review May 28, 2026 20:09

The base branch was changed.

dealwith added 2 commits May 29, 2026 15:17
The Cancel All button on the modernized uploads manager now opens a
confirmation dialog instead of canceling immediately. Confirming runs
handleCancelAllUploads; dismissing leaves uploads untouched. Modal uses
@box/blueprint-web AlertModal with localized copy and danger-styled
primary action.
- Sort imports alphabetically.
- Rename handleCancelAllRequest to handleCancelAllClick and group with
  cancel-all handlers.
- Drop redundant cancelAllUploadsModal* prefix from message keys
  (heading, body, confirmButton, keepUploadingButton, closeLabel).
- Rename keepButton to keepUploadingButton for clearer intent.
- Match modal body via literal string instead of regex.
@dealwith dealwith force-pushed the implement-cancel-all-confirmation-modal branch from 3dd35a9 to 8abe80a Compare May 29, 2026 13:20
@dealwith dealwith self-assigned this May 29, 2026
@dealwith
Copy link
Copy Markdown
Collaborator Author

https://github.com/Mergifyio queue

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 29, 2026

Merge Queue Status

  • 🟠 Waiting for queue conditions
  • ⏳ Enter queue
  • ⏳ Run checks
  • ⏳ Merge
Required conditions to enter a queue
  • -closed [📌 queue requirement]
  • -conflict [📌 queue requirement]
  • -draft [📌 queue requirement]
  • any of [📌 queue -> configuration change requirements]:
    • -mergify-configuration-changed
    • check-success = Configuration changed
  • any of [🔀 queue conditions]:
    • all of [📌 queue conditions of queue rule Automatic strict merge]:
      • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
      • #approved-reviews-by >= 2
      • #changes-requested-reviews-by = 0
      • #review-threads-unresolved = 0
      • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
      • branch-protection-review-decision = APPROVED
      • github-review-decision = APPROVED [🛡 GitHub branch protection]
      • label = ready-to-merge
      • status-success = lint_test_build
      • title ~= ^(build|ci|chore|docs|feat|fix|perf|refactor|revert|style|test)(\([^)]+\))?:\s.+$
      • any of [🛡 GitHub branch protection]:
        • check-success = Summary
        • check-neutral = Summary
        • check-skipped = Summary
      • any of [🛡 GitHub branch protection]:
        • check-success = lint_test_build
        • check-neutral = lint_test_build
        • check-skipped = lint_test_build
      • any of [🛡 GitHub branch protection]:
        • check-success = license/cla
        • check-neutral = license/cla
        • check-skipped = license/cla
      • any of [🛡 GitHub branch protection]:
        • check-success = lint_pull_request
        • check-neutral = lint_pull_request
        • check-skipped = lint_pull_request
    • all of [📌 queue conditions of queue rule Automatic boxmoji merge]:
      • author = boxmoji
      • title ~= ^(fix)\(i18n\)?:\supdate translations$
      • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
      • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
      • files ~= ^i18n/
      • github-review-decision = APPROVED [🛡 GitHub branch protection]
      • status-success = lint_test_build
      • any of [🛡 GitHub branch protection]:
        • check-success = Summary
        • check-neutral = Summary
        • check-skipped = Summary
      • any of [🛡 GitHub branch protection]:
        • check-success = lint_test_build
        • check-neutral = lint_test_build
        • check-skipped = lint_test_build
      • any of [🛡 GitHub branch protection]:
        • check-success = license/cla
        • check-neutral = license/cla
        • check-skipped = license/cla
      • any of [🛡 GitHub branch protection]:
        • check-success = lint_pull_request
        • check-neutral = lint_pull_request
        • check-skipped = lint_pull_request

Copy link
Copy Markdown
Collaborator

@jpan-box jpan-box left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All addressed — handler reordering, naming, message keys, and test updates all look good.

@mergify mergify Bot added the queued label May 29, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 29, 2026

Merge Queue Status

  • Entered queue2026-05-29 16:23 UTC · Rule: Automatic strict merge
  • Checks passed · in-place
  • Merged2026-05-29 16:38 UTC · at 10068a443a1606fe75a5ba636d163e9702b455c5 · squash

This pull request spent 15 minutes 2 seconds in the queue, including 13 minutes 52 seconds running CI.

Required conditions to merge

@mergify mergify Bot merged commit 5b3989a into master May 29, 2026
13 checks passed
@mergify mergify Bot deleted the implement-cancel-all-confirmation-modal branch May 29, 2026 16:38
@mergify mergify Bot removed the queued label May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants