Monorepo for Tangled โ€” https://tangled.org

proposal: image upload through markdown editor #304

open
opened by boltless.me

a basic in-editor image uploader like GH has.

flow#

  1. user drag&drop or paste an image to textarea.
  2. instantly insert placeholder <!-- Uploading "image.png"... -->
  3. uploads the images to user PDS, get blob cid.
  4. convert the inserted placeholder to actual uri: ![image](blob-uri). (more on this below)

afaik this is exactly how GH editor works.

PDS has a garbage collection logic so directly uploading images before submitting the issue should be fine.

blob uri format#

embedding com.atproto.sync.getBlob endpoint is not ideal because PDS host might change. So we will store image with custom blob+at://did:plc:user/{blob cid} uri.

![image](blob+at://did:plc:user/aaabbbccc)

will be rendered as

<img alt="image" src="https://pds.user.com/com.atproto.sync.getBlob?did=did:plc:user&cid=aaabbbccc" />

or with camo:

<img alt="image" src="https://camo.tangled.sh/hash" />

implementation#

To reuse same editor for pulls or comments, this will be implemented as web component. I'm not sure if I want to maintain it from separate repository like actor-typeahead yet.

sign up or login to add to the discussion
Labels

None yet.

area
appview
assignee
boltless.me
Participants 1
AT URI
at://did:plc:xasnlahkri4ewmbuzly2rlc5/sh.tangled.repo.issue/3m67shjzxpv22