Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I like the idea of the new search feature which can certainly replace the coffee module. Are you considering implementing a hotkey to open the search bar and set the cursor into that field?
Comment | File | Size | Author |
---|---|---|---|
#15 | 3056856-15-keyboard-shortcut.patch | 8.32 KB | jigarius |
|
Comments
Comment #2
oknateI don't use hotkeys, so I haven't thought of it. Can you give more detail of how you'd like it to behave? This is a major feature of the coffee module I know.
Comment #3
jurgenhaasThanks for your reply. The way this works in coffee - similar to e.g. the Alfred tool on the Mac - when you hit the hotkey (Alt-K if I remember correctly) their dialog box pops up in the middle of the screen and the textfield has the cursor focus so that you can start typing without leaving your fingers from the keyboard.
With your admin toolbar there should NOT be any change in the UI from my point of view. Instead, when the hotkey gets pressed, the cursor focus should be the textfield in your search panel, which if not visible yet, should be made visible first.
For the site builder this would mean, they can hit the hotkey followed by typing their search string which will immediately show the search results which they can select with up and down keys plus return/enter to get there.
Does that make any sense?
Comment #4
oknateYes, thanks for the explanation. Is it configurable in coffee? So you can switch hotkeys?
Comment #5
jurgenhaasAFAIK, it's not.
Comment #6
jigariusI was thinking about this same thing! If we build it in admin toolbar, I will no longer need to install Coffee on any projects. I will create a patch for it ASAP (I was going to do it this weekend, but then I fell sick 😷).
What do you think the shortcut should be? Shall I make it the same as it is in Coffee?
Comment #7
jurgenhaas@jigarius sounds great. As a default, the same as coffee would make a lot of sense. Of course if you could allow that to be configured, that would be even better.
Comment #8
adriancidI think should be different from Coffee because maybe some users will continue using Coffee and if we use the same this can create problems.
Comment #9
jigariusYes Adrian. I've thought about that. I might simply check if Coffee is enabled. If it is enabled, then I can setup a different shortcut. Also, I think I might just make it configurable.
Comment #10
adriancidIs better to keep this module without configuration, we can choose another combination, in my opinion, if we use the same as Coffee and a user has the two modules installed we may be forcing him to don't use a module he maybe loves to use.
Comment #11
jigariusOk. Point noted.
As a side note, I always wanted to provide a configuration for this module to allow people to choose the toolbar color (: Do you think that's a good idea?
Comment #12
adriancid@jigarius the project owner @eme always says he wants to keep the module plug and play and without configuration. I think we need to see his opinion about the colors for the toolbar.
Comment #13
jigariusOk. Then for now I'll just create a shortcut for the search and keep the frills and decorations for other issues. Thanks for the quick replies.
Comment #14
eme CreditAttribution: eme commentedHello !
I love the coffee module as well :-)
It may be interesting to include it into Admin toolbar, but woudn't be interesting to include the coffee module directly as a submodule and talking with the maintainer of the module ?
I talked to romainj the co-maintainer of the module who is refactoring a significant part of the module, so just to know that there will be some changes to come in the module code.
Comment #15
jigariusHere's the first iteration.
* Did some coding standard fixes.
* Created utility methods: isSearchVisible() and togglSearch()
* Create shortcut "Alt + S" / "Option + S" to toggle the search
* When the search is open, pressing "Escape" hides the search
* Installed Coffee and tested both of them to be working without conflict
Let me know if I missed something or if you have any suggestions (:
Comment #16
adriancidWorks fine for me, @eme you're correct with the shortcut?
Comment #17
oknateExcellent work. This is great. And the clean-up of coding standards is great. I just have one nit with the experience. When you press escape, it closes the toolbar, instead of returning you to where you were. So let's say you're on the manage tab, you press Alt + S and go to search, and for some reason you decide not to search, so you press Escape, right now, the entire toolbar closes. I think it should return you to your last tab, if available.
Suggested UX improvement when pressing escape:
If the toolbar was open when pressing Alt + S:
If the toolbar was closed when pressing Alt + S:
Comment #18
jigariusA nice observation. However, in my opinion that should be tackled in a different issue.
* The admin toolbar in general doesn't provide any nice way to know which tab is active.
* Also, using the shortcut to open the search bar is the equivalent of clicking on the "search" tab itself. And just like any other tabs, there is no way to press escape and jump back to the tab which was previously active (the other tabs don't behave that way either).
* Also, from a UX point of view, if a user is actually trying to activate the search, its highly probably that they'll type something and follow one of the autocomplete suggestions to land on a different page. And curiously, in this case, the admin toolbar currently lets the search tab open.
So, I believe that this ticket should probably restrict its scope to fixing the problem of having a shortcut for the search. We can however create another issue to improve:
* To maintain history of tabs clicked – at least when the user goes to the search tab.
* Then, whether the user collapses the search, presses escape or actually uses the search, the admin toolbar should restore the tab which was active right before the search tab was clicked.
If what I said above doesn't make sense and you believe that the UX improvement mentioned in comment 17 is absolutely necessary to be able to close this ticket, then please mark it as "Needs work" and I'll see if I can spend some time on it this weekend.
Comment #19
oknateI think it's worth getting this in the way it is. Marking back to RTBC. The UX improvement isn't a must (#17) isn't a must. I can look into it as a follow up issue.
This is a great new feature.
Comment #20
adriancidThanks to @all
Comment #22
adriancidHi @jigarius can yo write a change notice for this new feature?
Comment #24
ExceptionHandler CreditAttribution: ExceptionHandler commentedAlt+s (Option+s) happens to be a shortcut to type a Polish character of "ś". I imagine there are other languages with common problem. Can you suggest how to turn this off, please?
Comment #25
adriancidI think is better if we choose another different combination, can you propose another different shortcuts?
Comment #26
oknateCan we move this to a follow-up?
#3087173: Allow shortcut key to be configurable
Comment #27
JasonLuttrellThis did not apply for me. Perhaps it's outdated now? Any chance of this patch being updated?
Comment #28
paulocsThat implementation was not ported to the 8.x-2.x version