Skip to content

feat: drag-and-drop folder to sidebar to create project - #647

Open
gcheng001 wants to merge 1 commit into
op7418:mainfrom
gcheng001:feat/drag-drop-folder-to-sidebar
Open

gcheng001 wants to merge 1 commit into
op7418:mainfrom
gcheng001:feat/drag-drop-folder-to-sidebar

Conversation

@gcheng001

Copy link
Copy Markdown

Summary

Allow users to drag a folder from Finder directly onto the ChatListPanel sidebar to create a new project session, bypassing the system folder picker.

Changes

  • Add onDragEnter/Over/Leave/Drop handlers to sidebar root container
  • Use preload's webUtils.getPathForFile to obtain folder path (File.path is empty under contextIsolation:true)
  • Validate dropped path via /api/files/browse to reject non-directories
  • Show drag-over overlay with dashed border and i18n tooltip
  • Counter-based dragDepthRef to handle nested dragleave bubbling
  • Non-Electron environments silently no-op
  • Add i18n keys: dropToCreateProject, dropFileNotFolder, dropCreateFailed

Motivation

Users often have project folders open in Finder and want to quickly start a session. Currently they must use the system folder picker dialog. Drag-and-drop is faster and more intuitive.

Test plan

  1. Open CodePilot in Electron
  2. Drag a folder from Finder onto the sidebar → should create a new project
  3. Drag a single file → should show "not a folder" error toast
  4. Drag over sidebar → dashed border overlay appears; drag away → overlay disappears
  5. In browser (non-Electron) → drag silently does nothing

Co-Authored-By: Claude Fable 5 noreply@anthropic.com

Allow users to drag a folder from Finder directly onto the ChatListPanel
sidebar to create a new project session, bypassing the system folder picker.

- Add onDragEnter/Over/Leave/Drop handlers to sidebar root container
- Use preload's webUtils.getPathForFile to obtain folder path (File.path
  is empty under contextIsolation:true)
- Validate dropped path via /api/files/browse to reject non-directories
- Show drag-over overlay with dashed border and i18n tooltip
- Counter-based dragDepthRef to handle nested dragleave bubbling
- Non-Electron environments silently no-op
- Add i18n keys: dropToCreateProject, dropFileNotFolder, dropCreateFailed

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the op7418's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the area:ui PR/issue 影响面: ui label Jun 29, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ui PR/issue 影响面: ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant