Skip to content

fix(ui): fix Activity and History buttons not opening sheet on mobile - #273

Merged
2witstudios merged 1 commit into
masterfrom
claude/fix-mobile-sidebar-buttons-6txQn
Jan 29, 2026
Merged

2witstudios merged 1 commit into
masterfrom
claude/fix-mobile-sidebar-buttons-6txQn

Conversation

@2witstudios

@2witstudios 2witstudios commented Jan 29, 2026 •

Copy link
Copy Markdown
Owner

The Activity and History buttons in GlobalAssistantView were only toggling
the rightSidebarOpen state, which controls the desktop sidebar. On mobile,
the sidebar is rendered as a Sheet component with separate state.

Changes:

  • Add leftSheetOpen and rightSheetOpen state to useLayoutStore (not persisted)
  • Update Layout.tsx to use sheet state from store instead of local useState
  • Update handleOpenActivity and handleOpenHistory to set both sidebar and
    sheet open states, ensuring visibility on all breakpoints

https://claude.ai/code/session_01TD1VRYC1c8UtJFMXXcvGYD

Summary by CodeRabbit

  • Refactor

    • Mobile sheet state for left/right panels moved from local component state to a centralized shared state for consistent behavior.
    • Added non-persisted mobile sheet state and explicit setters to control open/close behavior.
    • Toggle handlers now ensure opening one sheet closes the opposite one.
  • Bug Fixes

    • Right-hand panel now reliably opens on both desktop and mobile views.
  • Chore

    • Public component interfaces remain unchanged.

✏️ Tip: You can customize this high-level summary in your review settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jan 29, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Migrates mobile sheet open state from local component state to the centralized Zustand layout store by adding leftSheetOpen/rightSheetOpen and setters; Layout and GlobalAssistantView now read/update sheet state via the store, with logic to close the opposite sheet when opening one.

Changes

Cohort / File(s) Summary
Store State & Setters
apps/web/src/stores/useLayoutStore.ts
Adds leftSheetOpen and rightSheetOpen booleans and setLeftSheetOpen(open: boolean) / setRightSheetOpen(open: boolean) setters. These new flags are non-persisted and initialized to false.
Layout Component
apps/web/src/components/layout/Layout.tsx
Replaces local useState for left/right sheet open flags with store-backed leftSheetOpen/rightSheetOpen and setters. Updates toggle handlers and onOpenChange callbacks to use store setters and to close the opposite sheet when opening one; adjusts deps for related hooks.
Dashboard View
apps/web/src/components/layout/middle-content/page-views/dashboard/GlobalAssistantView.tsx
Now uses setRightSidebarOpen and setRightSheetOpen from the store and updates activity/history handlers to call both setters (true) to open desktop sidebar and mobile sheet.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant User as User
  participant GAV as GlobalAssistantView
  participant Store as useLayoutStore
  participant Layout as Layout (Sheet UI)

  User->>GAV: clicks "Open Activity"/"Open History"
  GAV->>Store: setRightSidebarOpen(true)
  GAV->>Store: setRightSheetOpen(true)
  Store-->>Layout: rightSidebarOpen/rightSheetOpen updated
  Layout->>Layout: render right sheet (close left if open)
  Layout-->>User: right sheet visible
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐇 I hopped between panels, soft and spry,

Sheets now settle at the store's small sigh,
Tap to open, one closes with grace,
A tidy burrowed, synchronous place,
I twirl my whiskers — code in its rightry.

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing Activity and History buttons to open sheets on mobile. It is specific, concise, and directly reflects the core issue being addressed across all modified files.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

@2witstudios
2witstudios force-pushed the claude/fix-mobile-sidebar-buttons-6txQn branch from 124f10e to 56e78ca Compare January 29, 2026 04:15

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
apps/web/src/components/layout/Layout.tsx (2)

98-170: Add missing sidebar setters to dependency arrays in these callbacks.

handleLeftPanelToggle uses setRightSidebarOpen on line 116 but doesn't include it in the dependency array. Similarly, handleRightPanelToggle uses setLeftSidebarOpen on line 159 but omits it from its dependency array. This will trigger react-hooks/exhaustive-deps and risks stale closures.

Add missing dependencies
   }, [
     isSheetBreakpoint,
     leftSheetOpen,
     rightSheetOpen,
     shouldOverlaySidebars,
     leftSidebarOpen,
     rightSidebarOpen,
     setLeftSheetOpen,
     setRightSheetOpen,
     setLeftSidebarOpen,
+    setRightSidebarOpen,
     toggleLeftSidebar,
   ]);

...

   }, [
     isSheetBreakpoint,
     leftSheetOpen,
     rightSheetOpen,
     shouldOverlaySidebars,
     leftSidebarOpen,
     rightSidebarOpen,
     setLeftSheetOpen,
     setRightSheetOpen,
+    setLeftSidebarOpen,
     setRightSidebarOpen,
     toggleRightSidebar,
   ]);

74-88: Add store setters to these effect dependency arrays.

These effects call setLeftSheetOpen and setRightSheetOpen from Zustand. Since the ESLint config enables react-hooks/exhaustive-deps (via next/core-web-vitals), the rule will flag these selector-based setters as missing dependencies. Include them in both dependency arrays:

Proposed fix
-  }, [isSheetBreakpoint]);
+  }, [isSheetBreakpoint, setLeftSheetOpen, setRightSheetOpen]);

...

-  }, [pathname, isSheetBreakpoint]);
+  }, [pathname, isSheetBreakpoint, setLeftSheetOpen, setRightSheetOpen]);

The Activity and History buttons in GlobalAssistantView were only toggling
the rightSidebarOpen state, which controls the desktop sidebar. On mobile,
the sidebar is rendered as a Sheet component with separate state.

Changes:
- Add leftSheetOpen and rightSheetOpen state to useLayoutStore (not persisted)
- Update Layout.tsx to use sheet state from store instead of local useState
- Update handleOpenActivity and handleOpenHistory to set both sidebar and
  sheet open states, ensuring visibility on all breakpoints

https://claude.ai/code/session_01TD1VRYC1c8UtJFMXXcvGYD
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