docs icon indicating copy to clipboard operation
docs copied to clipboard

Fix search bar expansion to overlay navigation items

Open codeEvolveZenith345 opened this issue 1 month ago • 13 comments

Description:

Fixes #6332

Proposed Changes

  • Added CSS to make search bar expand as an overlay on desktop view when activated
  • Search bar now floats above navigation items (Home, Docs, About, Blog, Community) instead of compressing them
  • Logo, "Knative" title, and GitHub badge remain visible when search is expanded
  • Desktop-only fix using media query @media screen and (min-width: 76.25em)
  • No changes to HTML structure - pure CSS solution

https://github.com/user-attachments/assets/8426107f-ccfa-456e-9277-315235eed513

codeEvolveZenith345 avatar Nov 30 '25 05:11 codeEvolveZenith345

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: codeEvolveZenith345 Once this PR has been reviewed and has the lgtm label, please assign salaboy for approval. 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

knative-prow[bot] avatar Nov 30 '25 05:11 knative-prow[bot]

Deploy Preview for knative ready!

Name Link
Latest commit 02dc30a89e17135d8e1efac76566520451e55c77
Latest deploy log https://app.netlify.com/projects/knative/deploys/6932f51fcf8c8562422941c3
Deploy Preview https://deploy-preview-6532--knative.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 project configuration.

netlify[bot] avatar Nov 30 '25 05:11 netlify[bot]

/retest

codeEvolveZenith345 avatar Nov 30 '25 05:11 codeEvolveZenith345

@codeEvolveZenith345: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

knative-prow[bot] avatar Nov 30 '25 05:11 knative-prow[bot]

Hi! @dprotaso I have implemented the initial version to resolve #6332 . Please review it. The build is failing due to netlify-token issue, unrelated to my implementation. I have attached a demo-screenrecording for reference of implementation.

Thank you.

codeEvolveZenith345 avatar Nov 30 '25 05:11 codeEvolveZenith345

I have kept the expansion limited to the right side though, as the search bars normally remain on the side of their initial placement, then to expand over the entire screen.

codeEvolveZenith345 avatar Nov 30 '25 05:11 codeEvolveZenith345

I don't like the jitter that happens when you open it. Also the navigation text disappears so it doesn't look polished

dprotaso avatar Dec 04 '25 14:12 dprotaso

Hi @dprotaso It would be easier for me to implement if you could be specific about its behavior?

codeEvolveZenith345 avatar Dec 04 '25 15:12 codeEvolveZenith345

I request you to elaborate it thoroughly...

codeEvolveZenith345 avatar Dec 04 '25 16:12 codeEvolveZenith345

take a look at https://squidfunk.github.io/mkdocs-material/tutorials/

When you click the search bar it's right side is fixed and it expands to the left.

dprotaso avatar Dec 04 '25 17:12 dprotaso

I'm not seeing much difference between the changes in this PR and what we already have on the knative.dev website

dprotaso avatar Dec 05 '25 15:12 dprotaso

Hi! @dprotaso You are right, this PR is still under work, I tried to fix it but it is not complete yet, I am drafting it until I have not made it optimally working.

codeEvolveZenith345 avatar Dec 06 '25 05:12 codeEvolveZenith345

Hi! @dprotaso You are right, this PR is still under work, I tried to fix it but it is not complete yet, I am drafting it until I have not made it optimally working.

Actually the mkdocs serve seemed to show no difference either, so I thought It is not working due to some issue, as the git too did not give actual diff made at git diff --stat so I had to commit the partial fix so as not to loose the progress!

codeEvolveZenith345 avatar Dec 06 '25 05:12 codeEvolveZenith345