Skip to content

feat(desktop): move sidebar toggle to topbar with hotkey tooltip#1036

Merged
saddlepaddle merged 3 commits into
mainfrom
satya-patel/sidebar-toggle
Jan 28, 2026
Merged

feat(desktop): move sidebar toggle to topbar with hotkey tooltip#1036
saddlepaddle merged 3 commits into
mainfrom
satya-patel/sidebar-toggle

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Jan 28, 2026

Summary

  • Move sidebar toggle button from WorkspaceSidebarHeader to TopBar (positioned after traffic lights on Mac)
  • Display user's configured hotkey in tooltip using HotkeyTooltipContent
  • Clean up unused imports from WorkspaceSidebarHeader

Test plan

  • Verify sidebar toggle button appears in topbar after traffic lights
  • Verify tooltip shows "Toggle sidebar" with hotkey (⌘B on Mac)
  • Verify clicking the button toggles sidebar collapsed/expanded state
  • Verify hotkey ⌘B still works to toggle sidebar
  • Verify sidebar header no longer has toggle button (both collapsed and expanded views)

Summary by CodeRabbit

  • Refactor
    • Relocated the sidebar toggle control from the sidebar header to the top bar for improved UI organization and better accessibility.
    • Simplified the sidebar header interface to focus on workspace and task navigation.
    • Reorganized component structure for improved maintainability.

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

Move the sidebar toggle button from WorkspaceSidebarHeader to the TopBar,
positioning it after the traffic lights on Mac. The tooltip now displays
the user's configured hotkey using HotkeyTooltipContent.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 28, 2026

📝 Walkthrough

Walkthrough

This PR refactors the sidebar toggle UI by extracting it from the WorkspaceSidebarHeader component into a new SidebarToggle component located in the TopBar, while reorganizing component imports and establishing barrel exports for better module accessibility.

Changes

Cohort / File(s) Summary
Sidebar toggle logic removal
apps/desktop/src/renderer/screens/main/components/WorkspaceSidebar/WorkspaceSidebarHeader/WorkspaceSidebarHeader.tsx
Removed toggle state management, toggle button UI, icon logic (LuPanelLeft/LuPanelLeftOpen/LuPanelLeftClose), and tooltip from the header component; kept navigation UI (Workspaces, Tasks) intact.
New sidebar toggle component
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/components/SidebarToggle/SidebarToggle.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/components/SidebarToggle/index.ts
Created new SidebarToggle component with state-derived icon logic, hover handling, store integration, and tooltip with hotkey display; added index re-export.
TopBar reorganization
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/TopBar.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/index.ts
Rerouted component imports to local ./components/ paths, injected SidebarToggle into render tree, and added TopBar barrel export.
Barrel exports for TopBar components
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/components/OpenInMenuButton/index.ts, apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/components/OrganizationDropdown/index.ts, apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/components/WindowControls/index.ts
Added re-exports to expose components via index modules for cleaner import paths.
Import path updates
apps/desktop/src/renderer/routes/_authenticated/_dashboard/layout.tsx, apps/desktop/src/renderer/screens/main/components/StartView/StartTopBar.tsx
Changed TopBar import to relative path; updated WindowControls import to use route alias.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • CharlieHelps

Poem

🐰 The toggle hops up to the top bar's bright place,
No longer in headers, it runs at a faster pace!
With icons that dance and tooltips so sweet,
The sidebar refactor makes the UI complete! ✨

🚥 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
Title check ✅ Passed The title accurately and concisely describes the main change: moving the sidebar toggle button to the topbar with hotkey tooltip support.
Description check ✅ Passed The description is clear and mostly complete, with a summary of changes and a comprehensive test plan, though it lacks formal sections matching the template structure.

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

Reorganize TopBar to follow project structure guidelines:
- Extract SidebarToggle to its own subcomponent folder
- Move OpenInMenuButton, OrganizationDropdown, WindowControls to subfolders
- Add barrel exports (index.ts) for each component
- Rename index.tsx to TopBar.tsx with proper barrel export
Copy link
Copy Markdown
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: 1

🤖 Fix all issues with AI agents
In
`@apps/desktop/src/renderer/screens/main/components/TopBar/SidebarToggle/SidebarToggle.tsx`:
- Around line 28-37: The icon-only toggle button lacks accessible labeling and
state. Update the button element (the one using onClick={toggleCollapsed} and
rendering getToggleIcon(...)) to include an aria-label that changes based on the
collapsed state (e.g., "Collapse sidebar" vs "Expand sidebar") and set
aria-pressed (or aria-expanded) to reflect the current collapsed value; derive
the label/state from the component's collapsed/isCollapsed prop or state and
keep toggleCollapsed as the click handler so screen readers get both a
meaningful name and the current pressed/expanded state.

Comment on lines +28 to +37
<button
type="button"
onClick={toggleCollapsed}
className="no-drag group flex items-center justify-center size-8 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors"
>
<span className="group-hover:hidden">{getToggleIcon(false)}</span>
<span className="hidden group-hover:block">
{getToggleIcon(true)}
</span>
</button>
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.

⚠️ Potential issue | 🟠 Major

Add accessible labeling for the icon-only toggle.
Screen readers won’t have a usable name without an aria-label/pressed state.

✅ Suggested fix
 				<button
 					type="button"
 					onClick={toggleCollapsed}
+					aria-label="Toggle sidebar"
+					aria-pressed={collapsed}
 					className="no-drag group flex items-center justify-center size-8 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors"
 				>
🤖 Prompt for AI Agents
In
`@apps/desktop/src/renderer/screens/main/components/TopBar/SidebarToggle/SidebarToggle.tsx`
around lines 28 - 37, The icon-only toggle button lacks accessible labeling and
state. Update the button element (the one using onClick={toggleCollapsed} and
rendering getToggleIcon(...)) to include an aria-label that changes based on the
collapsed state (e.g., "Collapse sidebar" vs "Expand sidebar") and set
aria-pressed (or aria-expanded) to reflect the current collapsed value; derive
the label/state from the component's collapsed/isCollapsed prop or state and
keep toggleCollapsed as the click handler so screen readers get both a
meaningful name and the current pressed/expanded state.

Move TopBar from screens/main/components to routes/_authenticated/_dashboard/components
to properly co-locate it next to the layout that uses it. Update import paths accordingly.
@saddlepaddle saddlepaddle merged commit 3482561 into main Jan 28, 2026
5 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch
  • ⚠️ Electric Fly.io app

Thank you for your contribution! 🎉

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.

1 participant