Skip to content

feat(web): support Enter key to confirm archive and other dialogs#1490

Merged
wbxl2000 merged 1 commit into
mainfrom
feat/web-confirm-dialog-enter
Jul 8, 2026
Merged

feat(web): support Enter key to confirm archive and other dialogs#1490
wbxl2000 merged 1 commit into
mainfrom
feat/web-confirm-dialog-enter

Conversation

@wbxl2000

@wbxl2000 wbxl2000 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

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

  • Added a window keydown listener to ConfirmDialog.vue.
  • When the dialog is open and Enter is pressed, it emits confirm immediately.
  • Loading state blocks the shortcut.
  • Text inputs and textareas keep their native Enter behavior for future-proofing.

This affects all confirmation dialogs driven by useConfirmDialog(), including the archive-session confirmation.

Checklist

  • I have read the CONTRIBUTING document.
  • I have explained the problem above (no linked issue for this small UX tweak).
  • I have added tests that prove my feature works. (No existing test file for ConfirmDialog; verified with pnpm typecheck and manual behavior review.)
  • Ran gen-changesets skill, or this PR needs no changeset.
  • This PR needs no doc update (minor keyboard shortcut in web UI).

@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 890a2fe

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +48 to +49
event.preventDefault();
emit('confirm');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@pkg-pr-new

pkg-pr-new Bot commented Jul 8, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@890a2fe
npx https://pkg.pr.new/@moonshot-ai/kimi-code@890a2fe

commit: 890a2fe

@wbxl2000 wbxl2000 force-pushed the feat/web-confirm-dialog-enter branch from 8d93ef2 to 45ecc98 Compare July 8, 2026 04:43
@wbxl2000

wbxl2000 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +44 to +46
if (
target instanceof HTMLButtonElement ||
target instanceof HTMLAnchorElement ||

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@wbxl2000 wbxl2000 force-pushed the feat/web-confirm-dialog-enter branch from 45ecc98 to 890a2fe Compare July 8, 2026 05:02
@wbxl2000

wbxl2000 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 890a2fe14b

ℹ️ 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".

@wbxl2000 wbxl2000 merged commit b30a45e into main Jul 8, 2026
10 checks passed
@wbxl2000 wbxl2000 deleted the feat/web-confirm-dialog-enter branch July 8, 2026 05:24
@github-actions github-actions Bot mentioned this pull request Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant