-
Notifications
You must be signed in to change notification settings - Fork 27
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
Move the search bar control into the site-title. #75
Conversation
e6094c5
to
b617871
Compare
Thanks for the detailed review! I should have been more clear. The code needs cleaning up and some of the UI interactions/layouts are still a bit rough. I am interested to get this approach validated since we don't have an agreed-on path forward on the search UX. Do you think this is a good idea (moving the search bar)? Is it an improvement? |
To me, it's an improvement and I'm probably more into this new layout for 3 reasons.
|
@renintw Ok, cycling back to your feedback. I think I addressed most of them except:
This is an external plugin and I suspect this functionality is already broken. We can address it in a later PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great update, this is much more discoverable than the little 🔍 tab.
I noted that if I'd like to get rid of the search suggestion block, I need to use the mouse to click elsewhere on the page instead of just pressing the ESC button. If so, users need to select the filter options first before typing in the search or they must use a mouse. I think in the original UX, the suggestion block can be gotten rid of by pressing ESC.
For what it's worth, using ESC to close the dropdown is working for me, in both Chrome & Firefox.
I really like this UI for the checked element 💯
I did notice the the autocomplete dropdown is now applied to the other searches too, like here in the block editor handbook. Hitting enter (ignoring the suggestions) does direct me to the correct search results page (ex, /block-editor/?s=block
), so I'd guess the autocomplete JS is a little too overzealous.
<nav id="site-navigation" class="main-navigation" role="navigation"> | ||
<button class="menu-toggle dashicons dashicons-arrow-down-alt2" aria-controls="primary-menu" aria-expanded="false" aria-label="<?php esc_attr_e( 'Primary Menu', 'wporg' ); ?>"></button> | ||
<?php | ||
$active_menu = is_post_type_archive( 'command' ) || is_singular( 'command' ) ? 'devhub-cli-menu' : 'devhub-menu'; | ||
wp_nav_menu( array( | ||
'theme_location' => $active_menu, | ||
'container_class' => 'menu-container', | ||
'container_id' => 'primary-menu', | ||
) ); ?> | ||
</nav> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must be a configuration issue. On the live site, the search gets |
5298c9c
to
74a6cfb
Compare
I added code to hide the menu on the homepage/reference, although the menu is still stacked under the search bar when you're looking at a page with the searchbar beside the site-title. Since production doesn't have a menu right now, as @ryelle mentions we can probably just follow it up later. @renintw I had to squash merge because of conflicts introduced in #40. Do you mind double-checking to make sure I didn't overwrite any changes? I had to manually merge them. 🙏 |
74a6cfb
to
236de42
Compare
I should have been more clear. I can use ESC to close dropdown in Chrome as well, but in Chrome it also clears the user input while Firefox doesn't. Note: A possible solution is mentioned in #57 |
236de42
to
1c1cac9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The search.js file is not needed anymore, since the tab UI was removed. These CSS selectors are also not used in the markup anymore.
It wasn't a config issue, this PR was removing the logic that added the class. I brought it back & styled the search a little more. I also removed some unused code now that we don't have the drawer-search UI. I'm going to merge this so it doesn't block other work. |
I included a fix for ^ in #114 |
Thanks for jumping in on this all! |
This PR is an experiment related to #40. Using the pattern directory & learn as the model, move the search bar into the site title.
Example
Screenshots
Function/Class/Hook
is_page( 'reference' )
I removed everything below the breadcrumb and above the 2 boxes since I didn't really know what to do with the layout and I'm not convinced they are used much.
is_search()
is_handbook && is_search()