Skip to content

Revise mobile nav to Bootstrap structure, aligned with Docsy#54700

Open
ritorhymes wants to merge 1 commit intokubernetes:mainfrom
ritovision:bs-refactor-mobile-nav
Open

Revise mobile nav to Bootstrap structure, aligned with Docsy#54700
ritorhymes wants to merge 1 commit intokubernetes:mainfrom
ritovision:bs-refactor-mobile-nav

Conversation

@ritorhymes
Copy link
Copy Markdown
Contributor

@ritorhymes ritorhymes commented Feb 26, 2026

Summary

To better align with the Docsy migration #41171, which integrates Bootstrap, this PR reworks the mobile header/navigation to use Bootstrap collapse-driven structure and behavior in a Docsy-aligned implementation. The resulting UI is near-identical to the original in form and function with several bug fixes implemented, no impact on desktop, and better maintainability than the prior custom coded solution. A migration plan to Docsy 0.7 with Bootstrap 5.2 is included.

Changes

  • Replaces the legacy pushmenu flow with a right-side mobile drawer pattern built on Bootstrap primitives and existing site navigation data.

  • Updates versions/languages mobile accordion behavior so both sections are no longer stuck in an always-open state. The versions section is closed by default since it is not universally essential to see immediately. Languages stays open by default to let users quickly navigate to their needed language.

  • Localizes mobile navigation ARIA labels for toggle/close controls to improve accessibility and translation support.

Migration Plan for Docsy 0.7 with Bootstrap 5.2

Required for BS5.2 compatibility

  1. Update Bootstrap data attributes in layouts/partials/navbar.html
  • data-toggle -> data-bs-toggle
  • data-target -> data-bs-target
  • data-parent -> data-bs-parent
  1. Update Bootstrap utility classes in layouts/partials/navbar.html
  • ml-* -> ms-*
  • mr-* -> me-*
  • sr-only -> visually-hidden

Out of scope (optional follow-up)

A) Migrate Bootstrap collapse API calls to native BS5 instances

  • $().collapse('hide'|'toggle') -> bootstrap.Collapse instance methods.
  • Not required: BS5.2 exposes a jQuery bridge when jQuery is present on window (Docsy 0.7 still loads jQuery). Works as-is unless jQuery is removed or disabled via data-bs-no-jquery.
  • Recommended as best practice to remove conditional dependency.

B) Full jQuery-to-vanilla DOM rewrite in nav.js and legacy-script.js

  • This is a broader dependency cleanup and not required for BS5.2 navbar compatibility once Bootstrap plugin calls are migrated.

C) Convert current collapse-based drawer to BS5 offcanvas

  • Recommended later to reduce custom drawer state/animation code.

Why jQuery calls can survive this migration

  • BS5.2 can expose a jQuery bridge when jQuery is present on window and not disabled via data-bs-no-jquery on .
  • Result: $().collapse() calls can continue to work under BS5.2 as long as jQuery remains loaded and the bridge is not disabled.
  • Because this is conditional behavior, native bootstrap.Collapse calls are still the more durable long-term target.

@k8s-ci-robot k8s-ci-robot added the area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes label Feb 26, 2026
@k8s-ci-robot
Copy link
Copy Markdown
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 assign natalisucks for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details 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 requested a review from lmktfy February 26, 2026 19:23
@k8s-ci-robot k8s-ci-robot added the sig/docs Categorizes an issue or PR as relevant to SIG Docs. label Feb 26, 2026
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 26, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Feb 26, 2026

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 4f67da8
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-io-main-staging/deploys/69cc273cb0cf3a000867c5cc
😎 Deploy Preview https://deploy-preview-54700--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 project configuration.

@lmktfy
Copy link
Copy Markdown
Member

lmktfy commented Feb 26, 2026

A nit: this is not a refactor in the way people usually use the word.

@ritorhymes
Copy link
Copy Markdown
Contributor Author

What would you recommend as the best way to categorize / describe it?

@lmktfy
Copy link
Copy Markdown
Member

lmktfy commented Feb 26, 2026

/retitle Revise mobile nav to Bootstrap structure, aligned with Docsy

@k8s-ci-robot k8s-ci-robot changed the title refactor mobile nav to Bootstrap structure aligned with Docsy Revise mobile nav to Bootstrap structure, aligned with Docsy Feb 26, 2026
@lmktfy
Copy link
Copy Markdown
Member

lmktfy commented Feb 26, 2026

"Revise" not "refactor".

@ritorhymes
Copy link
Copy Markdown
Contributor Author

ritorhymes commented Feb 26, 2026

That’s fair.

I was on the fence about using refactor versus migrate, but I used refactor because the intent was to keep the core UX behaviors functionally near-identical while aligning the implementation with the already established dependencies. Reworked is also good too.

Copy link
Copy Markdown
Member

@lmktfy lmktfy left a comment

Choose a reason for hiding this comment

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

If this gets an LGTM I am happy to be the approver for it.

@ritorhymes ritorhymes force-pushed the bs-refactor-mobile-nav branch from 591e904 to ccacdfe Compare February 26, 2026 21:37
@k8s-ci-robot k8s-ci-robot added the language/en Issues or PRs related to English language label Feb 26, 2026
@lmktfy
Copy link
Copy Markdown
Member

lmktfy commented Mar 7, 2026

Might help with #54801

@ritorhymes ritorhymes force-pushed the bs-refactor-mobile-nav branch from ccacdfe to 0350d8b Compare March 30, 2026 08:56
Reworks the mobile header/navigation to use Bootstrap collapse-driven
structure and behavior in a Docsy-aligned implementation.

Replaces the legacy pushmenu flow with a right-side mobile drawer pattern
built on Bootstrap primitives and existing site navigation data.

Preserves desktop navbar behavior while keeping the mobile UI visually
near-identical to the pre-refactored version.

Centers the mobile logo in the header, fixing the offset left quirk.

Updates versions/languages mobile accordion behavior so both sections are no
longer stuck in an always-open state. The versions section is closed by
default since it is not universally essential to see immediately. Languages
stays open by default to let users quickly navigate to their needed language.

Localizes mobile navigation ARIA labels for toggle/close controls to improve
accessibility and translation support.

Signed-off-by: Rito Rhymes <rito@ritovision.com>
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. language/en Issues or PRs related to English language 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.

3 participants