Improve autocomplete results in rich text editor
What does this MR do and why?
Add a new autocomplete helper to improve autocomplete experience in the rich text editor. This includes searching and sorting improvements and highlighting of search string for all autocomplete elements.
Issues fixed:
- Sorting of autocomplete labels in rich text edi... (#419097 - closed)
- Create parity in unassign quick actions between... (#420344 - closed)
- Rich Text Editor - Custom emojis not working on... (#422958 - closed)
- Rich Text Editor - Identical emoji lists betwee... (#423178 - closed)
- Autocomplete dropdowns in plain text and rich t... (#406714 - closed)
- Mirroring User Mention Single Entry Functionali... (#419318 - closed)
- Pressing `tab` to select the current dropdown o... (#419841 - closed)
Screenshots or screen recordings
Common changes in all autocomplete list items:
- There is now a
min-width
andmax-width
for plain text editor dropdown in accordance with the new dropdown styles defined in Pajamas. - As with the plain text editor dropdown, the first element is autoselected in rich text editor dropdown only if there is a search string. So pressing
Enter
orSpace
automatically selects the item. - Plain text editor dropdown doesn't allow having separate focus and hover styles, so I defaulted to using focus styles for hover as well. I think this is an acceptable compromise for the time being.
- The number of dropdown items match between both the editors. The updated limits are:
- Users: 10
- Labels: 20
- Quick actions: 100 (show all)
- Everything else: 5
- Search strings are now highlighted in bold in both editor dropdowns. Previously they were only highlighted in the plain text editor dropdown.
Case | Plain text editor (before) | Rich text editor (before) | Plain text editor (after) | Rich text editor (after) |
---|---|---|---|---|
User | ||||
Notes:
|
||||
Issue | ||||
Notes:
|
||||
Epic | ||||
Notes:
|
||||
Merge Request | ||||
Notes:
|
||||
Snippet | ||||
Notes:
|
||||
Label | ||||
Notes:
|
||||
Milestone | ||||
Notes:
|
||||
Vulnerability | ||||
Notes:
|
||||
Command | ||||
Notes:
|
||||
Emoji | ||||
Notes:
|
||||
Custom Emoji |
(Not supported) |
|||
Notes:
|
Improvements to suggestions in rich text editor after some commands are inserted
Command | Before | After |
---|---|---|
(Shows all users except assigned) |
||
(Shows only assigned users) |
||
(Shows all users) |
||
(Shows all labels except assigned) |
||
(Shows only assigned labels) |
||
(Shows all labels) |
How to set up and validate locally
- Go to an issue.
- In the comment box at the bottom, try various autocomplete items as described in screenshots above in both plain text and rich text editors.
- To test custom emoji, see:
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #420344 (closed)