Skip to content

feat(desktop): drag workspace files into composer - #786

Closed
Blue-Berrys wants to merge 3 commits into
vastsa:mainfrom
Blue-Berrys:feat/issue-745-file-tree-drag
Closed

Blue-Berrys wants to merge 3 commits into
vastsa:mainfrom
Blue-Berrys:feat/issue-745-file-tree-drag

Conversation

@Blue-Berrys

Copy link
Copy Markdown
Contributor

Problem

Files shown in the bundled File Manager could not be dragged into the Composer, so users had to type a path or use the file picker instead.

Result

Regular, non-symlink file rows can now be dragged from the work panel into the Composer. A drop inserts one removable file chip using the workspace-relative path and leaves the source file in place. Direct and cross-WebContents delivery are deduplicated so one gesture creates one chip; directories remain navigation-only.

Closes #745

Validation

  • Manually verified on macOS with the bundled File Manager: drag a file row into the Composer and confirm exactly one chip is inserted
  • pnpm --filter @pi-desktop/shared build
  • pnpm --filter @pi-desktop/desktop typecheck
  • node --experimental-strip-types --test test/composer-drag-drop.test.mjs (6 passed)
  • node --test test/bundled-plugins.test.mjs (10 passed)
  • pnpm lint
  • pnpm docs:check
  • pnpm build:js

@vastsa

vastsa commented Sep 21, 2026

Copy link
Copy Markdown
Owner

感谢时间,最近pr 有点多,我慢慢理!

Keep workspace drag references compatible with the shared draft reference
converter after incorporating upstream changes.
Merge current main while preserving the pull request behavior and resolving overlapping changes.
@Tioit-Wang

Copy link
Copy Markdown
Collaborator

Thanks for this — and sorry for the wait, this one has been sitting for a while.

It looks like solid work, and it's close to something we can evaluate properly. The one thing we're missing is visual evidence: since this changes how the UI behaves, we can't judge the result from the diff alone.

Could you add screenshots to the description?

  • A full screenshot of the interface, showing the drag from the File Manager into the Composer in its real context.
  • A close-up (cropped) screenshot of the exact spot that changed, so the inserted file chip is clearly visible.
  • If it's easy to capture, a short screen recording or GIF of the drag gesture would show the behavior most directly.

With those attached we can see the actual result and make a confident call on merging.

@Tioit-Wang

Copy link
Copy Markdown
Collaborator

Thank you for the careful input checks — refusing absolute paths, drive letters and parent-directory hops is the right instinct, and the short dedupe window avoids double-adding the same file.

We asked for screenshots back in October and the branch has been quiet for over three weeks and now conflicts, so it is closed for now. The branch is preserved; a rebase plus those three captures (full window, close-up of the inserted chip, ideally a short recording) would bring it straight back.

谢谢你在输入校验上的细心——拒绝绝对路径、盘符和上级目录跳转是对的,那个很短的去重窗口也避免了同一个文件被加两次。

十月要的截图一直没到,这条已经三周多没有进展并且冲突,所以先关闭。分支保留;变基加上那几张(整屏、插入后的小标签特写,最好再来一段短录屏)就能直接回来。

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.

[Feature] 希望增加从右侧文件管理器拖动文件到对话框的功能

3 participants