Skip to content

feat(web): drop a folder on the sidebar to add a project - #17

Merged
yordis merged 3 commits into
mainfrom
yordis/feat-drop-folder-to-add-project
Aug 17, 2026
Merged

feat(web): drop a folder on the sidebar to add a project#17
yordis merged 3 commits into
mainfrom
yordis/feat-drop-folder-to-add-project

Conversation

@yordis

@yordis yordis commented Aug 17, 2026

Copy link
Copy Markdown
Member
  • Adding the first project is the one thing every install has to do, and it required knowing the app's vocabulary before anything worked: a command palette, an environment, a source, and a typed path.
  • Dragging a folder in is how every other app on the machine takes a directory, and it is what people try first. An empty sidebar already looks like a drop target whether or not it is one.
  • Dropping opens a prefilled confirmation instead of adding silently, so an accidental drop is still recoverable and the path stays visible before anything is created.

Adding the first project is the one thing every install has to do, and it
required knowing the app's vocabulary before anything worked. Dragging the
folder in is what people try first, especially against an empty sidebar that
already looks like a drop target.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@cursor

cursor Bot commented Aug 17, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Additive UX and optional bridge API; project creation still goes through the existing confirm/browse flow with no new server paths.

Overview
Desktop users can drag a folder onto the sidebar to start adding a project. The sidebar only enables drop handling when desktopBridge.getPathForDroppedFile exists (Electron preload uses webUtils.getPathForFile); browser tabs keep normal drag behavior with no fake drop target.

Drops open Add project with the folder path prefilled for confirmation rather than creating a project silently. The command palette bus and reducer now accept an optional path on the add-project intent; startAddProjectAtPath skips environment/source pickers, routes WSL UNC paths via shared resolveWslProjectTarget, and closes the palette with a toast if the primary environment is unavailable.

New makeProjectFolderDropHandlers covers drag enter/leave flicker, file-only drops, and path resolution failures. Empty-sidebar copy mentions “or drop a folder here,” with a dashed outline while dragging.

Reviewed by Cursor Bugbot for commit 2774e0d. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Aug 17, 2026
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@yordis, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 36 minutes

Limit details: You’ve used all 1 included review currently available under your plan.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: afe4e6e1-bc21-4e15-9d55-f078deddb000

📥 Commits

Reviewing files that changed from the base of the PR and between c27da9a and 2774e0d.

📒 Files selected for processing (1)
  • apps/web/src/components/CommandPalette.tsx

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b6d51f28-e724-4aa4-bf3f-4ac06e2eb483

📥 Commits

Reviewing files that changed from the base of the PR and between aaf82e9 and c27da9a.

📒 Files selected for processing (12)
  • apps/desktop/src/preload.ts
  • apps/web/src/commandPaletteBus.ts
  • apps/web/src/components/CommandPalette.logic.test.ts
  • apps/web/src/components/CommandPalette.logic.ts
  • apps/web/src/components/CommandPalette.tsx
  • apps/web/src/components/Sidebar.tsx
  • apps/web/src/components/sidebar/projectFolderDrop.test.ts
  • apps/web/src/components/sidebar/projectFolderDrop.ts
  • docs/fork/0008-drop-a-folder-to-add-a-project.md
  • docs/fork/README.md
  • docs/user/thread-sidebar.md
  • packages/contracts/src/ipc.ts

Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review.


Walkthrough

The desktop sidebar now accepts dropped project folders. The preload bridge resolves dropped-file paths, and the command palette opens Add Project with a validated, prefilled path. Tests and documentation cover the new desktop-only flow.

Changes

Desktop folder drop

Layer / File(s) Summary
Dropped-file path contract
packages/contracts/src/ipc.ts, apps/desktop/src/preload.ts
The IPC contract defines DroppedFileHandle and optional path resolution. The preload bridge returns resolved paths or null for invalid handles and empty paths.
Sidebar folder drop handling
apps/web/src/components/sidebar/projectFolderDrop.ts, apps/web/src/components/sidebar/projectFolderDrop.test.ts, apps/web/src/components/Sidebar.tsx
Desktop file drags activate the sidebar target. The handler finds the first folder, resolves its path, creates the project, and reports rejected drops. Tests cover drag state, child transitions, valid folders, and invalid entries.
Add Project path propagation
apps/web/src/commandPaletteBus.ts, apps/web/src/components/CommandPalette.logic.ts, apps/web/src/components/CommandPalette.logic.test.ts, apps/web/src/components/CommandPalette.tsx
Add-project intents carry an optional path. Path-based opens validate the primary environment and start browsing at the supplied path. Existing pathless opens retain the picker flow.
Folder drop documentation
docs/fork/0008-drop-a-folder-to-add-a-project.md, docs/fork/README.md, docs/user/thread-sidebar.md
Documentation describes desktop folder drops, feedback, invalid drops, local-device scope, remote alternatives, and browser limitations.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to c27da

This PR adds folder drag-and-drop project creation with a confirmation step; no actionable merge-blocking risk remains based on the supplied evidence.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Sidebar
  participant DesktopBridge
  participant CommandPalette
  participant Environment
  User->>Sidebar: drop project folder
  Sidebar->>DesktopBridge: resolve dropped folder path
  DesktopBridge-->>Sidebar: return folder path
  Sidebar->>CommandPalette: open Add Project with path
  CommandPalette->>Environment: validate primary connection
  Environment-->>CommandPalette: return connection status
  CommandPalette->>CommandPalette: open browse view at path
Loading

Suggested reviewers: juliusmarminge, t3dotgg

Poem

A rabbit drops a folder bright,
The sidebar guides it into sight.
A path is found, the checks all pass,
Add Project opens with the class.
Invalid hops get toasted fare—
Desktop folders now travel there.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the motivation but omits the required What Changed, Why, UI Changes, and Checklist sections. Use the template headings, describe the implementation, explain the rationale, add UI screenshots or a video, and complete the checklist.
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: adding a project by dropping a folder on the sidebar.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch yordis/feat-drop-folder-to-add-project

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.

Comment thread apps/web/src/components/CommandPalette.tsx
The palette only opens to host the add-project surface, so bailing out of it
should not strand the user somewhere they never chose to be.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 78575e7. Configure here.

Comment thread apps/web/src/components/CommandPalette.tsx
A UNC path names a folder inside a Linux distro, not on the Windows host, so
sending it to the host environment could never produce a working project. The
folder picker already knew this; dropping deserves the same answer.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis

yordis commented Aug 17, 2026

Copy link
Copy Markdown
Member Author
Screen.Recording.2026-08-17.at.6.28.59.AM.mov

@yordis
yordis merged commit 14e2959 into main Aug 17, 2026
10 of 15 checks passed
@yordis
yordis deleted the yordis/feat-drop-folder-to-add-project branch August 17, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant