Skip to content

fix: show a cancel button in confirmations of destructive actions - #3958

Merged
AlexAndBear merged 2 commits into
mainfrom
fix/destructive-modal-cancel
Oct 23, 2026
Merged

AlexAndBear merged 2 commits into
mainfrom
fix/destructive-modal-cancel

Conversation

@AlexAndBear

Copy link
Copy Markdown
Member

Description

  • New modal prop showCancelAction: shows an outline "Cancel" next to the confirm button, same as the X and Escape, disabled while the action runs. The X in the title bar stays everywhere (feat: polish modals #2106).
  • Set for destructive confirmations: delete users, groups and spaces, delete permanently and empty trash, delete link, delete app token, delete space image, remove profile picture, discard contact changes. Removing a share or member and disabling a space don't get it, since access can be granted again.
  • Unsaved changes dialog: already had a Cancel, built by hand; it now uses the prop and the modal's own Save, only "Don't Save" stays custom. All three buttons are disabled while saving.
  • Remove profile picture: the dialog now shows the loading state while the removal runs, so it can't be cancelled or confirmed twice. Also dropped the leftover button-cancel-text there (the prop is gone since feat: polish modals #2106).
Before After
Before: only Delete After: Cancel next to Delete

The Notes app in web-extensions opens UnsavedChangesModal with hideActions: true, so its dialog has had no buttons since #3419; with this it can use confirmText + showCancelAction instead.

Related Issue

How Has This Been Tested?

  • test environment: unit tests (Vitest), browser tests (Playwright) against a local OpenCloud
  • test case 1: unit: OcModal renders Cancel only with the prop (order, cancel event, disabled while loading), ModalWrapper passes it on, delete user/permanently/empty trash set it, unsaved changes modal and AvatarUpload loading state
  • test case 2: browser: before/after on the trash delete permanently dialog; every destructive dialog shows Cancel and Cancel/X/Escape don't act (server state checked), Cancel disabled while the delete runs; normal dialogs and modals with their own buttons (create folder/space, link, app token, date picker, conflicts) unchanged; unsaved changes Cancel/Don't Save/Save; Pixel 7 and 360px

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@AlexAndBear

Copy link
Copy Markdown
Member Author

@kulmann @tbsbdr opinions on that?

@tbsbdr

tbsbdr commented Oct 21, 2026

Copy link
Copy Markdown
Member

yes, go! a confirmation needs a visible cancel a title-bar X alone is too small, distant target and reads as "dismiss" not "decide".

@AlexAndBear
AlexAndBear merged commit 42edb13 into main Oct 23, 2026
27 checks passed
@AlexAndBear
AlexAndBear deleted the fix/destructive-modal-cancel branch October 23, 2026 09:15
openclouders pushed a commit that referenced this pull request Oct 23, 2026
)

* fix: show a cancel button in confirmations of destructive actions

* refactor: drop the unused emits of the unsaved changes modal
@openclouders openclouders mentioned this pull request Oct 23, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Confirmations for destructive actions have no Cancel button

3 participants