Skip to content

fix(desktop): change sidebar project dropdown to open downward#1170

Merged
saddlepaddle merged 1 commit into
mainfrom
change-sidebar-dropdown-to-open-downward-instead-o
Feb 3, 2026
Merged

fix(desktop): change sidebar project dropdown to open downward#1170
saddlepaddle merged 1 commit into
mainfrom
change-sidebar-dropdown-to-open-downward-instead-o

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Feb 3, 2026

Summary

  • Converted the project header's ContextMenu (right-click triggered, opens at cursor position to the side) into a DropdownMenu (click-triggered on the chevron, opens downward below the trigger)
  • Added DropdownMenu imports and a dropdown version of the color picker submenu using DropdownMenuSub components
  • Positioned the dropdown with side="bottom" align="end" so it opens downward from the chevron trigger
  • Collapsed sidebar view remains unchanged (still uses right-click ContextMenu)

Test plan

  • Click the chevron (v) next to a project name in the expanded sidebar — menu should open downward below the trigger
  • Verify all menu items work: Rename, Open in Finder, Project Settings, Set Color, Close Project
  • Verify the "Set Color" submenu opens correctly from within the dropdown
  • Verify clicking the project name area still toggles collapse/expand
  • Verify the collapsed sidebar thumbnail right-click context menu still works as before

Summary by CodeRabbit

  • Refactor

    • Updated the project actions menu in the workspace sidebar to use a dropdown interface for improved accessibility and navigation.
    • Project actions (Rename, Open in Finder, Project Settings, Close Project) are now readily available through the dropdown menu.
    • Streamlined color selection to be directly accessible within the actions dropdown.
  • Bug Fix

    • Fixed tooltip positioning in the collapsed workspace sidebar so tooltips appear in the correct location.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 3, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Removed explicit side="right" positioning from TooltipContent in the collapsed sidebar rendering of ProjectHeader.tsx; tooltip now uses default positioning.

Changes

Cohort / File(s) Summary
Tooltip tweak
apps/desktop/src/renderer/screens/main/components/WorkspaceSidebar/ProjectSection/ProjectHeader.tsx
In collapsed sidebar branch, removed side="right" prop from TooltipContent, allowing tooltip to use default placement. One-line change (+1/-1).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Poem

🐰 A tiny tweak, a gentle slide—
Tooltip finds its place with pride.
No more forcing it to the right,
It hops and lands just where it's right. 🥕✨

🚥 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 describes the main change: replacing a ContextMenu with a DropdownMenu that opens downward instead of at the cursor position.
Description check ✅ Passed The description covers the main changes, implementation details, and includes a comprehensive test plan. However, it lacks some template sections like Related Issues and Type of Change.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch change-sidebar-dropdown-to-open-downward-instead-o

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.

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: 0

Caution

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

⚠️ Outside diff range comments (1)
apps/desktop/src/renderer/screens/main/components/WorkspaceSidebar/ProjectSection/ProjectHeader.tsx (1)

366-379: ⚠️ Potential issue | 🟠 Major

Incorrect aria-expanded attribute on dropdown trigger.

The aria-expanded={!isCollapsed} reflects the project section's collapse state, not whether the dropdown menu is open. This is misleading for assistive technologies. The DropdownMenuTrigger component automatically manages its own aria-expanded state based on the menu's open/closed state—remove this manual override.

🛠️ Proposed fix
 						<button
 							type="button"
 							aria-label="Project actions"
-							aria-expanded={!isCollapsed}
 							className="p-1 rounded hover:bg-muted transition-colors shrink-0 ml-1"
 						>
🧹 Nitpick comments (1)
apps/desktop/src/renderer/screens/main/components/WorkspaceSidebar/ProjectSection/ProjectHeader.tsx (1)

189-221: Consider extracting shared color picker rendering logic.

The dropdownColorPickerSubmenu and colorPickerSubmenu (lines 156-187) share identical rendering logic for color items. You could extract the common item rendering into a reusable function.

♻️ Optional: Extract shared rendering
// Shared color item renderer
const renderColorItems = (MenuItem: typeof ContextMenuItem | typeof DropdownMenuItem) => 
  PROJECT_COLORS.map((color) => {
    const isDefault = color.value === PROJECT_COLOR_DEFAULT;
    return (
      <MenuItem
        key={color.value}
        onSelect={() => handleColorChange(color.value)}
        className="flex items-center gap-2"
      >
        <span
          className={cn(
            "size-3 rounded-full border",
            isDefault ? "border-border bg-muted" : "border-border/50",
          )}
          style={isDefault ? undefined : { backgroundColor: color.value }}
        />
        <span>{color.name}</span>
        {projectColor === color.value && (
          <span className="ml-auto text-xs text-muted-foreground"></span>
        )}
      </MenuItem>
    );
  });

Remove side="right" from the collapsed sidebar project tooltip so it
opens downward (default) instead of to the side.
@saddlepaddle saddlepaddle force-pushed the change-sidebar-dropdown-to-open-downward-instead-o branch from 8df3a67 to 9536002 Compare February 3, 2026 20:12
@saddlepaddle saddlepaddle merged commit 3bf70da into main Feb 3, 2026
4 of 5 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 3, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

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

Thank you for your contribution! 🎉

@Kitenite Kitenite deleted the change-sidebar-dropdown-to-open-downward-instead-o branch February 5, 2026 01:35
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