Instead it clears the search field. Only when the search field is empty does pressing the Esc key close the effect. So to close the effect when search results are visible, you need to press Esc twice. I have a recollection that this got fixed in KRunner recently; maybe the Overview effect needs the same handling implemented? Or maybe it's a bug in Milou that we should handle universally.
No, it was an intentional behavior.
https://invent.kde.org/plasma/kwin/-/blob/afd525ced034b55ae1f89f6e899a79a58bc5e493/src/effects/overview/qml/ScreenView.qml#L240
Can we reconsider that? What's the reason for wanting Esc to clear the search field? I find it a bit annoying, as I had been using the Esc key to exit the whole effect. Now I need to think for a moment and press the Esc key 1 or 2 times based on whether search terms are visible.
Searching seemed to me like a different mode, so Esc is used to leave the search mode and go back to the "normal" mode. (note that I'm a vim user, I like to think in terms of modes) If that's counterintuitive for most people, we can change that.
I understand, but please understand that most people are not vim users and explicit modality is general discouraged in UI design unless it's unavoidable because all alternatives are worse. :)
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/1690
Git commit 045c1337a9857b92a3bcf01f1f2b1784b4481892 by Vlad Zahorodnii. Committed on 19/11/2021 at 15:27. Pushed by vladz into branch 'master'. effects/overview: Make Esc key handling more intuitive when searching The person that added krunner search integration uses vim. It seemed intuitive to that person that the Escape key should quit the search mode instead of quitting the effect. But it seems like more intuitive thing is to actually stop the effect. M +2 -7 src/effects/overview/qml/ScreenView.qml https://invent.kde.org/plasma/kwin/commit/045c1337a9857b92a3bcf01f1f2b1784b4481892