Skip to content

Conversation

@ihsraham
Copy link
Collaborator

@ihsraham ihsraham commented Dec 22, 2025

🚀 Summary

This PR aligns the Mobile Navbar with Figma designs (implementing a custom 2-row layout) and ensures the robustness of the Versioning Lifecycle Scripts (release, remove, reset).

Screenshots:

Mobileview:
image

Desktop view:
image


📐 Technical Decision: Mobile Header Customization

The Requirement

Strict adherence to Figma design:

  • Two-row mobile header.
  • Row 1: Logo (Left) + Close Button (Right).
  • Row 2: GitHub Icon (Left) + Version Switcher (Left) + Theme Toggle (Right).
  • Constraint: Default Docusaurus navbar hides the Version Switcher and GitHub icon inside the Menu Menu (hamburger body) on mobile, offering no configuration to move them to the header.

The Solution: Component Swizzling

We chose the Component Swizzling approach to wrapping the Navbar/MobileSidebar/Header component.

Why not a plugin?
No existing Docusaurus plugin supports arbitrary "Row-based" layout customization for the header. Plugins typically inject items, but do not restructure the DOM hierarchy.

Why Swizzling?
"Swizzling" is the official Docusaurus mechanism for deep structural customization when default configuration limits are reached.

Implementation Details

  • File: src/theme/Navbar/MobileSidebar/Header/index.tsx (Swizzled)
  • Logic: Re-implemented the header rendering to include an explicit "Tools Row" containing the Version Dropdown and Github Link, which are forced visible via CSS overlays.

🛠️ Technical Decision: Versioning Scripts & Configuration

The Requirement

A robust command-line flow to Release, Test, and Reset versions without corrupting the project state.

The Fixes

  1. Duplicate Route Resolution: Explicitly configured path: '0.5.x' for the frozen version in docusaurus.config.ts to prevent it from colliding with the current (0.6.x) docs at the root path /docs/.
  2. Legacy Sidebar Cleanup: Removed lingering legacySidebar references from versioned_sidebars snapshots, ensuring no warnings about missing directories.
  3. Script Logic: Validated release-version.js to ensure it snapshots correctly before bumping the package version.

✅ Verification

  • Release Flow: npm run version:release 0.5.x 0.6.x -> Success.
  • UI Check: Mobile Header correctly displays Version Switcher in the top area (Figma match).
  • Reset Flow: npm run version:reset 0.5.x -> Cleanly allows reverting to single-version state.

@ihsraham ihsraham requested a review from dpatsora as a code owner December 22, 2025 07:51
@ihsraham ihsraham changed the title Mobile Header Customization & Versioning Robustness YNU-620: Mobile Header Customization & Versioning Robustness Dec 22, 2025
@dimast-x
Copy link
Collaborator

dimast-x commented Jan 5, 2026

image image

The Position is good for me now, great job.
Have one thing left: for me, in Desktop mode the yellow line highlight is applied to the version switcher, and on mobile its both line and yellow background.

@dimast-x
Copy link
Collaborator

dimast-x commented Jan 5, 2026

On Whitepaper page it looks great and no yellow highlight. on other pages it's for some reason present

@nksazonov nksazonov merged commit 3638349 into master Jan 6, 2026
7 checks passed
@nksazonov nksazonov deleted the version-switcher-improved branch January 6, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants