Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slack-like mention plugin #1962

Open
BazinC opened this issue Apr 22, 2024 · 1 comment
Open

Slack-like mention plugin #1962

BazinC opened this issue Apr 22, 2024 · 1 comment
Assignees
Labels
area_supereditor Pertains to SuperEditor bounty_junior f:clickup type_enhancement New feature or request

Comments

@BazinC
Copy link

BazinC commented Apr 22, 2024

User Behavior
User should be able to use whitespace to search another user to mention. See example below on Slack:

search_with_whitespace.webm

Feature Value
In apps like Slack, whitespace can be utilized to search for users by both first name and last name. This feature is particularly helpful in workspaces with many users, especially when several users have the same first name.

Additional context
Super Editor offers StableTagPlugin but I don't think it can support the use case above. I naively tried to implement it by tweaking the user TagRule, using double whitespace as escape character instead of single whitespace.

TagRule(trigger: '@', excludedCharacters: {" ", "."})

It looked initially promising. However, it has created an issue where it's now unclear whether the user intends to mention someone or is just typing in the middle of a sentence.

See below, using UserTagsFeatureDemo with modified TagRule:

super_editor_user_tag_with_whitespace.webm

More specs we can observe from Slack
It seems in Slack the composing tag area is always between the trigger user entered and text user tapped after the trigger.
It keeps track of what text user typed after tapping the trigger.

On the other hand, current implementation of tags in SuperEditor uses TagFinder.findTagAroundPosition which looks for a tag around the cursor, starting with the tagrule trigger and ending with tagrule excluded characters. No matter if the text was typed by user or not.

Furthermore, on slack, you can see that if the composing tag value doesn't match any user, the app decides to commit it in an "unknown state" (with dots and question mark around). This way when the cursor goes back in this tag, the search can continue.

Screen.Recording.2024-04-22.at.18.54.39.mov

I'll be happy to continue discussing the feasibility of this feature. I'm wondering if in order to accomplish it we need to mimic all specs from slack search.

@matthew-carroll
Copy link
Contributor

@BazinC - I broke this ticket down into the following:

#1986
#1987
#1988

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area_supereditor Pertains to SuperEditor bounty_junior f:clickup type_enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants