Closed brnsolikyl closed 2 years ago
Previous issue: https://github.com/yunity/karrot-frontend/issues/1092
This issue is marked as stale because it has not had any activity for 90 days.
It doesn't mean it's not important, so please remove the stale label if you like it, or add a comment saying what it means to you :)
However, if you just leave it like this, I'll close it in 7 days to help keep your issues tidy!
Thanks!
I was thinking to push this forward a bit and looked into a few ways other software tools implement it.
The key bit is how to represent a mention in the text we store, there are many approaches.
Discourse
In discourse people have usernames, so having @nicksellen
in the markdown text for a post will match the username nicksellen
. If you change username, it goes through and rewrites all the posts to update it.
GitHub
GitHub also has bare @username
mentions, but if you change your username, it will break the past mentions (https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-user-account/managing-user-account-settings/changing-your-github-username).
Slack
Slack uses message formatting like this <@U024BE7LH>
where U024BE7LH
is the user id.
markdown-it-mentions plugin
This plugin (https://github.com/quartzy/markdown-it-mentions) for markdown-it
(which we use) uses this kind of format @[Freddie Mercury](mention://user/48249279)
(a special mention://
url prefix). I kind of like that (although the plugin library itself is old, and I guess unmaintained... and in this case the name would not get updated if the user changed it).
I wondered if we can do something like mention://user/123
in the text... so it's technically still a valid URL. Then, everytime we render it, we can display the name nicely and a link to their profile.
...however
@username
ones, as our display names have spaces in them, and don't have to be unique)yet...
I think a good way to implement this might be:
@username
mentions in text... additionally, we might want to consider @ mentions for things other than users? I don't know how that would go... or what it would be for...
And as mentioned by vasileios, we could consider hashtags here whilst building out the infrastructure...
https://vue-mention.netlify.app/ might be useful. I can't see immediately whether it supports vue 2/3 though.
Nice research!
I'm naturally inclined not to introduce usernames, since it could be a hassle for existing users. Why not use their id´s, that is, their user number? Checking vue-mention it seems like it could work like that. There might be still the problem of users having exactly the same display names, but judging from my group (people usually use first and last name) that would be rare, and if that ever happens I imagine people would understand the issue and change their display names to avoid confusion.
Also, another assumption is that @-mentions would be restricted within groups, right?
With the ids it would look like @123
in the text editor when you're writing a message... which seems a bit cryptic?
The autocomplete for it could probably show the display name when you're typing it out... and when we display the name it could show a nicely formatted name..
I wonder if that would be usable enough for people?
(I remember slack actually having the problem where 2 people have the same display name, it makes it hard to see who somebody is referring to)
And yes, limiting it to within groups makes sense.
If going down the username route, existing users could get auto-generated ones, based on their display name, e.g. Nick Sellen
-> "nicksellen", and they could edit them later.
I think autogenerating usernames would be an option to start with. And yes members if they see that the autogenerated username does not do the job they could edit them later. Would that mean though that they could edit the username? or that they d have to edit their 'name' which would then autogenerate another 'username'? I m also thinking of the ID which would appear in a more digit-like form as u mentioned above. This would mean that if I want to tag you Nick for example I should know your ID number which I don't quite get how it would be possible without adding a lot of noise in the process. In addition I think that using @ or any other form that does the job could be used beyond simply tagging a user. For example (and I m also making a connection here with the roles features we 've been discussing lately) sb could make a post 'in need of some @driver' or 'any available @distrubutors for tonight?' In that case, say me, Vasilis which has the role of a driver/distributor and all other members that have similar role will get a notification. That's a basic idea that just popped in my mind which can be explored more.
The idea for usernames fits what me and @brnsolikyl discussed last week too (notes), this is the relevant bit:
usernames seems maybe the way forward, automatically generate existing ones, and suggest usernames on registration based on display name usernames are for each user across the whole of karrot instance, not per group … not thinking yet about all the notification stuff
And yeah, I think it's good to allow them to be changed (independently from the name), and we can support rewriting all the past message content with the updated username too (which discourse does).
I really like the idea for @ mentioning roles too, it does create a difficulty as there could be a clash, somebody might have the username for a role.
The usernames would be global across the whole instance of karrot, but the role names would be per-group, which reduces the chance of conflict.... although that also creates complications, if someone tries to join a group with a username that would clash with a local role name... not clear how to handle that.
Would be simpler if there was another sign to use for that, maybe a double @? @@drivers, looks a bit ugly though. Or namespaced @role:drivers ... looks plausible to me...
In any case I would leave that bit out for now, as we don't really have roles like this yet anyway, but nice idea :+1:
I started the backend work over here --> https://github.com/karrot-dev/karrot-backend/pull/1207
Progress --> https://community.karrot.world/t/mentions-on-karrot/732/8 (little screencast showing some frontend UI stuff...)
looks great! Happy new @year 😆 🎉
The premise is that by "tagging" someone with an @ in any conversation the person will get a notification (including e-mail/push).
Topic raised here: https://community.foodsaving.world/t/mentions-on-karrot/732