text icon indicating copy to clipboard operation
text copied to clipboard

Mention users

Open juliushaertl opened this issue 5 years ago • 2 comments

It should be possible to mention users

juliushaertl avatar Jun 22 '19 07:06 juliushaertl

As discussed with @mejo- this would be relatively straight forward to implement on the frontend side now with the picker from #1961

Further steps would be:

  • Clarify on markdown representation (e.g. could use the profile url as a link [@User display name](https://cloud.example.com/u/userid))
  • Clarify individual implementation steps in detail
    1. Plain mentions in the document
    2. Notify users about mentions (with proper cleanup once a mention gets removed again)
    3. Enhanced UX (e.g. suggest to share if a mentioned user doesn't have access to the document yet)

Should also be aligned with the ongoing effort on the Collabora integration at https://github.com/nextcloud/richdocuments/issues/1380

juliushaertl avatar Feb 23 '22 11:02 juliushaertl

  • [ ] Find a fitting markdown it plugin that allows us to store both the mention @userid and Display name of the user (could be https://github.com/quartzy/markdown-it-mentions)
  • [ ] Integrate with https://tiptap.dev/api/nodes/mention
    • [ ] The markdown-it-mentions generates more details <span class="mention" data-type="user" data-id="48249279">Freddie Mercury</span> than tiptap can handle/parse
    • Therefore we need to extend the tiptap mentions plugin to handle that html https://github.com/ueberdosis/tiptap/blob/main/packages/extension-mention/src/mention.ts#L107-L124
    • In addition we need a toMarkdown method to handle the last conversion step back to markdown
  • [ ] Emit notifications for the mentioned users

Reference on how the formats are converted

  • markdown document => markdown-it => html (markdown-it-mentions)
  • html => tiptap => rendering editor (tiptap needs to understand the html output from the above step)
  • tiptap => prosemirror-markdown => markdown (tiptap needs to generate the same markdown format that is used in the first step)

juliushaertl avatar Jul 11 '22 11:07 juliushaertl