Skip to content

fix(settings): make the Esc keycap close the modal it advertises - #499

Open
mostafasadeghidev wants to merge 1 commit into
CoreBunch:mainfrom
mostafasadeghidev:fix/settings-esc-keycap-closes
Open

fix(settings): make the Esc keycap close the modal it advertises#499
mostafasadeghidev wants to merge 1 commit into
CoreBunch:mainfrom
mostafasadeghidev:fix/settings-esc-keycap-closes

Conversation

@mostafasadeghidev

Copy link
Copy Markdown
Contributor

The settings modal's footer reads [Esc] close, and the keycap looks like a button because every Kbd depresses on :active.

Clicking it played that press animation and did nothing. The pointer over the word "close" turned into a text caret, and a click just selected the text.

Both dismissal paths already worked — backdrop click and Escape — so nothing was broken. But a control that animates under the cursor and then ignores the click answers the question wrongly: an operator who tries it concludes the modal cannot be dismissed with the mouse and stops looking. That is what happened, which is how this was found.

So the hint becomes the button it already looked like.

Kbd itself is untouched. Six other surfaces render it as a genuine keyboard hint — Spotlight, its footer and rows, the module inserter and its shortcut list, the keybindings help — where the press styling is right and there is nothing to click. Only this one sits next to the word "close".

The file header claimed there was no dedicated close button; there is one now, so it says so.

One test added beside the existing backdrop-close case.

bun test src/__tests__/settings/   57 pass, 0 fail
tsc -b, eslint                     clean

Verified by hand on a live install before submitting.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com

The footer reads `[Esc] close`, and the keycap looks like a button because
every `Kbd` depresses on `:active`. Clicking it played that press animation
and did nothing; the pointer over the word "close" turned into a text caret
and a click just selected the text. An operator reasonably concluded the
modal could not be dismissed with the mouse.

It could — the backdrop has always closed it, and Escape works — but a
control that animates under the cursor and then ignores the click is worse
than no control, because it answers the question wrongly.

So the hint becomes the button it already looked like. `Kbd` itself is
untouched: six other surfaces render it as a genuine keyboard hint where the
press styling is right, and only this one sits next to the word "close".

The file header claimed there was no dedicated close button. There is one
now, so it says so.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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