Monorepo for Tangled tangled.org

proposal: image upload through markdown editor #304

Closed boltless.me
Closed opened by and assigned to 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.

Seems quite important imo for certain types of bug reports or communicating visual changes.

Hi there, I gave this one a go, as I was missing it quite a lot when making issues and PRs: #2115

Thank you for the contribution! uhhh I should have linked existing works more properly. There is already a WIP PR for this but your version looks good in its own ways too! Especially the preview rendering is cool.

There are few more things I'd like to change from your PR so I'll close it & co-author you from different commit.

Thanks again for your hard work!

Ah too bad I missed it! Thanks for checking it out anyways.

I compared mines and yours and concluded yours are better in most ways, so I just merged it after few tweaks. Thanks for the contribution again!

Oh cool, thanks! Although I hear you're rewriting everything in Svelte now 😛 happy to help out there as well, but guessing it's too early for outside contributions.

Sign up or Sign in to add to the discussion.