Skip to content
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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sftim
Copy link
Contributor

@sftim sftim commented Sep 17, 2024

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

@k8s-ci-robot k8s-ci-robot added area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 17, 2024
@k8s-ci-robot k8s-ci-robot added the sig/docs Categorizes an issue or PR as relevant to SIG Docs. label Sep 17, 2024
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 17, 2024
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved, not new.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved, not removed.

@sftim sftim marked this pull request as draft September 17, 2024 20:26
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 17, 2024
Copy link

netlify bot commented Sep 17, 2024

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 38cec03
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/67abdcfb8b10860008fc6161
😎 Deploy Preview https://deploy-preview-47975--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sftim sftim force-pushed the 20240917_revise_search branch from fb48337 to 81868af Compare September 21, 2024 16:32
@sftim sftim marked this pull request as ready for review September 21, 2024 16:32
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 21, 2024
Copy link
Member

@dipesh-rawat dipesh-rawat left a 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.

@sftim
Copy link
Contributor Author

sftim commented Sep 24, 2024

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.

@sftim sftim marked this pull request as draft October 9, 2024 02:50
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 9, 2024
@sftim sftim force-pushed the 20240917_revise_search branch 2 times, most recently from 34a98cd to bc1c158 Compare October 19, 2024 02:10
@sftim sftim marked this pull request as ready for review October 19, 2024 02:11
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 19, 2024
@sftim
Copy link
Contributor Author

sftim commented Oct 19, 2024

@dipesh-rawat PTAL; I changed the approach here.

@sftim
Copy link
Contributor Author

sftim commented Oct 19, 2024

@divya-mohan0209 if you have time to add your feedback, I'd appreciate that too.

Comment on lines +1 to +3
{{- partial "search-form.html" . }}
</section>
Copy link
Contributor Author

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.

Comment on lines +20 to +26
<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>
Copy link
Contributor Author

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.

@sftim sftim marked this pull request as draft December 31, 2024 17:10
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 31, 2024
@sftim sftim force-pushed the 20240917_revise_search branch from ab2abec to bf9f537 Compare February 3, 2025 22:07
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from sftim. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 3, 2025
@sftim sftim force-pushed the 20240917_revise_search branch from bf9f537 to bcae880 Compare February 3, 2025 22:21
@sftim sftim marked this pull request as ready for review February 3, 2025 22:21
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 3, 2025
@sftim sftim force-pushed the 20240917_revise_search branch from bcae880 to bfcdf6d Compare February 3, 2025 22:47
@sftim
Copy link
Contributor Author

sftim commented Feb 3, 2025

Will look wrong until #49630 has merged.

}

var query = $(this).val();
var searchPage = $(this).closest('form').data('search-page') + "?q=" + query;
Copy link
Contributor Author

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;

Copy link
Contributor Author

@sftim sftim Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sftim
Copy link
Contributor Author

sftim commented Feb 4, 2025

Hmm. The mobile view doesn't seem right.

@shurup
Copy link
Member

shurup commented Feb 4, 2025

@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.)

@sftim
Copy link
Contributor Author

sftim commented Feb 4, 2025

Maybe it's just an artefact of the width. I'll octopus them together and check.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 7, 2025
@sftim sftim force-pushed the 20240917_revise_search branch from 742923e to 91b0930 Compare February 10, 2025 23:47
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 10, 2025
var searchPage = $(this).data('search-page') + "?q=" + query;
document.location = searchPage;
window.renderGoogleSearchResults = () => {
var cx = '013288817511911618469:elfqqbqldzg';
Copy link
Contributor Author

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.

@sftim sftim marked this pull request as draft February 11, 2025 11:52
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 11, 2025
@sftim
Copy link
Contributor Author

sftim commented Feb 11, 2025

Needs more work; the search doesn't actually work right now!

@sftim sftim force-pushed the 20240917_revise_search branch from 91b0930 to 35e73aa Compare February 11, 2025 19:41
@sftim
Copy link
Contributor Author

sftim commented Feb 23, 2025

If #49724 does a better job: great! This one can close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants