Insert placeholder text in post while uploading

GitHub’s upload dialog has a handy placeholder in the editor while your upload is being processed:

In Discourse I tend to take my fingers off the keyboard as long as I’m downloading something, because the download link will be inserted wherever my cursor is at the time.

10 Likes

Sure, not a bad idea, up to @zogstrip. If it is hard may need to wait for a future release.

1 Like

Just pushed the upload placeholder :bird:

https://github.com/discourse/discourse/commit/38cb72b3294230caee2ab7f11b8f90c43b68969d

6 Likes

Works! Looks like this:

Very nice improvement, excellent suggestion @erlend_sh

2 Likes

Fantastic!

Funnily enough I think your server was running an update of sorts just now, because my first test pic uploaded perfectly, but then the updates were constantly stalling, both here and on Try (page loads were also slow, so I’m pretty sure it was server). Perfectly fine and snappy again now.

Because I happened to experience a longer than usual loading time, I did notice a few minor quirks, but both might be quite hard to do anything about:

  • Cancelling the upload doesn’t remove the inserted upload placeholder text. I can see why this might be tricky.
  • GitHub doesn’t even offer a cancel option…
  • If the upload is finished in the background while the smiley selector is open, my smiley will be inserted into the image link, breaking it.
  • Interestingly, following those same steps in GitHub ends with no smiley being inserted. Maybe they encountered this too, and solved it.
3 Likes

Kind of edge case, but I noticed that if you’re typing something above the placeholder, your typing position will be forced to the end of the placeholder when it finishes. Like:

I'm typing something above this image and sudd
<img src="//assets-meta-cdck-prod-meta.s3.dualstack.us-west-1.amazonaws.com/original/3X/8/8/889493f5d072349533b284ba007ec0384f0cc2a2.jpg" width="690" height="215"> enly it's continued here.
1 Like

That’s now fixed with

https://github.com/discourse/discourse/commit/e65ddc6c253fb89ce992a3610f60ccf6a30b02a5

4 Likes

This is now fixed :strawberry:

https://github.com/discourse/discourse/commit/9e2934f635bd23cc350a10e5ca23ca05e5aeb669

3 Likes