-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Revise search to align better with Docsy #47975
base: main
Are you sure you want to change the base?
Conversation
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.
Moved, not new.
static/js/search.js
Outdated
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.
Moved, not removed.
✅ Pull request preview available for checkingBuilt without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
fb48337
to
81868af
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.
It looks like the search is now visible in the navbar on my smaller viewport (not visible on the current production website), even though I can see the intent to hide it using a media query in CSS (here). Not sure if this is intended behaviour or possibly a regression with these changes? Otherwise, these proposed changes are good.
Hmm, the style change you mention @dipesh-rawat doesn't match intent. I wonder if there's a tool to help uncover this kind of impact and test if it's a problem? I don't have a fleet of browsers etc to try it out with. |
34a98cd
to
bc1c158
Compare
@dipesh-rawat PTAL; I changed the approach here. |
@divya-mohan0209 if you have time to add your feedback, I'd appreciate that too. |
{{- partial "search-form.html" . }} | ||
</section> |
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.
Making this a section by itself allows us to make the search form take up less than the full viewport width.
<section class="row td-search-query"> | ||
<div class="col-12 col-md-4 offset-md-2"> | ||
<form class="td-sidebar__search d-flex align-items-center"> | ||
{{ partial "search-input.html" . }} | ||
</form> | ||
{{- partial "search-form.html" . }} | ||
</div> | ||
</section> |
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 results page also lets you do a new query. I've split that into its own section.
ab2abec
to
bf9f537
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
bf9f537
to
bcae880
Compare
bcae880
to
bfcdf6d
Compare
Will look wrong until #49630 has merged. |
} | ||
|
||
var query = $(this).val(); | ||
var searchPage = $(this).closest('form').data('search-page') + "?q=" + query; |
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.
Changed from the original line:
- var searchPage = $(this).data('search-page') + "?q=" + query;
+ var searchPage = $(this).closest('form').data('search-page') + "?q=" + query;
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.
bfcdf6d
to
742923e
Compare
Hmm. The mobile view doesn't seem right. |
@sftim why? It seems to be fine (with an exception for the 90% width, which would be fixed by your PR). P.S. Personally, I would also remove unnecessary left/right paddings to leave more space for the content itself. (If that sounds good, I can suggest a fix for it here.) |
Maybe it's just an artefact of the width. I'll octopus them together and check. |
742923e
to
91b0930
Compare
var searchPage = $(this).data('search-page') + "?q=" + query; | ||
document.location = searchPage; | ||
window.renderGoogleSearchResults = () => { | ||
var cx = '013288817511911618469:elfqqbqldzg'; |
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.
Future work: move this to a site variable or a build variable.
Needs more work; the search doesn't actually work right now! |
Co-authored-by: Dmitry Shurupov <[email protected]>
91b0930
to
35e73aa
Compare
If #49724 does a better job: great! This one can close. |
This is a small bit of change that (only slightly) helps us adopt Docsy. The associated JavaScript files are all moved to
assets
, allowing build-time minification.Preview, preview
/area web-development