Skip to content

ux(files): two drag-drop feedback gaps in the remote file browser / chat drop zones #143

Description

@weiesky

两条 v1.8.13(file browser modal upload + in-project drag-move + zone drag feedback)引入的拖拽边界,行为本身符合设计意图,但都缺一点视觉/反馈,容易让用户误以为是「没拖上」或出意外。均为打磨项,非功能性 bug。

1. 弹窗内拖「文件行」到目录树空白 → 静默移到项目根(无反馈)

现象:FileBrowserModal.jsx 的 ModalTreeNode 文件行用 useFileDropTarget(parentPathOf(childPath), onImportFiles, { onMove: undefined })(文件行不接移动,:155 onMove: isDir ? onMove : undefined)。useFileDropTarget 的 onDrop 对 internal 拖拽在无 onMove 时 isInternal===false 且不 stopPropagation,事件冒泡到树空白 useInternalMoveTarget('', handleMove),被当「移到项目根」处理。FileBrowserModal.jsx:594 注释标注这是「intentionally」,与侧栏「拖空白=移到根」parity 一致。

问题:行为合理,但整个过程无任何高亮/确认——dragover 阶段 canDropMoveOn 拿不到 data(HTML5 限制),树空白在文件行悬停时又被 handleTreePaneDragOverGuarded(e.target !== treePaneRef.current 挡掉)抑制高亮。用户拖文件行经过/落在树空白时,看不到「这将移到根」的提示,drop 后文件「消失」(被移到根),像意外。

建议(任选):

  • dragover 落在文件行/树空白且为 internal-move 时,给树空白一个「移到根」的弱高亮(即便无法校验 canDropMoveOn);
  • 或 drop 到树空白触发移动前,对「源是文件行」的情况给一次轻量确认/toast。

2. 桌面非聊天响应区 drop 被静默拒收(无提示)

现象:桌面分区拖拽反馈把上传收窄到 data-drop-zone="chat"(chatSection + terminalPanelWrap)。AppBase._onDrop 门禁 if (!isMobile && dragZone !== 'chat') return;。页眉 / 请求·会话列表等非 marker 区 drop 时被静默拒收。这是本 feature 的有意收窄(防止在非聊天区误拖文件触发上传),行为正确。

问题:拒收时零反馈——用户把文件拖到页眉/列表区,既无遮罩点亮、drop 后也毫无反应,无法分辨「这区本来就不收」还是「操作没生效」。

建议(轻量):在 _onDrop 的桌面拒收分支补一条短暂 toast(如「请拖到对话区上传」),复用既有 message.info,不改变收窄语义。

环境 / 定位

  • 版本:v1.8.13(3a737c97e),相关 commit 365af800e。
  • 涉及文件:apps/web/src/components/files/FileBrowserModal.jsx、apps/web/src/hooks/useFileDropTarget.js、apps/web/src/AppBase.jsx、apps/web/src/components/chat/ChatView.jsx。
  • 两条均为 UX 反馈打磨,不改既有拖拽/上传语义。

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions