Skip to content

fix: mobile nav bar#701

Merged
DenhamPreen merged 1 commit intomainfrom
dp/fix/mobile-navbar
Sep 1, 2025
Merged

fix: mobile nav bar#701
DenhamPreen merged 1 commit intomainfrom
dp/fix/mobile-navbar

Conversation

@DenhamPreen
Copy link
Contributor

@DenhamPreen DenhamPreen commented Sep 1, 2025

open the docs.envio.dev from your phone and click on the nav bar to see what it was doing before

Summary by CodeRabbit

  • New Features
    • Mobile navbar sidebar now spans the full viewport height with a fallback for broader browser support.
    • Sidebar content scrolls independently, and the container prevents clipping for smoother navigation.
    • Improved layering ensures the sidebar and backdrop appear above other elements.
    • When the sidebar is open, pointer events on the main navbar are disabled to prevent accidental interactions and improve focus.

@vercel
Copy link

vercel bot commented Sep 1, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
envio-docs Ready Ready Preview Comment Sep 1, 2025 2:24pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 1, 2025

Walkthrough

Adds CSS to implement a full-viewport-height mobile navbar sidebar, using 100dvh with 100vh fallback. Sets calculated heights for sidebar items, enables inner scrolling, prevents clipping, and adjusts pointer events and z-index layering when the sidebar is shown.

Changes

Cohort / File(s) Summary
Mobile navbar sidebar CSS
src/css/custom.css
Introduces .navbar-sidebar, .navbar-sidebar__items, .navbar-sidebar__item.menu; adds state selectors for .navbar.navbar-sidebar--show ...; applies height: 100dvh with @supports not (height: 100dvh) fallback to 100vh; enables scrollable inner lists; updates pointer-events and z-index for proper layering and interaction.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I hop through viewports, tall and bright,
A sidebar stretches to the height.
With dvh dreams and vh in tow,
I scroll the menus, smooth as snow.
Z-index stacks, the layers sing—
Tap, tap! The navbar does its thing.
—your CSS-savvy bunny 🐇✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dp/fix/mobile-navbar

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Comment on lines +406 to +408
.navbar.navbar-sidebar--show .navbar-sidebar {
z-index: 10001;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is needed to show in front of the "ask ai" box

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/css/custom.css (2)

373-380: Use modern viewport units + safe-area; avoid over-constraining height

Prefer a resilient combo and account for notches. Also, setting both top/bottom and height over-constrains the box.

 .navbar-sidebar {
-  top: 0; /* start at very top */
-  bottom: 0;
-  height: 100dvh; /* modern mobile viewport unit */
+  top: 0; /* start at very top */
+  /* Let height be driven by min/height, not bottom */
+  /* bottom: 0; */ /* remove to avoid over-constraint */
+  /* Prefer small/large/dynamic vh mix for mobile chrome/safari bars */
+  min-height: 100svh;
+  height: 100dvh; /* dynamic viewport */
+  padding-bottom: env(safe-area-inset-bottom, 0);
   display: flex;
   flex-direction: column;
 }

401-404: pointer-events: none may disable the close toggle

In Docusaurus, the mobile toggle lives in .navbar__inner. Disabling pointer events there can prevent closing the sidebar via the toggle.

 .navbar.navbar-sidebar--show .navbar__inner {
   pointer-events: none;
 }
+/* Keep the toggle clickable while sidebar is open */
+.navbar.navbar-sidebar--show .navbar__inner .navbar__toggle {
+  pointer-events: auto;
+}

To verify, open mobile view, open the sidebar, and try tapping the toggle icon. If it doesn’t respond, apply the patch.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ad5b855 and c093b59.

📒 Files selected for processing (1)
  • src/css/custom.css (1 hunks)
🔇 Additional comments (1)
src/css/custom.css (1)

406-412: Align sidebar z-index with project stack

  • In src/css/custom.css (lines 407 & 411), replace the hard-coded 10001/10000 with values just above the navbar (e.g. 1100/1090) or use existing CSS variables if defined.
  • Audit shows no other z-index declarations in src/css; confirm the base navbar z-index (and any CSS vars) before merging.

Comment on lines +382 to +386
@supports not (height: 100dvh) {
.navbar-sidebar {
height: 100vh; /* fallback */
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Fallback incomplete: .navbar-sidebar__items still uses 100dvh

On browsers without 100dvh, the calc() using 100dvh in the items block becomes invalid, breaking layout.

 @supports not (height: 100dvh) {
   .navbar-sidebar {
     height: 100vh; /* fallback */
   }
+  .navbar-sidebar__items {
+    height: calc(100vh - var(--ifm-navbar-height));
+    max-height: calc(100vh - var(--ifm-navbar-height));
+  }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@supports not (height: 100dvh) {
.navbar-sidebar {
height: 100vh; /* fallback */
}
}
@supports not (height: 100dvh) {
.navbar-sidebar {
height: 100vh; /* fallback */
}
.navbar-sidebar__items {
height: calc(100vh - var(--ifm-navbar-height));
max-height: calc(100vh - var(--ifm-navbar-height));
}
}

Comment on lines +388 to +399
.navbar-sidebar__items {
margin-top: var(--ifm-navbar-height);
height: calc(100dvh - var(--ifm-navbar-height));
max-height: calc(100dvh - var(--ifm-navbar-height));
overflow: visible; /* avoid clipping links; let inner list handle scroll */
flex: 1 1 auto;
}

/* Let the inner list area scroll instead of the container */
.navbar-sidebar__item.menu {
overflow-y: auto;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Scrollable area assigned to wrong element; results in no scrolling

The container (.navbar-sidebar__items) has fixed height but overflow: visible; putting overflow-y: auto on the inner .menu won’t create a scrollable region. The scroll should live on the sized container.

 .navbar-sidebar__items {
   margin-top: var(--ifm-navbar-height);
   height: calc(100dvh - var(--ifm-navbar-height));
   max-height: calc(100dvh - var(--ifm-navbar-height));
-  overflow: visible; /* avoid clipping links; let inner list handle scroll */
+  overflow: hidden; /* contain contents */
+  overflow-y: auto; /* scrolling lives here */
+  -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
   flex: 1 1 auto;
 }
 
 /* Let the inner list area scroll instead of the container */
 .navbar-sidebar__item.menu {
-  overflow-y: auto;
+  overflow: visible; /* no scroll here */
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.navbar-sidebar__items {
margin-top: var(--ifm-navbar-height);
height: calc(100dvh - var(--ifm-navbar-height));
max-height: calc(100dvh - var(--ifm-navbar-height));
overflow: visible; /* avoid clipping links; let inner list handle scroll */
flex: 1 1 auto;
}
/* Let the inner list area scroll instead of the container */
.navbar-sidebar__item.menu {
overflow-y: auto;
}
.navbar-sidebar__items {
margin-top: var(--ifm-navbar-height);
height: calc(100dvh - var(--ifm-navbar-height));
max-height: calc(100dvh - var(--ifm-navbar-height));
overflow: hidden; /* contain contents */
overflow-y: auto; /* scrolling lives here */
-webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
flex: 1 1 auto;
}
/* Let the inner list area scroll instead of the container */
.navbar-sidebar__item.menu {
overflow: visible; /* no scroll here */
}
🤖 Prompt for AI Agents
In src/css/custom.css around lines 388 to 399, the scrollable area is assigned
to the inner .navbar-sidebar__item.menu while the sized container
.navbar-sidebar__items has overflow: visible, so no scrolling occurs; change
overflow on the sized container to create the scrollable region by setting
.navbar-sidebar__items to overflow-y: auto (or overflow: auto) and remove
overflow-y: auto from .navbar-sidebar__item.menu so the element with fixed
height handles scrolling.

@DenhamPreen DenhamPreen merged commit fcf33f7 into main Sep 1, 2025
3 checks passed
@DenhamPreen DenhamPreen deleted the dp/fix/mobile-navbar branch September 1, 2025 14:29
This was referenced Oct 30, 2025
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.

2 participants