Skip to content

Conversation

@SamP231004
Copy link

Summary

On mobile view, the sidebar (rendered as a dialog/sheet) hid the Language and Theme buttons.
To address this, a new MobileLanguageButton component has been introduced to render these controls as a fixed bottom bar, ensuring they remain visible and usable across all screen sizes.

Implementation Details

  • Added a new MobileLanguageButton component that:
    • Renders a fixed bottom bar containing Language 🌐 and Theme 🌙 controls.
    • Uses MenuTrigger + Popover to display the language selector above the bar (avoiding clipping issues).
    • Is styled to match the Umami theme and remain responsive across different viewport widths.
  • Updated sidebar rendering logic to import and render the MobileLanguageButton on mobile viewports.
  • Replaced previous CSS-only positioning with a self-contained, responsive component.
  • Ensured Popover uses placement="top" and fixed positioning to remain fully visible.

Why this fix

The original sidebar layout placed the language and theme buttons within the SidebarSection, which became hidden or clipped when the sidebar was rendered as a modal on mobile (Dialog_sheet).
This component-based approach keeps the buttons consistently visible, independent of the sidebar container’s rendering mode.

Screenshots

(Current look after fix)

After Fix - Screenshot 1     After Fix - Screenshot 2

Related Issue

Fixes #3690

Checklist

  • Verified fix on both desktop and mobile.
  • Popover opens correctly above the bottom bar.
  • Lint and tests pass locally.
  • Screenshots attached.

@vercel
Copy link

vercel bot commented Nov 10, 2025

@SamP231004 is attempting to deploy a commit to the umami-software Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Adds a new MobileLanguageButton component to make language and theme controls accessible in the mobile drawer, addressing issue #3690 where these controls were hidden in mobile view.

Key changes:

  • Created MobileLanguageButton component with language selector popover and theme toggle
  • Integrated component into MobileNav to render within the mobile drawer
  • Note: BarChart.tsx changes are from a previous commit (d1be7bc) and not part of this PR

Critical issue identified:
The component uses position: fixed which positions elements relative to the viewport, not the modal container. This will place the button bar at the bottom of the entire screen rather than within the mobile drawer, potentially overlapping page content when the drawer is open. The desktop SideNav component uses normal flow positioning within a SidebarSection, which should be the model for the mobile implementation.

Confidence Score: 2/5

  • This PR has a critical positioning bug that will cause incorrect rendering on mobile devices
  • The use of position: fixed in MobileLanguageButton will position the controls relative to the viewport instead of within the modal drawer, causing them to appear at the bottom of the screen rather than at the bottom of the drawer. This fundamentally breaks the intended functionality described in the PR.
  • src/components/input/MobileLanguageButton.tsx requires immediate attention - the fixed positioning approach needs to be replaced with normal flow positioning like the desktop SideNav implementation

Important Files Changed

File Analysis

Filename Score Overview
src/components/input/MobileLanguageButton.tsx 2/5 New component uses position: fixed which positions relative to viewport instead of modal container, likely causing the buttons to appear outside the drawer. Multiple styling issues with positioning and layout.
src/app/(main)/MobileNav.tsx 4/5 Simple addition of MobileLanguageButton component to mobile drawer. Clean integration but effectiveness depends on the positioning issues in the new component.

Sequence Diagram

sequenceDiagram
    participant User
    participant MobileNav
    participant MobileMenuButton
    participant Modal
    participant MobileLanguageButton
    participant LanguagePopover
    participant ThemeButton

    User->>MobileNav: Tap menu button
    MobileNav->>MobileMenuButton: Open mobile drawer
    MobileMenuButton->>Modal: Render modal (variant="sheet")
    Modal->>MobileNav: Render children
    MobileNav->>MobileLanguageButton: Render fixed bottom bar
    Note over MobileLanguageButton: Uses position:fixed<br/>relative to viewport
    MobileLanguageButton->>LanguagePopover: Render globe button
    MobileLanguageButton->>ThemeButton: Render theme toggle
    
    User->>LanguagePopover: Tap globe button
    LanguagePopover->>User: Show language list (placement="top")
    User->>LanguagePopover: Select language
    LanguagePopover->>MobileLanguageButton: saveLocale(value)
    
    User->>ThemeButton: Tap theme button
    ThemeButton->>User: Toggle theme
Loading

3 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +18 to +27
position: 'fixed',
bottom: 0,
left: 0,
padding: 16,
backgroundColor: 'var(--background)',
borderTop: '1px solid var(--border)',
gap: 8,
justifyContent: 'center',
zIndex: 1000,
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: position: fixed positions relative to the viewport, not the modal/dialog container. This will place the button bar at the bottom of the entire screen rather than within the mobile drawer, potentially overlapping other page content when the drawer is open.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/components/input/MobileLanguageButton.tsx
Line: 18:27

Comment:
**logic:** `position: fixed` positions relative to the viewport, not the modal/dialog container. This will place the button bar at the bottom of the entire screen rather than within the mobile drawer, potentially overlapping other page content when the drawer is open.

How can I resolve this? If you propose a fix, please make it concise.

style={{
position: 'fixed',
bottom: 0,
left: 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Missing right: 0 or width: 100% means the bar won't stretch full width across the screen.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/components/input/MobileLanguageButton.tsx
Line: 20:20

Comment:
**style:** Missing `right: 0` or `width: 100%` means the bar won't stretch full width across the screen.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +40 to +44
left: '0 !important',
right: '0 !important',
marginBottom: 16,
position: 'fixed',
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Using !important and setting both left and right to 0 is unusual. The popover positioning may conflict with the fixed positioning of the parent Row, causing rendering issues or misalignment.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/components/input/MobileLanguageButton.tsx
Line: 40:44

Comment:
**style:** Using `!important` and setting both `left` and `right` to 0 is unusual. The popover positioning may conflict with the fixed positioning of the parent Row, causing rendering issues or misalignment.

How can I resolve this? If you propose a fix, please make it concise.

position: 'fixed',
}}
>
<Dialog variant="menu" style={{ maxHeight: '60vh', overflowY: 'auto' }}>
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Using maxHeight: '60vh' with overflowY: 'auto' inside a modal that's already constrained may cause scrolling issues if the language list is long and combined with the fixed bottom positioning.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/components/input/MobileLanguageButton.tsx
Line: 46:46

Comment:
**style:** Using `maxHeight: '60vh'` with `overflowY: 'auto'` inside a modal that's already constrained may cause scrolling issues if the language list is long and combined with the fixed bottom positioning.

How can I resolve this? If you propose a fix, please make it concise.

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.

Language mode cannot be changed in mobile view

1 participant