Closed (fixed)
Project:
Admin Toolbar
Version:
8.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Jul 2018 at 16:40 UTC
Updated:
10 Oct 2019 at 22:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
eme commentedHello. I advise you to install the Coffee module (https://www.drupal.org/project/coffee).
Comment #3
romainj commentedYou can try the Navbar Filter module too.
Comment #4
teknorahUnfortunately, I have run into issues using coffee because it builds it's search index based on available routes, of which, many require parameters.
I have submitted an issue regarding this and the suggestion to build the search index similar to how this module does.
Comment #5
oknateHere's a patch that adds a search toolbar with redirect on autocomplete selection.

Since it can often take a long time for a new feature to get added to a module, I've added this as a separate module for now:
https://www.drupal.org/project/admin_toolbar_search
Comment #6
oknateComment #7
oknateHere's an updated patch that adds breadcrumbs, to add a little context.

I also updated the module based off this patch.
Comment #8
oknateAdding some visual separation between the label and the url in the suggestions
Comment #10
oknateOops, should have used .txt for the interdiff.
Comment #11
adriancidThanks for the patch, is great!
I just have this comments:
Here should be getUrl.protocol
And I think we should use the loupe icon as this is a search:
core/themes/stable/images/core/icons/424242/loupe.svg
Comment #12
oknateSince they didn't have svgs in core for the loupe in the colors I wanted, I added them in the patch. I'm using the same colors as the devel toolbar icon.
Comment #13
adriancidThanks, its fine for me, let's see the other maintainers opinions.
Comment #14
oknateThanks, @adriancid!
Comment #15
oknateI have been using this, and I noticed an improvement that could be added.
Currently, searches such as "add article" don't work because the label for add article contains "Content > Add Content > Article" and the url, but not the exact string "add article". I thought it would be nice to allow keyword based search, so that a search for "add article" would return the add article link.
Comment #16
oknateExample of keyword-based search:

I've marked this issue back as "Needs Review" as I made changes. So if the changes in #15 could be reviewed, I would appreciate it.
Comment #17
oknateAdding functional test for search functionality.
Comment #18
oknatefixing namespace, and removing admin_toolbar_tools dependency.
Comment #19
oknateI'm going to mark this back to RTBC, in the hopes that the other maintainers (other than Adrian Cid) will give this a look (see #13). Keep in mind the updates after #13 are not RTBC.
Comment #21
oknateComment #22
oknateOops, adding back admin_toolbar_tools dependency in test.
Comment #24
oknateI realized I had a dependency on the module version of this, "admin_toolbar_search", removing.
Comment #25
oknateMarking this back to RTBC, (based on #13) in the hopes that the other maintainers (other than Adrian Cid) will give this a look. Keep in mind the updates after #13 are not RTBC.
Updates since #13:
- Added keyword based search.
- Added functional test.
Comment #26
oknateMinor update to test, removing unused variable.
Comment #27
oknateMinor update to add some basic styles to the input and to make the label bold.
I found that when using my admin theme, it was inheriting nice styles, but on my main theme, the tray was getting squashed because there wasn't any default margin or padding added in admin.toolbar_search.css.
This updated patch adds some default styles, so that if a theme doesn't have styles in place, the margins should be OK as a baseline.
It also removes a whitespace error.
Comment #28
oknateHere's a screenshot of the issue patch #27 is addressing. Out of the box, no margin is added around the input.

Comment #29
oknateComment #30
oknateAutocomplete should wait until two characters have been entered.
Currently, it will trigger autocomplete if only one character has been typed. Since we're not limiting the number of items returned, this leads to a very long ugly list of items related to the one letter typed. The minimum should be set to two characters.
Comment #31
oknateUpdates since #13:
- Added keyword based search.
- Added functional test.
- Added some basic css styles
- Wait for second character typed to trigger autocomplete
Comment #32
oknateHere's an update that adds "auto focus", that is, when you click on the tab, it will focus into the search field.
Comment #34
adriancid@oknate thanks for this feature.
Comment #35
oknateFantastic. Thanks for merging it in.
Comment #37
denisev commentedWhat is the recommended way to disable this feature?
Comment #38
oknateThe same way it's added, using hook_toolbar_alter().