Skip to content

Support dropped text files as new docs#1671

Open
dicnunz wants to merge 1 commit intoBoostIO:masterfrom
dicnunz:fix-dropped-text-file-docs
Open

Support dropped text files as new docs#1671
dicnunz wants to merge 1 commit intoBoostIO:masterfrom
dicnunz:fix-dropped-text-file-docs

Conversation

@dicnunz
Copy link
Copy Markdown

@dicnunz dicnunz commented May 9, 2026

Summary

  • add support for dropping .md, .txt, .html, and .htm files to create new docs
  • create dropped-file docs in the target workspace, folder, or current content-manager context
  • keep the existing internal folder/doc drag-and-drop behavior intact

Fixes #1151

Reproduction

The existing cloud drag-and-drop handlers only read BoostNote internal doc/folder transfer data. Dropping a local text file onto a workspace, folder, or document list does not create a document from the file content.

Changes

This adds a file-drop path to the shared cloud DnD hook. Supported text files are read with FileReader, sent through the existing createDoc API, titled from the file name, and inserted into the local doc plus parent workspace/folder maps after creation.

Tests

  • npm ci
  • ./node_modules/.bin/eslint src/cloud/lib/hooks/sidebar/useCloudDnd.ts src/cloud/lib/hooks/sidebar/useCloudSidebarTree.tsx src/cloud/components/ContentManager/index.tsx --ext .ts,.tsx
  • ./node_modules/.bin/tsc --noEmit
  • npm run test-api -- --runInBand
  • npm run lint
  • git diff --check

Bounty

Submitted for the $50 IssueHunt bounty: https://issuehunt.io/repos/74213528/issues/1151

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

Create a document by drag and drop with a text file(.md, .txt and .html)

2 participants