Calendar: delete events with Delete/Backspace key and confirm with Enter - #544
Open
PeterMcBTC wants to merge 5 commits into
Open
PeterMcBTC wants to merge 5 commits into
PeterMcBTC wants to merge 5 commits into
Conversation
Added keyboard shortcuts for deleting events in EventPopover.
mmso
force-pushed
the
main
branch
6 times, most recently
from
September 24, 2026 14:16
6cb99ea to
a0a8848
Compare
mmso
force-pushed
the
main
branch
8 times, most recently
from
October 1, 2026 20:16
57fccbd to
c51e81b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Deleting an event in Proton Calendar currently requires the mouse twice:
Keyboard users have no way to do this: there is no shortcut to delete the
selected event, and pressing Enter in the delete confirmation dialog does not
confirm it. This is because
Promptdeliberately excludesdanger-coloredbuttons from its Enter/Space submit hotkey (
onSubmitHotkeyPressinpackages/components/components/prompt/Prompt.tsx), which is a sensibledefault for destructive actions, but leaves no opt-in for flows where the
user explicitly wants keyboard-driven deletion.
Proposed solution
Delete/Backspace deletes the selected event. While an event popover is
open (i.e. an event is selected), pressing
DeleteorBackspacetriggersexactly the same flow as clicking the trash icon (
handleDeleteinEventPopover). The hotkey is registered only while the popover ismounted, so it cannot fire when no event is selected. It respects the
"Keyboard shortcuts" mail setting and the existing
isBusy()guard(no-op while typing in inputs, or while a modal/dropdown is open).
Enter confirms the deletion. A new opt-in prop
enableDangerSubmitHotkeyonPromptallows the Enter hotkey to triggerthe danger-colored CTA. It is enabled in
DeleteConfirmModalandDeleteRecurringConfirmModalonly — all other destructive prompts keepthe current safe behavior. When enabled, only Enter is mapped; Space keeps
its native behavior on the focused button, and
preventDefault()avoidsdouble-activation when the Cancel button is focused.
The new shortcut is documented in the keyboard shortcuts help modal
(
packages/shared/lib/shortcuts/calendar.ts).Resulting flow: click event → Supr → Enter → event deleted.
Files changed
packages/components/components/prompt/Prompt.tsx— new opt-in propenableDangerSubmitHotkey(defaults tofalse, zero behavior change forexisting consumers); the submit hotkey now calls
preventDefault().applications/calendar/src/app/containers/calendar/confirmationModals/DeleteConfirmModal.tsx— enable Enter-to-confirm for single-event deletion.
applications/calendar/src/app/containers/calendar/confirmationModals/DeleteRecurringConfirmModal.tsx— enable Enter-to-confirm for recurring-event deletion.
applications/calendar/src/app/components/events/EventPopover.tsx—Delete/Backspace hotkey scoped to the open popover.
packages/shared/lib/shortcuts/calendar.ts— document the new shortcut.How to test
Delete(orBackspace) → the delete confirmation dialog opens.Enter→ the event is deleted.Spaceon the focused Cancel button still cancels.Prompt-based dialogs (without the new prop) behave as before.