Skip to content

feat(ui): enable the attachment button in the editor - #19

Merged
gnacho merged 1 commit into
mainfrom
feat/issue-18-attachment-button
Sep 13, 2026
Merged

gnacho merged 1 commit into
mainfrom
feat/issue-18-attachment-button

Conversation

@gnacho

@gnacho gnacho commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Closes #18.

Uploading a file stores it with the Notes API v1.4 endpoint and inserts a reference at the textarea cursor: an image for image files, a link otherwise. The reference keeps the Nextcloud-compatible form .attachments.<noteId>/<name> and is percent-encoded so it parses as a markdown destination.

The preview resolves those references by fetching the bytes with the authenticated client and using cached blob URLs, so images render without making the endpoint public. Blob URLs are applied after sanitizing, and revoked when the note changes or the component unmounts. The host CSP already allows img-src ... blob:.

Failures show in the editor, including the 32 MiB cap.

Verification:

  • npm run build and vue-tsc --noEmit pass
  • Browser walkthrough with Playwright: upload inserts the reference at the cursor, a repeated name de-duplicates with the percent-encoded form, saving persists it, the preview renders the images through blob URLs, reload keeps the content, deleting the note removes its attachments, 0 JS errors

Uploading a file stores it with the Notes API v1.4 endpoint and inserts a
reference at the textarea cursor: an image for image files, a link otherwise.
The reference keeps the Nextcloud-compatible form .attachments.<noteId>/<name>
and is percent-encoded so it parses as a markdown destination.

The preview resolves those references by fetching the bytes with the
authenticated client and using cached blob URLs, so images render without
turning the endpoint public. Blob URLs are applied after sanitizing, and
revoked when the note changes or the component unmounts.

Failures are shown in the editor, including the 32 MiB size cap.

Closes #18
@gnacho
gnacho merged commit a3329b4 into main Sep 13, 2026
@gnacho
gnacho deleted the feat/issue-18-attachment-button branch September 13, 2026 10:00
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.

Enable the attachment button in the editor

1 participant