Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[overlay search] search bar does not forward shortcuts from the editor making it sometimes confusing #2512

Open
Tracked by #2021
laeubi opened this issue Nov 9, 2024 · 3 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@laeubi
Copy link
Contributor

laeubi commented Nov 9, 2024

With the new search do the following:

  1. Assume you have a document that contains the text "test"
  2. Now press CTRL+F and enter "test"
  3. Now the editor highlight the first occurrence
  4. Now try any usual (e.g. CTRL+X, CTRL+K) shortcuts
  5. Nothing happens because text field has focus but it looks like the editor has focus (due to the selection) making the user wondering why it is ignored.

To clarify the behavior was similar than before with the old dialog (except that one has to hit "Find" first) but there it was more obvious where the focus is (e.g. due to the color of the dialog title bar) now with the embedded nature it often tricking me as it is not always clear if the search or the editor has focus, e.g. if I then click into the document the overlay look the same.

It become even more confusing if one use one of the "find icons":

  • If one focuses the editor and then press a button, the focus remains there
  • If one has previously focused the text field the focus remains there and one can easily accidentally type in new characters while one actually want to type in the editor

I'm not sure what would be the best, but at least I think two things can be improved:

  1. Make the overlay look different if it has focus (e.g. maybe a make the border a bit darker and bolder)
  2. If one click on the search button the focus should always be on the editor
@laeubi laeubi added the bug Something isn't working label Nov 9, 2024
@HeikoKlare
Copy link
Contributor

Thanks for reporting this! I agree that the shortcut handling is currently not completely consistent or as commonly expected. Actually, making shortcuts of the underlying editor work at all was quite a hack (adapted from the breadcrumb, which does similiar things). There is definitely room for improvement.
I like both proposals for improvement. In particular, the idea of making it visually visible that the overlay has focus is nice and should be rather easy to implement.

This issue is also slightly related to #2509. I have added it to the list in the umbrella issue.

@laeubi
Copy link
Contributor Author

laeubi commented Nov 9, 2024

I also found that often if I search something I probably want to replace it (manually), the workflow is currently a bit error prone

  1. Enter a text
  2. Text is highlighted
  3. Now one needs to carefully click on the tab to focus the editor
  4. If one clicks on the editor area the selection is lost

I'm not sure if it would be possible to when focus changes from search overlay to editor if one can preserve the last selection?

@laeubi laeubi added the enhancement New feature or request label Nov 9, 2024
@HeikoKlare
Copy link
Contributor

I'm not sure if it would be possible to when focus changes from search overlay to editor if one can preserve the last selection?

Probably this behavior/proposal is a matter of personal preference. In my opinion, the proposed behavior would be unexpected and the current behavior is exactly as expected. If I understand correctly, the current behavior conforms to the behavior of the existing dialog and to the behavior of other tools (like VS code). Or do I miss something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants