search: Fix focus replacement field when opening replace (Ctrl+H)#51061
search: Fix focus replacement field when opening replace (Ctrl+H)#51061Veykril merged 5 commits intozed-industries:mainfrom
Conversation
|
I don't think this is the behavior we want here. We should be focusing the search editor first, as that needs to be populated either way. What we should instead consider is having the opening replace action toggling focus between the search and replace editors if either of them is currently focused |
I understand your suggestion, but my original thought was to optimize for the specific case where a user has already made a selection and triggers a replace, in that case user is almost always looking to immediately type into the replace field. Currently the extra tab navigation to get to the replace field feels like a bit extra step which in my opinion is poor UX. For context thats how VSCode handles this specific case. |
|
Ah right, with a selection that would make sense, then we should only make it do that in that case though. If I understand your change correctly here this will always focus the replace editor |
|
Yes currently it always focuses the replace field. I'll have a look into it. |
|
I split this into two commits: first tries using |
|
I think that's it. |
|
can you rebase on top of main once more? I think the CI step is bugged on the branch base you are on |
d1b4ea5 to
ffeeea2
Compare
…d-industries#51061) Previously, focus stayed on the search bar because a pre-focus check `handle.is_focused(window)` was always false at deploy time. Before you mark this PR as ready for review, make sure that you have: - [x] Added a solid test coverage and/or screenshots from doing manual testing - [x] Done a self-review taking into account security and performance aspects - [x] Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) Release Notes: - Fixed: When opening find-and-replace with `Ctrl+H`, the replacement input is now focused instead of the search bar.
Previously, focus stayed on the search bar because a pre-focus check
handle.is_focused(window)was always false at deploy time.Before you mark this PR as ready for review, make sure that you have:
Release Notes:
Ctrl+H, the replacement input is now focused instead of the search bar.