Skip to content

fix: restore mobile sidebar accessibility#432

Open
LaibaFirdouse wants to merge 1 commit into
potpie-ai:mainfrom
LaibaFirdouse:fix/mobile-sidebar-trigger
Open

fix: restore mobile sidebar accessibility#432
LaibaFirdouse wants to merge 1 commit into
potpie-ai:mainfrom
LaibaFirdouse:fix/mobile-sidebar-trigger

Conversation

@LaibaFirdouse

@LaibaFirdouse LaibaFirdouse commented Jun 25, 2026

Copy link
Copy Markdown

Summary

This PR restores access to the mobile sidebar by rendering SidebarTrigger from the shared application layout.

Problem

On viewports below 768px, the sidebar is rendered as a Sheet, but no visible trigger is available to open it, making navigation inaccessible.

Solution

  • Render SidebarTrigger in app/(main)/layout.tsx
  • Show it only on mobile using md:hidden
  • Preserve existing desktop behavior

Testing

Verified on:

  • New Chat
  • Chat
  • Integrations
  • Workflows

Fixes #431

Summary by CodeRabbit

  • New Features
    • Added a mobile-only sidebar toggle in the main app layout, making navigation easier on smaller screens.
  • Bug Fixes
    • Improved the main content layout so the sidebar control appears in the appropriate mobile view without affecting desktop display.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

app/(main)/layout.tsx now renders a mobile-only SidebarTrigger above the main content so the sidebar can be opened on small viewports.

Changes

Main layout mobile sidebar trigger

Layer / File(s) Summary
Render mobile sidebar trigger
app/(main)/layout.tsx
Imports SidebarTrigger and updates MainContent to render a md:hidden trigger container before children inside <main>.

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 I hopped by the layout, light and neat,
A sidebar trigger now helps mobile feet.
Below the md burrow, the button appears,
And navigation returns for the wandering ears. 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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 clearly matches the main change: restoring mobile sidebar access.
Linked Issues check ✅ Passed The change adds a visible mobile SidebarTrigger in the shared layout, matching issue #431's requirement.
Out of Scope Changes check ✅ Passed The PR stays focused on the mobile sidebar trigger fix and does not introduce unrelated changes.

✏️ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
app/(main)/layout.tsx (2)

56-71: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Type MainContent as a TypeScript FC for consistency.

Lines 56-71 define MainContent as a plain function; this should follow the TS FC typing convention used by the repo guideline.

Suggested change
-function MainContent({ children }: { children: React.ReactNode }) {
+const MainContent: React.FC<{ children: React.ReactNode }> = ({ children }) => {
   return (
     <main
       className={cn(
         "flex flex-1 flex-col gap-4 lg:gap-6 transition-all duration-300",
         `${GeistSans.variable} ${GeistMono.variable}`
       )}
     >
       <div className="md:hidden p-2">
         <SidebarTrigger />
       </div>
       {children}
     </main>
   );
-}
+};

As per coding guidelines, "**/*.tsx: Use functional components with TypeScript FC types."

🤖 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 `@app/`(main)/layout.tsx around lines 56 - 71, MainContent is currently
declared as a plain function; update it to use the repo’s TypeScript FC
convention for consistency. Adjust the MainContent component definition in the
layout component to be typed as a React FC while keeping its existing children
prop and JSX behavior unchanged.

Source: Coding guidelines


13-13: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consolidate duplicate sidebar imports.

Line 13 adds a second import from @/components/ui/sidebar; merge it into the existing Line 8 import to keep import grouping/order consistent.

Suggested change
-import { SidebarInset, SidebarProvider, useSidebar } from "`@/components/ui/sidebar`";
+import { SidebarInset, SidebarProvider, SidebarTrigger, useSidebar } from "`@/components/ui/sidebar`";
...
-import { SidebarTrigger } from "`@/components/ui/sidebar`";

As per coding guidelines, "**/*.{ts,tsx}: Order imports: React/Next imports first, then components, then utilities."

🤖 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 `@app/`(main)/layout.tsx at line 13, There is a duplicate import from
"`@/components/ui/sidebar`" in the layout component; consolidate it into the
existing sidebar import to keep imports grouped and ordered correctly. Update
the imports in app/(main)/layout.tsx so the SidebarTrigger symbol is merged with
the other sidebar exports in the same import statement, preserving the
React/Next, components, utilities ordering guideline.

Source: Coding guidelines

🤖 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.

Nitpick comments:
In `@app/`(main)/layout.tsx:
- Around line 56-71: MainContent is currently declared as a plain function;
update it to use the repo’s TypeScript FC convention for consistency. Adjust the
MainContent component definition in the layout component to be typed as a React
FC while keeping its existing children prop and JSX behavior unchanged.
- Line 13: There is a duplicate import from "`@/components/ui/sidebar`" in the
layout component; consolidate it into the existing sidebar import to keep
imports grouped and ordered correctly. Update the imports in
app/(main)/layout.tsx so the SidebarTrigger symbol is merged with the other
sidebar exports in the same import statement, preserving the React/Next,
components, utilities ordering guideline.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 535069b7-8930-49f5-8213-b37db1cf0862

📥 Commits

Reviewing files that changed from the base of the PR and between 3722332 and 06689ff.

📒 Files selected for processing (1)
  • app/(main)/layout.tsx

@LaibaFirdouse

Copy link
Copy Markdown
Author

Hi @nndn ,could you please review this.

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.

[Bug]: Mobile sidebar trigger is not rendered below 768px

1 participant