Skip to content

Releases

v2.0.0 — gap-only folder expansion

Choose a tag to compare

@xuechengzou xuechengzou released this 29 Sep 09:03

What this is

A gap-only extension for the DSH web composer's file intake.

DSH core already ships the complete attachment pipeline (intake validation, streaming
upload, the draft rail, the drop overlay, verbatim storage). This plugin adds exactly
one thing the core does not do: expanding a dropped folder into its individual
files.

A dropped folder is walked with webkitGetAsEntry() (bounded to 2000 files / 16
levels), and the collected files are re-dispatched as an ordinary file-only drop
event — so the core's validation, limits, notices, rail, upload path and progress all
run exactly as if those files had been dropped directly.

Why 2.0.0

Version 1 predated the core attachment pipeline: it duplicated it (its own chip rail,
drop mask, toast, a drops/ directory and an agent/pre-step middleware), and it
registered its document drop listener in the capture phase with
stopPropagation(). Because capture runs before the core's bubble-phase listener, the
core never received a drop — enabling the plugin disabled the built-in drag & drop.

2.0.0 is a rewrite. It touches a dropped folder and nothing else:

  1. plain-file drops are never touched,
  2. no UI is rendered,
  3. the host half is an intentional no-op (inject: []),
  4. no parallel storage is written.

Compatibility

Verified against DSH 0.1.6-alpha.2, 0.1.7-alpha.1, and 0.2.0-rc.1.

The gate this plugin overrides is unchanged in 0.2.0 — ui-conversation's
addFiles() still returns attachment.directoryDesktopOnly when
globalThis.__DSH_HOST_PATHS__ is absent — and the core's drop listeners are still
bubble phase, so the capture-then-re-dispatch hand-off still works.

Install

dsh plugin --profile <profile> add <path-to-this-directory>

Two profile-level facts must hold; see the README.

MIT licensed.