feat(web): support Enter key to confirm archive and other dialogs#1490
Conversation
🦋 Changeset detectedLatest commit: 890a2fe The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8d93ef228b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| event.preventDefault(); | ||
| emit('confirm'); |
There was a problem hiding this comment.
Preserve button semantics when handling Enter
When a confirmation dialog is open, this window-level handler also receives Enter keydowns from the dialog's own buttons; because only text inputs are exempted, tabbing to Cancel or the close button and pressing Enter will hit this branch, preventDefault() the native button action, and emit confirm instead. This makes keyboard users confirm destructive dialogs in exactly the scenario where they are trying to cancel/close them.
Useful? React with 👍 / 👎.
commit: |
8d93ef2 to
45ecc98
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 45ecc98577
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if ( | ||
| target instanceof HTMLButtonElement || | ||
| target instanceof HTMLAnchorElement || |
There was a problem hiding this comment.
Ensure bare Enter confirms after the dialog opens
In the default archive-confirm flow, Dialog.vue moves focus to the first focusable element when opened, and the first focusable in this dialog is the header close button. Because this handler returns for every HTMLButtonElement, pressing Enter immediately after the modal appears does not run the new confirm shortcut; the browser instead activates the focused close button and cancels/closes the dialog. This makes the advertised keyboard path fail for the main scenario unless the user first moves focus off the close button.
Useful? React with 👍 / 👎.
45ecc98 to
890a2fe
Compare
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Related Issue
N/A — small UX improvement.
Problem
Archive and other confirmation modals in the Kimi Web UI currently require a mouse click on the Confirm button. Keyboard users expect to press Enter to quickly confirm.
What changed
keydownlistener toConfirmDialog.vue.confirmimmediately.This affects all confirmation dialogs driven by
useConfirmDialog(), including the archive-session confirmation.Checklist
ConfirmDialog; verified withpnpm typecheckand manual behavior review.)gen-changesetsskill, or this PR needs no changeset.