docs icon indicating copy to clipboard operation
docs copied to clipboard

Fix: mobile navigation title visibility remove the custom double nav implementation

Open codeEvolveZenith345 opened this issue 1 month ago • 10 comments

Fixes #6328

Proposed Changes

This PR removes the custom double nav bar implementation and properly utilizes Material for MkDocs' native navigation.tabs feature, as recommended by @evankanderson.

Changes Made

  • overrides/partials/header.html: Removed hardcoded navigation tabs (lines 97-119) that created the double nav bar
  • docs/stylesheets/extra.css: Added mobile-specific CSS fixes to ensure site title remains visible during scroll on mobile devices

Key Improvements

  • Site name "Knative" now stays visible in header on mobile devices (< 1220px)
  • Removed confusing title switching behavior during scroll on mobile
  • Leverages Material's built-in responsive navigation instead of custom implementation
  • Desktop behavior unchanged (title still transitions on scroll as expected)
  • Tablet viewports properly handled (960px-1220px)

Before/After

Before (Mobile):

  • Page title hidden when scrolling
  • Navigation confusing with duplicate tab structures
  • Header appeared empty on scroll

https://github.com/user-attachments/assets/99a3e5df-981d-45f3-b308-8f790116492c

After (Mobile):

  • Site name "Knative" always visible in header
  • Clean navigation using native Material tabs
  • Consistent header appearance during scroll

https://github.com/user-attachments/assets/a90eab37-a601-4692-8ba8-6ad9780c10c6

codeEvolveZenith345 avatar Nov 15 '25 11:11 codeEvolveZenith345

Deploy Preview for knative ready!

Built without sensitive environment variables

Name Link
Latest commit bb5a3e851c3f33eb6550775399031ab11e96333a
Latest deploy log https://app.netlify.com/projects/knative/deploys/691b221d1f644a00082b60c6
Deploy Preview https://deploy-preview-6503--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 15 '25 11:11 netlify[bot]

[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 aliok 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 15 '25 11:11 knative-prow[bot]

/retest

codeEvolveZenith345 avatar Nov 15 '25 11: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 15 '25 11:11 knative-prow[bot]

Hi @evankanderson The PR is optimally tested and has built successfully...Please review it.

codeEvolveZenith345 avatar Nov 15 '25 15:11 codeEvolveZenith345

FYI - on desktop the nav is no longer visible

Uploading Screenshot 2025-11-16 at 11.29.30 AM.png…

dprotaso avatar Nov 16 '25 16:11 dprotaso

Hi @dprotaso Thanks a lot for pointing this out, I mistakenly dropped the nav for the desktop, it was not intentional...

Please review it and suggest modifications... I have fixed that but I need feedback on the current mobile behavior, is it ok to have just the title in the nav and not the other nav related as in desktop...?

codeEvolveZenith345 avatar Nov 17 '25 09:11 codeEvolveZenith345

I have fixed that but I need feedback on the current mobile behavior, is it ok to have just the title in the nav and not the other nav related as in desktop...?

Can you clarify your question?

FYI - I see the nav now on the home page properly. But this change doesn't seem to fix the original linked issue.

eg.

navigating to https://deploy-preview-6503--knative.netlify.app/docs/

and then scrolling to the bottom replace Knative with the nav bar with Overview. On mobile I only see Knative and the version picker (which i can't click)

dprotaso avatar Nov 17 '25 15:11 dprotaso

I'm not to familiar with how to fix this - unsure if @evankanderson knows

dprotaso avatar Nov 17 '25 15:11 dprotaso

I have fixed that but I need feedback on the current mobile behavior, is it ok to have just the title in the nav and not the other nav related as in desktop...?

Can you clarify your question?

FYI - I see the nav now on the home page properly. But this change doesn't seem to fix the original linked issue.

eg.

navigating to https://deploy-preview-6503--knative.netlify.app/docs/

and then scrolling to the bottom replace Knative with the nav bar with Overview. On mobile I only see Knative and the version picker (which i can't click)

Yeah, I actually misunderstoof the context of "double nav" for now I will draft this PR and open it once I have made the actual fix.

codeEvolveZenith345 avatar Nov 17 '25 19:11 codeEvolveZenith345