Repository navigation
fix: consume confirmation dialog key events - #9001
kaluli123123 wants to merge 4 commits into
Conversation
Reviewer's GuideUpdates the confirmation dialog’s keyboard event handling to use Focus and explicitly consume Escape and Enter events, preventing unhandled-key system alert sounds while preserving existing actions and close semantics. Sequence diagram for confirmation dialog key handlingsequenceDiagram
actor User
participant Dialog as ConfirmPopup
participant Navigator
User->>Dialog: Escape KeyDownEvent
Dialog->>Dialog: _handleKeyEvent(node, event)
Dialog->>Navigator: pop()
Dialog-->>User: KeyEventResult.handled
User->>Dialog: Enter KeyUpEvent
Dialog->>Dialog: _handleKeyEvent(node, event)
Dialog->>Dialog: onConfirm(context)
opt closeOnAction
Dialog->>Navigator: pop()
end
Dialog-->>User: KeyEventResult.handled
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Added regression coverage in 803b762 for handled Escape key-down events, consumed Enter repeats without premature or duplicate confirmation, Validation using the repository-pinned Flutter 3.27.4 on macOS arm64:
These are widget/local-suite results, not a packaged macOS audible-alert smoke test or cross-platform CI approval. Those merge gates remain unverified. |
|
Thank you for your contribution! We've verified this fix and plan to include it in AppFlowy Premium, so we're closing this PR for now. If you have any feedback or further improvements, feel free to comment here or reopen the PR. |
Summary
Closes #7342
Validation
flutter test --no-pub test/widget_test/confirm_dialog_test.dart— 1 test passedflutter analyze --no-pub .— no issues foundgit diff --checkpassValidated with Flutter 3.27.4 on macOS arm64. The system alert sound itself was not exercised in a packaged app.
Summary by Sourcery
Ensure confirmation dialog keyboard events are handled consistently without duplicate confirmations or system alert sounds.
Bug Fixes:
Tests: