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

Deleting suggestion trigger character doesn't remove character from post #2943

Closed
guarani opened this issue Dec 29, 2020 · 6 comments
Closed

Comments

@guarani
Copy link
Contributor

guarani commented Dec 29, 2020

Describe the bug
After typing + or @ in Gutenberg to trigger the suggestions UI, backspacing only deletes the symbol from the suggestions input field, and fails to delete the character from the post content itself.

To Reproduce
Steps to reproduce the behavior:

  1. Open a post in WPiOS or WPAndroid
  2. Type + or @ in a Paragraph block to trigger the suggestions UI
  3. Hit backspace once and notice that while the trigger character (+ or @) is deleted from the suggestions input field, it's not deleted from the post
  4. Hit backspace once more and notice that only then is the trigger character removed from the post as well

Expected behavior
Tapping backspace should delete the trigger character (+ or @) from both the suggestions input as well as the editor post content.

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Device: iPhone 11 or Samsung S10
  • OS: iOS 14.2 or Android 10
  • Version WPiOS develop or WPAndroid 16.4-rc-2

Additional context
First reported in wordpress-mobile/WordPress-iOS#15562 (review).

@mchowning
Copy link
Contributor

This might be desirable behavior. If we removed the character when you backed out of the suggestions UI, I'm not sure there would be a good way to just add the @ character if that was what you wanted (i.e., because every time you tried to enter the character you would get the suggestions UI, and backing out of the suggestions UI would remove the character you just tried to enter).

cc: @iamthomasbishop

@guarani
Copy link
Contributor Author

guarani commented Jan 4, 2021

This might be desirable behavior. If we removed the character when you backed out of the suggestions UI, I'm not sure there would be a good way to just add the @ character if that was what you wanted (i.e., because every time you tried to enter the character you would get the suggestions UI, and backing out of the suggestions UI would remove the character you just tried to enter).

That's true, I'd missed that fact while writing this issue, thanks for noticing!

One thing I want to keep in mind here now that we're on the topic is whether we should use space – instead of backspace – to cancel the suggestions UI.
While our setup is a bit different to others (we have a separate input for filtering suggestions, unlike Google Docs or Instagram) I like the way it's done in Google Docs. I noticed there if you type a space right after the @ symbol, the mentions UI there is dismissed:

Note that if you type @ after you've already typed other characters, the UI isn't dismissed, allowing you to filter using spaces:

@iamthomasbishop
Copy link
Contributor

@guarani Thanks for surfacing this! I think it's great that we allow spaces in the middle of the query, so I'd prefer not to lose that ability, but it might be a good idea (as you mentioned) to hide the UI when a space is typed immediately after the @ symbol. That'd benefit the user if they are simply trying to type @ with a space after it (something like "The show is @ 4:30").

In terms of the stray @ symbol that stays on the canvas after you've deleted all characters in the mention UI, it does feel a little odd in practice when you're typing quickly because you have to tap a second time to remove it from the block content. But I'd rather err on the side of not deleting it than doing so because the latter is harder to undo.

Does that all make sense, or am I missing something?

@guarani
Copy link
Contributor Author

guarani commented Jun 9, 2021

Sorry for the late reply @iamthomasbishop.

@guarani Thanks for surfacing this! I think it's great that we allow spaces in the middle of the query, so I'd prefer not to lose that ability, but it might be a good idea (as you mentioned) to hide the UI when a space is typed immediately after the @ symbol. That'd benefit the user if they are simply trying to type @ with a space after it (something like "The show is @ 4:30").

Sounds good. This will be fixed once WordPress/gutenberg#24425 is closed.

In terms of the stray @ symbol that stays on the canvas after you've deleted all characters in the mention UI, it does feel a little odd in practice when you're typing quickly because you have to tap a second time to remove it from the block content. But I'd rather err on the side of not deleting it than doing so because the latter is harder to undo.

Does that all make sense, or am I missing something?

I agree with you that leaving things as-is makes it easier for users whose aim is to type a @ character without inserting a mention.
However, I want to highlight that the comment, wordpress-mobile/WordPress-iOS#15562 (review) (which was the basis for this issue) reported the current flow being non-ideal when you cancel the suggestions UI and wish to bring it up again. In that scenario, you have to tap backspace first to remove the @ character from the post, before typing @ again to re-trigger the UI.

Given this, we could:
a. Leave things as-is and close the issue (if this new information doesn't change things)
b. Address this issue by removing the @ from both the suggestions input and the post

I favor (a) because bringing the suggestions UI up after closing it isn't what most users will do I suspect, and I don't have a good solution to fix it without making it harder for users to add @ characters to posts.

Wdyt @iamthomasbishop?

@iamthomasbishop
Copy link
Contributor

I favor (a) because bringing the suggestions UI up after closing it isn't what most users will do I suspect, and I don't have a good solution to fix it without making it harder for users to add @ characters to posts.

That sounds good, let's roll with your suggestion here @guarani

@guarani
Copy link
Contributor Author

guarani commented Jun 28, 2021

Sounds good @iamthomasbishop! I'm closing this issue as won't-fix as agreed upon in the above comments.

@guarani guarani closed this as completed Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants