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
ENH: Add search button that looks like field #1233
Conversation
this LGTM, I especially like that the keyboard shortcut is visible before user interacts with it. Based on your GIF it looks like having both the icon-style button and field-style button on the same page works fine, which means there's no risk of controlling it via "include this template name in the relevant part of your One request: needs to be documented in our user guide. One nitpick suggestion: the fully-rounded corners of the search field look visually out of sync with the "only slightly rounded" rectangles elsewhere in our theme. |
As a note and from an accessibility and usability point of view it's always best to have the icon + text of what it means (because symbols are not universal). There are studies revealing that from a usability pov user experience in order of best to worse are:
|
Hey all - I have limited time to do github stuff but can try to do a quick iteration so that this is ready to go. I'll add this to the docs and will fix the rounded corners you note @drammock @trallard I couldn't figure out if you were making a specific recommendation for this PR or not. Given the info in your comment, do you think this PR should be different? Are you suggesting the default should be this larger "text + button" combo rather than just the icon? |
Sorry was writing my comment in a rush as I am meant to be on holidays lol But yes I recommend making the default the "icon + text" variation |
+1 on this. I think ideally there would be an option to use the new field-like button on big screens and automatically switch to just the icon on small screens, but IDK how easy that will be and it would make sense as its own PR. |
AS on small screen, all the titles are disapearing I think there is plenty of room for the field-search button, don't you think ? In any case I agree it looks better in every way so it should be set as default |
if that's the case then awesome, no need for the separate PR to auto-switch to icon on small screen. I just haven't tested it so I don't know. |
Would you all be +1 on the following proposal?
This mimics how docusaurus does their search field button. |
I am +1 - there are some inconsistencies now with icons (and interactive states across the theme), but those are some things I will be tackling separately as part of a11y work so I am good with this proposal |
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.
could you make it the default search in the theme.conf
?
Definitely agree. I feel like it should be the same height as the version dropdown menu. (and thanks for the push, I am super limited in my bandwidth right now so please make whatever changes you like) |
agreed, it looks too big. |
I fixed the size on my local computer but the build is failing on all 3.11 tests and the RDT one (3.9) when executing nodeenv.py. Before I started loosing hair on this one does anyone fluent in reading nodeenv error traceback ? |
looks like the I don't understand why |
O don't understand, I copy pasted the package.json and package-lock.json from main and they are still marked as "changed" in the PR status. Can someone compared the files and confirm that I'm not getting crazy ? |
Hmmm this section seems relevant:
Maybe because we're removing this dependency here: But it's required elsewhere? Full error:
|
Can you try git fetch upstream
git switch main
git merge --ff-only upstream/main
git switch search-field-button
git restore --source main -- package.json
git restore --source main -- package-lock.json |
actually never mind my last comment; it looks like the branch needs a rebase? The change to
|
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.
dependency problem is now solved
I had a moment, so pushed a quick fix to the CSS so that this is now responsive. Are folks OK on merging this and iterating? I think I was the one that blocked this before and I'd be happy to move forward as long as there are no objections. |
thanks for unblocking this @choldgraf! |
I have gotten some feedback that the search button in the top right is a little bit harder for people to find and notice. In addition because it's just the single icon, some folks have reported they assumed it was just to trigger "in-page search" in the browser rather than docs-wide search.
I noticed that in many other docs sites, they have a "trigger search button" that still looks like a field. Would it be useful if we made this an option in our theme? Either by a component people could add, or a flag to trigger "behave like a field" in configuration, or a CSS rule on our current search button that would make it "expand" at wide screen widths and shrink to just the icon at short widths? (I think for mobile view we still want the button behavior, this is only for the wide screen view)
To prototype this I put together this little PR. The behavior is the exact same, but the "search button field-style" is just more noticeable. What do people think? Here's a little GIF of what it looks like in comparison