Skip to content

feat: move language and theme controls to mobile bottom nav#95

Open
jazzz2502 wants to merge 2 commits into
jpdevhub:mainfrom
jazzz2502:responsive-mobile-navbar
Open

feat: move language and theme controls to mobile bottom nav#95
jazzz2502 wants to merge 2 commits into
jpdevhub:mainfrom
jazzz2502:responsive-mobile-navbar

Conversation

@jazzz2502

@jazzz2502 jazzz2502 commented Jun 11, 2026

Copy link
Copy Markdown

Description

This PR resolves Issue #92 by improving the mobile navigation experience.

Changes Made

  • Hidden the language selector from the top navbar on mobile screens.
  • Hidden the theme toggle from the top navbar on mobile screens.
  • Added language selection controls to the mobile bottom navigation.
  • Added theme toggle controls to the mobile bottom navigation.
  • Preserved existing desktop navigation behavior.

Testing

  • Verified responsive behavior on mobile screen sizes.
  • Confirmed language switching works correctly from the bottom navigation.
  • Confirmed theme switching works correctly from the bottom navigation.
  • Verified no overlap or crowding occurs in the mobile navbar.

Closes #92

Summary by CodeRabbit

  • New Features

    • Theme toggle added to bottom navigation
    • Language selector (English, Hindi, Bengali) added to bottom navigation
  • UI/UX

    • Top navigation authentication/theme controls hidden on small screens for improved responsiveness

@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the karan3431's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

🎉 Thank you for your Pull Request! We're thrilled to have your contribution to FreshScan AI.

Before we review, please make sure you have:

  • Followed the CONTRIBUTING.md guidelines.
  • Ensured all automated CI checks (linting, tests) are passing.
  • Checked that your commit messages follow the Conventional Commits format.

A maintainer will review your code as soon as possible!

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid input: expected object, received boolean at "reviews.auto_review"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • 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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a6b740f3-b6f8-4957-8985-baa6a62a4dae

📥 Commits

Reviewing files that changed from the base of the PR and between c23c860 and 81d26ec.

📒 Files selected for processing (1)
  • src/components/BottomNav.tsx

📝 Walkthrough

Walkthrough

Theme and language controls are relocated from the top navbar to the bottom navigation component. The top navbar controls are hidden on mobile screens using responsive Tailwind classes, while the bottom navigation now displays a theme toggle button and language selector dropdown with English, Hindi, and Bengali options.

Changes

Responsive Mobile Navigation Controls

Layer / File(s) Summary
Bottom navigation theme and language controls
src/components/BottomNav.tsx
BottomNav imports SunMoon/Languages, useTranslation, and toggleTheme. It initializes i18n, renders a theme toggle button that calls toggleTheme(), and a language select bound to i18n.language that calls i18n.changeLanguage() with EN, HI, BN options.
Navbar responsive visibility
src/components/Navbar.tsx
Auth and theme controls wrapper class changes from flex to hidden md:flex, hiding these controls on small screens and showing them only on medium-and-up breakpoints.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant BottomNav
  participant toggleTheme
  participant i18n
  User->>BottomNav: Click theme button
  BottomNav->>toggleTheme: toggleTheme()
  User->>BottomNav: Select language option
  BottomNav->>i18n: changeLanguage(lang)
Loading

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A mobile nav so fine and bright,
Theme and tongue now take their flight,
To bottom safe on small-screen stage,
While top grows lean on every page!
Responsive, neat — a hopping delight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: moving language and theme controls from the top navbar to the mobile bottom navigation.
Linked Issues check ✅ Passed The PR fully addresses Issue #92 by hiding language/theme controls on mobile using Tailwind's hidden md:flex and moving them to BottomNav.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing responsive mobile navbar controls. No unrelated or out-of-scope modifications were made.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/Navbar.tsx`:
- Line 96: The right-side controls container in Navbar (the div with className
"hidden md:flex items-center gap-2 sm:gap-4") hides auth actions on mobile;
instead, remove or change that class so auth controls remain visible and only
non-auth controls (theme/language provided by BottomNav) are hidden on mobile.
Concretely, keep the outer container (in the Navbar component) visible on all
breakpoints (e.g., remove "hidden md:flex") and apply "hidden md:flex" (or a
similar responsive class) to a narrower wrapper that only surrounds the
language/theme controls (the BottomNav or its containing element), ensuring
login/profile/logout buttons remain in the always-visible area.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d54d6e37-d070-4a42-bdc0-06a2ef9107f9

📥 Commits

Reviewing files that changed from the base of the PR and between 8052c28 and c23c860.

📒 Files selected for processing (2)
  • src/components/BottomNav.tsx
  • src/components/Navbar.tsx

Comment thread src/components/Navbar.tsx

{/* Auth Button & Theme Toggle */}
<div className="flex items-center gap-2 sm:gap-4">
<div className="hidden md:flex items-center gap-2 sm:gap-4">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Auth controls are unintentionally hidden on mobile.

On Line 96, hidden md:flex is applied to the entire right-side controls container, which also contains login/profile/logout actions (not just language/theme). Since BottomNav only adds theme/language controls, mobile users lose auth access.

Proposed fix
-        {/* Auth Button & Theme Toggle */}
-        <div className="hidden md:flex items-center gap-2 sm:gap-4">
+        {/* Desktop-only language + theme */}
+        <div className="hidden md:flex items-center gap-2 sm:gap-4">
           <select
             value={i18n.language}
             onChange={(e) => i18n.changeLanguage(e.target.value)}
             className="bg-surface-low border border-outline-variant/30 px-2 py-1 text-xs"
 >
             <option value="en">EN</option>
             <option value="hi">HI</option>
             <option value="bn">BN</option>
           </select>
           {/* Theme Toggle Button */}
           <button
             type="button"
             onClick={toggleTheme}
             className="font-[family-name:var(--font-mono)] text-[9px] sm:text-[10px] tracking-widest text-on-surface-variant hover:text-neon transition-colors duration-200 border border-outline-variant/30 px-2 py-1 sm:px-3"
           >
             THEME
           </button>
+        </div>
+
+        {/* Auth controls remain available on mobile and desktop */}
+        <div className="flex items-center gap-2 sm:gap-4">
           {loggedIn ? (
             <div className="relative" ref={dropdownRef}>
               ...
             </div>
           ) : (
             <Link
               to="/auth"
               ...
             >
               ...
             </Link>
           )}
         </div>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/Navbar.tsx` at line 96, The right-side controls container in
Navbar (the div with className "hidden md:flex items-center gap-2 sm:gap-4")
hides auth actions on mobile; instead, remove or change that class so auth
controls remain visible and only non-auth controls (theme/language provided by
BottomNav) are hidden on mobile. Concretely, keep the outer container (in the
Navbar component) visible on all breakpoints (e.g., remove "hidden md:flex") and
apply "hidden md:flex" (or a similar responsive class) to a narrower wrapper
that only surrounds the language/theme controls (the BottomNav or its containing
element), ensuring login/profile/logout buttons remain in the always-visible
area.

@jazzz2502

Copy link
Copy Markdown
Author

Screenshot 2026-06-11 at 10 25 10 PM(BEFORE)
Screenshot 2026-06-11 at 10 23 44 PM(AFTER)

@jazzz2502

Copy link
Copy Markdown
Author

@jpdevhub can you please check this pr

@jpdevhub

Copy link
Copy Markdown
Owner

You removed the mode part ?

@jazzz2502

Copy link
Copy Markdown
Author

You removed the mode part ?

You're right. I removed the MODE item while making space for the language and theme controls on mobile.

I checked the codebase and /mode is still actively used. I'll restore the MODE navigation item and update the PR shortly.

@jazzz2502

Copy link
Copy Markdown
Author

I have restored the MODE item in the mobile bottom navigation and pushed the update. Thanks for catching that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UI/UX] Responsive Mobile Navbar for Language & Theme

2 participants