Commit Graph
13 Commits
Author SHA1 Message Date
Menghuan1918 27e9417e63 merge: PR #966 — bounded retry for concurrent same-name upload rename contention 2026-10-29 23:28:16 +08:00
Menghuan1918 57fe6e657d test: 临时目录清理统一走 removeTree(修 Windows 上的 ENOTEMPTY 竞态)
CI 在 windows lane 上红在**清理**而不是断言:
`rmSync(scratch, { recursive: true, force: true })` 抛
`ENOTEMPTY: rmdir …archives-pvpAWR`——刚被 kill 的 zip/tar 子进程(以及刚关闭的
fs.watch / 刚结束的 git 子进程)还没被系统释放句柄,删除于是失败在一个**已经通过**
的用例的 afterEach 里(那一次 2466 个用例全过,只有清理挂掉,整个 lane 变红)。

`maxRetries` + `retryDelay` 正是 Node 为这种场景提供的对策,因此新增
`tests/temp-tree.ts` 的 `removeTree()`,把 30 份 spec(175 处 `{ recursive, force }`
写法)统一换过去,并清掉随之不再使用的 `rmSync` 导入。POSIX 上首次即成功、不触发
重试,行为不变。

本地:typecheck / lint 干净,全量 210 文件 / 2524 通过。
2026-10-16 00:51:11 +08:00
MXY 8e4abe1c44 fix(upload): 并发同名上传的 rename 争用 —— 有界重试 + 测试门闩
Windows 上 fs.rename 走 MoveFileExW(REPLACE_EXISTING):同一目标路径上的多个
rename 互斥,只让一个落地,其余被拒 EPERM(不是排队)。唯一 temp 名消除的是
源文件交叉,没消除目标路径互斥 —— 这正是「concurrent uploads to the same
target independent」这条契约没被兑现的原因。

实测(本机 Windows,真实 fs.rename 打到同一目标、barrier 启动让各方落在同一
瞬间、UV_THREADPOOL_SIZE=64 让它们真并行,各方均不重试):

  同时方数   每轮被拒方数   零被拒的轮数
  2          0–1            42/100
  8          2–5            0/50
  32         20–25          0/30

有界重试的档位(同一台机器):

  同时方数   limit=2        limit=5         limit=10
  8          28/50 轮失败   0/50            0/50
  32         50/50 轮失败   46/50 轮失败    0/50

- src/fs-operations.ts:新增 renameIntoPlace(),对 EPERM/EACCES/EBUSY 做有界
  重试(上限 10,setImmediate 让出事件循环),其余 errno 首次即抛。上限取自
  实测(见上表:32 方下 5 档不够、10 档干净)。JSDoc 改为如实描述:temp 名
  解决的是源文件交叉,rename 本身并不独立。
- tests/fs-operations.spec.ts:新增 bodiesThatMeet barrier,让并发方都到齐再
  一起放行(原写法「同时启动」证明不了重叠:实测两次 rename 的发起间隔中位数
  约 117μs,时间都花在写流上)。并发方数 2 → 8、用例跑 4 轮;断言一条未放宽。

验证(负对照,本机 Windows):
- 补丁不在(origin/main 原样):全量跑实测红在该用例,错误正是
  `EPERM: operation not permitted, rename ...`,栈顶 src/fs-operations.ts:107。
- 把 renameIntoPlace 换回裸 rename:该用例立刻红(1 failed)。
- 补上:29/29 绿、连跑 6 次稳定;typecheck 与 lint 干净。
- 全量:2463 passed / 5 failed;那 5 个失败与改动前逐字相同(plugin-meta 的
  tar CRLF 与 tasks-model 的中文 locale),均为本机环境既有、与本次改动无关。
2026-10-15 22:38:18 +08:00
Menghuan1918 27f71a3bd7 test: 适配流式传输 / JSONL / 大文件分页的新契约
- 新增 fs-read-page / jsonl / jsonl-language / file-stream-route 四个 spec
- 新增 archive 相关的两个 spec 之外的:写路由 spec 改指向 /sidebar/write,
  并补上「远超旧的 1 MiB JSON 上限的一次保存」这条回归
- 上传与 fs-operations 的 size cap 断言改为「远超旧上限仍成功且不留残file」
- 查看器契约 port 到 kind 联合 + largeFile;新增 editor-large-file 取代
  截断保存用例;内置 viewer 清单变 4 个
- smoke / plugin-shape 适配:删掉的四个配置键、新增的 /sidebar/write 路由、
  文件名对应的 route 错误码由 500 变 400、fs.read 的 too-large 分支
- smoke 的 GET 改走真 node:http(字节路由要真 Writable),并 closeAllConnections
  以免 undici 的 keep-alive 把用例拖过超时
- 21 份词典同步:18(+1) 个新 key、删除 truncation/zipProgress、
  pluginVideoPreviewDesc 去掉已不存在的 mediaLimit 说法

测试发现的两个真实缺陷一并修复:
- lang-jsonl 的字符串分支把 StringStream.next() 的 undefined 当成 null,
  遇到第一个未闭合字符串就无限增长直到 RangeError
- 分页读取原先锁死第一页嗅探到的编码,会让「长 ASCII 前缀 + GBK 正文」的
  文件后半段变乱码;改为只锁宽字符编码,字节序编码逐页各自嗅探(分页按行
  对齐,不会切断字符)
2026-10-11 22:36:42 +08:00
unsc9 832ff586b1 fix(fs): 恢复「指向根的链接可删」——根守卫改用 lstat,只看条目自己
上一提交的守卫用 stat,会跟随符号链接,于是「指向根的链接」被解析成根本身而被拒绝:
用户再也删不掉自己建的那个快捷方式。原代码比的是字符串,链接路径 ≠ 根路径,放行后
走 lstat 的 unlink 分支,只删链接本身、不递归 —— 这是个可用的行为,不该被顺手关掉。

改成 lstat:问的是「这一行条目本身是不是根」,链接就是它自己,不是它指向的东西。
于是链接恢复可删,而真正造成过事故的那些拼写 —— 大小写变体、\?\ 前缀、8.3 短名、
映射盘 —— 仍然全部被拒。

顺带消掉了「验身份用 stat、做动作用 lstat」的不一致:现在两次调用是同一个。

测试:fs-operations 那条 symlink→根 的用例由「拒绝」翻转为「删掉链接、项目完好」。
注意本机无创建软链接权限,该用例走 runIf(canSymlink) 被跳过,未能在本机实跑。
2026-10-05 11:31:54 +08:00
unsc9 fe7125ae3b refactor(safety): 复用既有 helper、归位注释——c8d5030 的质量收敛
不改变行为,只收敛上一提交引入的重复与错位:

- FileTree 会话重置改为复用 clearSelection():它自带「选中已空则返回」守卫,未选
  中时不再为一次重置白跑整棵树的 re-render。anchor 仍无条件清——取消最后一行选中
  会留下「空选中 + 非空锚点」,这个状态必须在切换时一并丢掉。依赖数组去掉已不再
  被该 effect 引用的 setSelection。
- fs-operations:isWorkspaceRoot 的 JSDoc 原本紧贴 sameSpelling 上方,结果
  sameSpelling 挂着两段注释,而真正执行安全守卫的函数反而没有文档——已归位,
  让「为什么必须比 dev+ino 而不是比字符串」跟着守卫走。
- 测试:task-window 三份重复挂载收进 beforeEach;git-view-worktree 新用例改用同
  文件已有的 makeRoot()(提到模块级,两个 describe 共用);fs-operations 的
  makeProject() 同样提出模块级,供软链接用例复用。

验证:typecheck 通过;改动文件 lint 干净;相关 6 个 spec 64 通过。其中
fs-operations 两条 symlink 用例在本机 EPERM(无创建软链接权限),stash 对比确认
改动前同样失败,与本次无关。
2026-10-05 11:31:54 +08:00
unsc9 74461c9954 fix(safety): 会话切换不再把上一项目的删除动作带进新项目
工作台每个 tab 一个常驻组件实例(tab id 按会话重新计数),会话/cwd 切换只换
props 不重挂,于是「指向某一行」的危险状态跨会话存活,执行时却用新会话的 scope:

- 文件树:选中集不清 → 批量删除用新 scope + 旧会话绝对路径(宿主按原样执行,
  工作区包含检查已刻意移除)→ 删掉别的项目的文件。现在切换即清空全部 path 型
  状态、批删进行标志与在轮询的打包任务。
- 变更页:右键菜单与待确认的「放弃更改 / 还原 / 拣选」不清 → onConfirm 闭包带
  旧行路径,而 gitScopeNow() 已在点击时读到新 scope → 在新项目里丢未提交改动。
- 任务窗口:两步删除的 armed 状态不清 → 切任务后第一次点击就是删除。

同时修掉工作区根守卫:原来比较两个字符串,同一目录的大小写变体、\\?\ 前缀、
8.3 短名、映射盘都能绕过,rm -r 真的递归删光整个项目。改为按 dev+ino 比较身份
(stat 跟随链接,指向根的链接也拒绝;拿不到 inode 或 stat 失败时退回归一化拼写)。

守护用例:file-tree-session-scope / task-window-delete-arm / GitLens scope swap
三条在未修复代码上均精确变红;fs-operations 增补 Windows 拼写变体与 symlink→根。
2026-10-05 11:31:54 +08:00
HuanLinOTO 9cc40472f8 fix(paths): Copilot review 四条全修——共享解析契约贯穿 media/html/fs 变更入口
- html 路由 decoder 保留 ~ 首段原样(~/x.html 不再被拼成绝对 /~/x.html),
  encoder/decoder 往返与相对资产解析均保持 ~ 标记(#713)
- media/download 路由去掉 isAbsolute 预拼接,raw 直达 ensureWorkspacePath
  (~ 展开不再被 cwd 前缀遮蔽);fs.trees 同型守卫
- fs-operations 的 rename/remove/mkdir(resolveEntry)与 upload(base)全部
  改走 resolveTarget 共享契约,会话相对路径四入口齐活(#646/#713)
- session-path 的 fs 落盘 remote-mirror 用例改为 Windows-only(win32.join 的
  meta 路径拼写在 POSIX 上不指向已创建文件,修 ubuntu ci 红)

新用例 8 个;四处变异验证(还原任一修复对应测试必红)。
2026-10-01 18:41:27 +08:00
Menghuan1918 5c95002641 perf(sidebar): fs.tree 22.8ms→3.8ms + 删除工作区路径检测(放开权限)+ 树展开状态按会话
用户实测反馈:

1) `/sidebar/api/fs.tree` 性能极差 —— 先测后改(10k 条目目录、热缓存、中位数):
   - 冷调用 cap=1000:22.76ms → **3.77ms**;TTL 内重复:≈23ms → **0.000ms**
   - 改法:opendir for-await → readdir(withFileTypes) 一次取回;只为 cap 条建行
     (slice + 定长数组);路径用字符串拼接而非 path.join;排序弃 localeCompare
     (14.6ms/10k → 0.35ms)改小写比较 + 原名码点兜底;新增 1.5s 目录级缓存
     (键 绝对路径\0cap,上限 512),由 fs.write/rename/remove/mkdir/upload 与
     fs-watch 的变更通知显式失效
   - 契约逐字不变;新增 tests/fs-tree.spec.ts 6 例 + fs-watch 失效用例(判别性验证)

2) 删除工作区路径检测(默认不检测、放开权限):
   - path-security 变纯词法解析(realpath/包含性判定删除)、fs-operations 去 fence
     分支、所有 fs 路由不再读 fence、403 分支消失、config 删 workspaceFence 字段
     (schemastery 容忍未知键,旧 profile 不会加载失败)、settings 开关删除
   - ⚠️ 安全影响:插件 fs 路由(tree/read/write/rename/remove/mkdir/媒体/HTML/
     upload/archive)现在可读写宿主用户可访问的任意路径,只受 OS 权限约束;
     指南 §8.1 已加醒目声明
   - 死代码清理:FenceErrorNotice 组件 + EditorHost 分支 + 4 个词条(settingsFence*、
     fenceErrorReason、fenceDisableAction)+ isOutsideWorkspace* 助手 + TreePanel 的
     store prop + 相关 CSS 块

3) 批量列举路由 `fs.trees`(单层失败只在该层带 error)+ 客户端批量加载:
   挂载/刷新时的 N+1 请求变为 1 个(8 个展开目录:9 → 1,探针断言)
   refreshTick 不再先清缓存(旧行保留到新答案;失败保留旧行 + warn 提示)

4) 修复「关闭文件后返回文件树,展开状态被重置」:
   原生承载面的展开集合原来存在每个 tab 的记录里(drop 即丢),改为**每会话状态**
   的投影(ensure 从会话态读、toggleExpanded 写回会话态、registerNativeSurface 用
   attachStore 订阅);同一会话多 tab 共享、不同会话隔离;revealed 保持 per-tab

验证:typecheck / lint / test(136 文件 / 1484 通过 / 9 跳过)/ build 全绿;
DSH_CMD='npx -y --package @deepseek-ai/dsh@0.1.7-rc.1 dsh' pnpm test:mount 7/7 通过;
版本镜像同步(dsh.plugin.json + SIDEBAR_SERVICE_VERSION)
2026-09-28 20:37:56 +08:00
Menghuan1918 e39ea92ade feat(files): tree rename (inline) + delete (confirmed) + submenu visual tether
资源管理器补全:文件树右键菜单新增「重命名」(行内编辑:预填+全选、
Enter/失焦提交、Esc 取消、IME 组合键守卫)与「删除」(Modal 确认,文件/
目录文案区分,永久删除——宿主无回收站)。根行(工作区根)不提供两项,
服务端 fs.rename/fs.remove 双保险拒绝;目标已存在 409;link-aware——
symlink 行只改/删链接本身(lstat 判定),fence 校验对解析后目标进行。

落定收尾:pruneTree 清旧前缀缓存 + 收起 stale expanded + 单层重载父目录;
tab 调解走 service(rename→updateTab 改路径改标题、delete→closeTab 关
受影响 tab,覆盖两侧分栏/底栏/浮动窗口,经 tree-mutations.ts)。

二级菜单视觉关系(layout.css,仍限 data-dsh-sidebar-submenu 作用域):
父行在子菜单打开期间保持高亮(宿主已渲染 aria-expanded="true"),
卡片间距 10px→4px(悬停走廊同步收窄),翻转规则一并 4px。

i18n 新增 7 key × 20 语言文件(locales.spec 的 key-set-parity 门禁)。
测试:fs-operations 追加 12 例(rename/remove 全失败面);新增
file-tree-rename-delete.spec.tsx 8 例(菜单可见性/重命名流/删除流/错误条);
menu-flip.spec.tsx 契约扩展覆盖 tether 规则。设计文档
docs/plans/2026-09-04-file-tree-rename-delete-design.md。
2026-09-04 22:08:02 +08:00
Menghuan1918 5a1e75e46b fix(lint): 清零存量 lint 告警并接入 CI / Makefile 门禁
存量清理(首跑 141 errors / 21 warnings → 0 / 0):
- 删除孤儿 disable:SideChatView / Sidebar / selection-popup 三处 exhaustive-deps 豁免与 chunk-artifact 的 no-new-func 豁免(多行理由注释把 disable-next-line 顶离了实报行;selection-popup 改为提取 popupOpen 标志真修复)
- 死代码:未用导入(Sidebar×7、TextEditor、SideCardSection、config、fs-operations 及 6 个 spec)、sidechat-core 死累加器 total、chunk-loader.spec 死助手 registry、sidechat-seed-validation 死助手 toolResultMessage
- 真实小修:agent-opens 三处 throw 补 cause;lazy-chunk any → ComponentType<P>(P extends object);service.ts claimed 初值改定值赋值;chunk-loader task / spec 内 etag / pendingLoad / snapshot 改 const;terminal-links 去掉字符类内多余转义;SubagentView catalogs 空兜底 useMemo 稳定标识;editor-host.spec 组件提出大写 FakeViewer(rules-of-hooks);pty-helpers.spec 内联 require 提升为静态导入;panel-host-css 注释里的零宽空格改为可见写法
- 依赖数组豁免(均带理由):granular scope 字段(EditorHost / PdfView / ChangesTab / GitLens×2)、job.status 粒度(SubagentView×2)、清理期读 ref、mount-only 注册等;ctx(挂载期恒定)直接入 deps(Sidebar×3)、TextEditor previewScroll 补 scope(幂等)
- 刻意控制字符正则(conversation-draft / markdown-images)与宿主槽位 any 签名(context-types)以带理由豁免保留

接入:
- Makefile:lint 目标(typecheck 旁),check 聚合补 lint 保持「对齐 CI」语义
- ci.yml ci / ci-windows 两 job 与 release.yml 在 Typecheck 后加 Lint 步骤(release 注释同步顺序)
2026-09-03 20:00:08 +08:00
kelvinwww e9ce58afea fix: 限制文件 API 访问会话工作区 2026-08-23 10:28:05 +08:00
bb2456bea9 feat(explorer): upload files into the workspace from the file tree (#239)
* feat(explorer): upload files into the workspace from the file tree

- TreePanel header: upload-files / upload-folder buttons (folder picker keeps
  the tree via webkitdirectory), with a one-line progress/result hint
- FileTree: drop files/folders onto the tree body (workspace root) or onto a
  directory row (that directory); directory context menu gains 上传到此处
- api.ts: uploadFile posts base64 to /sidebar/upload (host writes it through
  fs + shell decode; route provided for now by the local demo plugin)
- upload.ts: bytes->base64 (global-btoa-independent), FileList/DataTransfer
  collection, sequential upload with per-file results; ~48MB per-file cap
- locales: zh/en strings; icons: IconUploadOutline16

* fix(explorer): reload tree after upload and auto-dismiss the status hint

The drop/context-menu upload path cleared the level cache but never
refetched (the refreshTick bump belongs to the button path), so the
visible tree emptied and only the persistent '已上传 N 个文件' hint
remained — the tree only came back after reopening the tab.

- FileTree.uploadInto now reloads root + expanded levels after clearing,
  matching the refresh-tick path
- success status auto-dismisses after 3.5s (failures persist until the
  next action) in both TreePanel and FileTree

* feat(host): add the /sidebar/upload route (raw bytes, workspace-safe)

The file tree's upload UI needs a host route; until now it pointed at a
locally-injected demo route. This is the real implementation:

- src/index.ts: register POST /sidebar/upload (exact route, same fence and
  session-cwd resolution as every /sidebar route). Query params sessionId,
  dir, relativePath; the raw request body is streamed into the workspace.
- src/fs-operations.ts: writeWorkspaceUpload streams chunks to a temp
  sibling and renames into place, so a failed or oversized upload never
  leaves a partial file. Upload dir must sit inside the session cwd, the
  relativePath is sanitized (no '.', '..', empty or absolute segments) and
  the target must stay inside both.
- src/config.ts: uploadLimit (default 128MiB; oversized -> 413 too-large,
  a new wire code in src/wire.ts).
- client: send the File straight into the POST body (no base64 inflation)
  and cap at the same 128MiB (upload.ts, api.ts).

Tests: tests/fs-operations.spec.ts covers write, nested dirs, traversal /
containment refusal, the size cap, and no-partial-file on failure.
(pnpm test: only pre-existing node-pty/git sandbox failures, identical on
clean main; typecheck and build pass.)

* fix(host): harden upload containment, temp-file atomicity and stream failure cleanup

- relativePath: absolute paths and empty segments are refused (400), not
  silently collapsed or re-anchored (the spec's 'reject' semantics)
- temp file: uniquely named per request (randomUUID) so concurrent uploads
  to the same target stay independent; crashed-process leftovers never
  block later uploads (no pid reuse)
- write stream: permanent 'error' listener + error checks after every await
  so a failing disk rejects the operation instead of crashing the host or
  hanging the drain wait; the temp file is removed after the stream fully
  closes (Windows file locks), never leaving a partial file
- docstring now states the containment is lexical (symlink trust model)

* fix(explorer): thread upload error codes and cancellation through the client

- api.uploadFile/fetchUpload accept an AbortSignal (long-op convention);
  an aborted request rejects with the DOMException as-is instead of being
  wrapped into a 'network' error
- UploadResult carries the wire error code; the client pre-check now emits
  the same 'too-large' code as the host, and summarizeResults localizes
  'too-large' instead of showing the raw English 413 message
- uploadToDir stops the queue on abort: completed files stay, in-flight
  request is cancelled, nothing after is started
- uploadTooLarge copy no longer hardcodes a byte number (the host limit is
  configurable); MAX_UPLOAD_BYTES is documented as a mirror, not authority
- relativePathOf rejects absolute paths (isAbsolutePath) instead of
  stripping leading slashes, matching the host's 400 semantics
- progress text shared via uploadHintText for the hint and the overlay;
  success-hint duration is the exported UPLOAD_HINT_MS

* feat(explorer): full-window upload progress with cancel and VSCode-style drop targets

- UploadOverlay: blurred scrim + card over the file window (Modal token
  recipe: bg-mask-1 + mask blur, bg-layer-2, border-inverted, shadow-lv3),
  file-level progress bar, cancel button and Esc; scrim clicks do not abort
- TreePanel owns the upload session: header pickers, tree drag-drop and the
  context-menu picker funnel through startUpload; one session at a time
  (buttons disabled while busy, drops guarded); on settle the tree refreshes
  and the status hint shows success (3.5s, transient), failure or cancel
  (error color, stays)
- FileTree: drops on directory rows target that directory, drops on FILE
  rows target their parent (VSCode semantics, no more accidental root
  uploads), root row and body drop into the workspace root; drag-over
  highlights the target row (explorerRowDropTarget) plus the body outline
  and a hint pill (uploadDropHint / uploadTo) — raw-color inline outline
  replaced with the repo's dashed-accent classes
- upload status hint uses editorSearchHint + editorError like the search
  status; duplicated upload flow removed from FileTree (single caller)

* test: register the upload route in the smoke inventory

The new /sidebar/upload route joined the fenced route list, so the mount
assertion must expect it (the PR's CI gate was red).

* chore: bump to 0.14.1

Rebased onto main and cut a release version for the upload feature:
package.json / dsh.plugin.json / SIDEBAR_SERVICE_VERSION stay in sync
(test-guarded), README changelogs get the v0.14.1 entry.

* feat(explorer): keep the drop hint above DSH's page overlay and suppress its intake over the tree

DSH's whole-page image-drop intake (ui-conversation InputBar) listens on
document in the bubble phase: any 'Files' drag entering the page shows its
full-screen overlay (z-1000) and a drop anywhere adds images to the chat.
Our tree handled dragover/drop but not dragenter, so the overlay flashed
over the file window and drops outside the tree rows could leak to the
chat.

- TreePanel root now swallows dragenter/dragover/drop (preventDefault +
  stopPropagation) before the events reach document: the file window is an
  upload target, not an image target. Row/body handlers still fire first
  (bubble order) for their own targets; the root is the backstop for the
  search row, gaps and the search-results view.
- The drop hint pill is portaled to document.body at z-index 1001 — above
  DSH's overlay (z-1000) — so when a drag enters from outside the tree and
  DSH's mask lingers until dragend, our 'Drop files/folders here' /
  'Upload into {dir}' hint stays readable on top (transient decoration,
  pointer-events none; the drop still lands on the tree).

* feat(explorer): zone-split the drop overlays and fix the mask flicker over the sidebar

Sidebar.tsx's panel host now swallows the whole file-drag quartet
(enter/over/leave/drop, gated on the 'Files' type): DSH's document-level
intake keeps an enter/leave depth counter, and the leaves that escaped
the tree unbalanced it — that was the native full-screen mask flickering
over the sidebar. The region is now a black hole to that listener, so the
conversation column keeps DSH's native overlay and image intake while the
sidebar presents its own upload surface (drops over it never add images
to the chat).

The tree's drop affordance is now a pointer-inert frame portaled to
document.body at z-1001, anchored to the explorer body's viewport rect:
it replaces DSH's mask over the sidebar instead of competing with it, and
the hint pill docks at the bottom edge so the rows — the actual drop
targets — stay visible and aimable instead of sitting behind a centered
pill. Inside the tree, enter/leave depth counting (InputBar's own
pattern) replaces the relatedTarget check, which is unreliable for drag
events and flickered the row highlight on icon/label transitions; the row
target is now set authoritatively by the continuously-firing dragover.
dragleave handlers on rows are gone.

Polish: capsule hint pill with the upload icon and a float shadow, the
progress overlay fades in (the repo's dsh-row-in motion), its title gains
the icon, and progress numbers render tabular. tests/file-tree-drop.spec
pins the depth-counter behavior (child transitions keep the zone) and the
parent-directory drop semantics.

* feat(explorer): dim the whole viewport behind the tree's drop zone

The bottom-docked pill sat below the fold of attention; the zone frame
alone also failed to teach the left/right split — a drag over the sidebar
gave no hint that the conversation column still accepts drops (into the
chat, natively). The zone frame now carries the full-viewport dim itself
(a 200vmax box-shadow spread in DSH's own mask-drop token): everything
outside the tree's rect fades, the tree stays clear and aimable, and a
muted invitation centered in the space left of the zone (skipped under
200px) names the chat as the image target. The pill moves to the TOP edge
of the zone, right under the search row — the first thing the eye meets.

* feat(explorer): colorful drop heroes for both zones

The overlay is this flow's one brand moment, so it gets the color the
rest of the UI never does: hand-drawn SVG illustrations in the palette of
DSH's own native drop art (#3964FE/#679EFE/#9CE5ED) so the two zones read
as one family. The upload zone docks a hero at its top edge — a tray
illustration over the hint pill, stacked so the rows below stay aimable;
the chat zone's invitation becomes a tilted photo-cards card over its
label.

* feat(explorer): traverse dropped folders instead of reading dataTransfer.files

A dropped OS folder never surfaces in dataTransfer.files (that flat list
carries files only), so folder drops were silent no-ops while the UI
advertised 'drop files/folders'. uploadItemsFromDrop now captures entry
handles via webkitGetAsEntry — synchronously, since the dataTransfer enters
protected mode once the drop dispatch ends, while the captured handles stay
readable — then drains each directory's readEntries batches recursively,
prefixing every descendant's relative path. Entry-derived paths go through
the same sanitizer as picker paths; an entry that fails to read is skipped
rather than failing the whole drop, and the flat file list remains the
fallback where the entry API is unavailable. The FileTree drop handlers
ride the resulting promise.

---------

Co-authored-by: dsh local <dsh@local>
Co-authored-by: Menghuan1918 <menghuan2003@outlook.com>
2026-08-20 18:28:57 +08:00