fix: empty the command palette however it was closed - #187
Merged
Conversation
Running a command already cleared the query. Escape and clicking the backdrop did not, so Cmd-K could reopen onto a stale query and a stale list of results for something you had already finished doing. Two ways out of the same dialog leaving it in two different states reads as a glitch rather than as a feature. Found while writing a verification script: my own typing appended to the previous query and matched nothing, which is exactly what it would do to anyone else. e2e covers both exits and was checked to fail without the fix.
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.
Running a command already cleared the query. Escape and clicking the backdrop did not, so ⌘K could reopen onto a stale query and a stale list of results for something you'd already finished doing.
Two ways out of the same dialog leaving it in two different states reads as a glitch, not a feature.
Found by accident while writing a production verification script: my own typing appended to the previous query and matched nothing — exactly what it would do to anyone else who reopened the palette expecting a fresh box.
e2e covers both exits (Escape and backdrop click) and was checked to fail without the fix:
420 unit, 79 e2e, all passing.