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

Allow to close search by going "Back" #235

Open
GfEW opened this issue Jul 24, 2024 · 3 comments
Open

Allow to close search by going "Back" #235

GfEW opened this issue Jul 24, 2024 · 3 comments

Comments

@GfEW
Copy link

GfEW commented Jul 24, 2024

Your excellent solution to #225 works really well. Thank you!

Unfortunately, that substantial improvement makes one nasty remaining hurdle in Editor's keyboard navigability stand out all the more: You can enter search with Ctrl+F, search again with F3 or refine the search string just fine, but there's no way back out of search! (1)

How to reproduce:

  1. Edit some text in Editor with an external keyboard connected to your Android device.
  2. Press Ctrl+F to open and enter the search bar.
  3. Enter some search string, press Enter to search for it, and possibly F3 to search again, at will.
  4. Press Meta+Backspace to "navigate back". (Depending on your keyboard layout, you may have to press e. g. Win+Backspace or Option+Backspace instead, or press Back on your phone, or whichever navigation guesture or key combination triggers it.)

What does happen?

When in search, going Back leaves Editor alltogether.

What should happen instead?

When in search, going Back should leave and close the search bar (but not the entire app) and return the editing focus to the main text content.

(1)(Other than by closing and reopening Editor, or jumping through awkward Tab navigation hoops, that is.)

@billthefarmer
Copy link
Owner

Ctrl-Shift-F closes search. The Escape key acts as back.

@GfEW
Copy link
Author

GfEW commented Jul 25, 2024

On Ctrl+Shift+F:

OIC, thanks for the pointer! - I do get the idea of "Shift" reversing the meaning of Ctrl+F that opens search. I hadn't noticed Ctrl+Shift+F when we were discussing shortcuts in #225, but should've taken the time to check the docs soon after. Sorry that I didn't.

Unfortunately, Ctrl+Shift+F is far from common for "cancel search". I, for one, didn't even think of testing it in all those months of "working around" this issue (before finally reporting it), but instead kept tediously closing and reopening files "in order to get out of search", again and again.

RationaleOne of Editor's most outstanding qualities is certainly its powerful simplicity. Editor goes extremely light on the technical, as well as on the human brain side of resources. And it's somewhat against that grain if keyboard users have to consult the docs in order to learn that in Editor, the search widget can't be closed by the intuitive, established "Back" navigation that intuitively works in the vast majority of searchable Android apps, but only by a very special shortcut they've never used for that basic task before.

I'm far from advocating a "no docs" solution - Editor provides advanced features that could hardly be made simpler than they already are. However, to minimize needless learning overhead, it's probably best to keep shortcuts for common actions as close to the standard as possible.

Is there any chance you'd reconsider and make "Back" close the search widget first?
Just like it closes the menu or "Save to ..." dialog
- so the app will get closed by "Back" only if no search, menu or other dialog is active?

As far as I know, that's what "Back" should be doing, and actually does in virtually every app that provides a keyboard accessible search widget.

p. s.
I suspect this closing effect of "Back" on the search widget is provided by the Android system in a way that doesn't need to be hard coded in every app that uses it. (Please forgive my vague language, I'm not an android developer.) Maybe https://chromeos.dev/en/android/input-compatibility#shortcuts gives any clues?

@GfEW
Copy link
Author

GfEW commented Jul 25, 2024

Re: Escape

Note on how to input "Back":

Although I've sporadically encountered suggestions to get Back by pressing Escape on the keyboard, I've rarely seen it working anywhere on Android. (Termux is the one prominent app exception fully utilizing the Escape key, but it doesn't act as "Back" there, either.)

Search+Backspace, on the contrary, works consistently for me on all Android devices.
(Actually, it's Meta+Backspace on my keyboard, as Android's "Search" appears to be mapped by "Meta"|"Option"|"Win" on Linux|Apple|Windows layouts, resp.)

According to Keyboard shortcut helper that opens by Search+/, the standard Back shortcut is indeed Search+Backspace. Apparently, it's only accompanied by Search+Left and Search+~ from A14 upwards, whilst Escape isn't listed there.

If my very limited understanding of the inner workings of Android shortcuts is correct, Search+Backspace is equivalent at the system level to tapping the Back button (if present) or performing the Back gesture (if configured), and has been so for over a decade. In my experience, all three work reliably throughout Android.

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

No branches or pull requests

2 participants