Loomio

Defaulting to inline attachments

James Kiesel PublicSeen by 56

Right now I'm having a bad time with attachments to comments. My primary gripe is that if I'm making a point relevant to some media (like a monkey), I want that media to appear right next to my point. (Like... now. You should see a monkey now.)

Right now this is possible with markdown attachments, but pretty much no one knows about or uses them, and the syntax for markdown images is archaic, even for markdown:

![](a_monkey.jpg)

Another issue we have is that loading up attachments in the backend (for reasons I won't go into) is very expensive for us right now... to the order of doubling the time it takes to load the event feed.

My proposed solution: When you click 'Attach a file', and upload something, instead of it appearing at the bottom as a separate attachment, we upload the file, then automatically create a markdown link within your comment to the new upload.

For migration, we could either cause all attachments to appear as markdown links at the bottom of their comments, or just leave them as is.

Thoughts welcome! 🐢

Matthew Bartlett

Thoughts / questions:

  • I'd be interested in knowing how it landed for people who know nothing about markdown — user test possible?
  • While I'm drafting a comment, would I see both the markdown link and a representation of the attachment beneath the textarea box?
  • If I deleted either the markdown or the attachment, what would happen?

James Kiesel

I think this feature is contingent upon a comment preview of some kind. Otherwise I think users will be confused (of course, this could also include a little just-in-time help, 'here's what just happened when you uploaded that thing!')

With comment preview, you don't need attachment preview below the text area.

I'm not certain off the top of my head if we actually delete attachments from S3 when they get removed from comments, or just the reference to them in our database. But, attachments are stored in our database, and in Amazon, immediately after they're uploaded, not when you save the comment, meaning it's likely we already have things stored in S3 which just don't appear in our UI anywhere. (I'm thinking of the case where you upload an image, but never post the comment it's intended for)

Robert Guthrie

FYI: We do delete attachments when we delete comments.

Greg Cassel

I don't have time to respond thoroughly, but it's inherently valuable to be able to attach items or links to specific spots or sections within media items ( such as topics and comments).

Robert Guthrie

It's a great feature. Glad you're working on it.

How will this work for PDF and other non image attachments?

Will this fix paste to attach, which is currently broken?