Discussions and Attachments

Hi everyone,

I have a design problem about storage location of attachments for Discussion Application. So I’d like to have your opinion about it.

A bit of context first: as you might know the Discussion Application is a very generic extension right now, which might be used to replace in the future our comments in XWiki. At this day, there’s 3 applications using it:

  • a dedicated message stream implementation
  • activitypub extension
  • change request for all comments of the CRs (diff review comment, global review comment, and global CR comment)

One of the major design decision of Discussion, was that the messages are not stored directly as object of the concerned page (contrarily to existing comments in XS).
Now to get back of attachments: right now there’s several bugs with attachments and discussions, and with attachments and XS comments.

For XS comments, one of the major bug is that since the attachments are uploaded in the same page where the comments are displayed, a user with comment right but without edit right can write a comment, but cannot upload an attachment as part of this comment.
The related bug (which could be seen as a feature, but we’ll get there) is that if users have edit rights, since the attachments of comments are uploaded on the same page, the page attachments are mixed up with the page comments attachments: there’s no way to distinguish them when checking the attachments of a page.

For Discussion: if we consider XS before the temporary upload feature (< 14.3), Discussion is using the upload behaviour provided by the editor, so the attachments are immediately uploaded in the page where the editor is displayed. This is a major bug: the point of Discussion was to not store discussion information in the page where the discussion takes place, and here it’s exactly what we do.

Now the temporary upload feature could help to solve this, by allowing to chose where to put the attachments. But that’s actually not an easy choice since there’s two usecases to consider:

  1. upload of attachments in a discussion
  2. mention of an existing attachment

If we consider that for 1. we should always attach the files to the location of the discussion itself, does it mean that for 2. we should always display to users the list of attachments of the discussions, and not the list of attachments of the page?
On the contrary, if for 2. we want to display the attachments of the current page, should we still upload attachments in the same page?

I’m a bit stuck to implement properly a solution with temporary attachments because of this, especially if you consider that to my knowledge it’s not possible to tell the attachment widget of the editor where to look for the attachments.
So I’m opening the brainstorming here, let me know what you think about this?

It’s no clear to me what you mean by this. When you insert a link to an existing attachment or an image from the WYSIWYG editor you can browse the tree of pages, so you should be able to select attachments (images) both from the source page and from the associated discussion page. I suppose the question is more what page to select by default in the tree (i.e. where to open the page tree initially). I think it should be the discussion page:

  • it’s easier to find the source page than the associated discussion page (which might be hidden)
  • duplicating images from the source page in the discussion should not happen very often
  • linking attachments from the source page in the discussion is more likely, but it should be easy to find the target attachment in the page tree

Hope this helps,
Marius

I meant the attachment selector.

Yes indeed, the question is about that.

Ok so for you it should always open up in the discussion page.