WIP: native emojis 馃憤
What does this MR do?
- Use native emoji's if platform supports them. Fallback to images
- Emoji's are now client-side and do not require another ajax request
- See autocomplete (typeahead)
- See award emoji menu
- Improve award emoji menu performance
- Pre-build emoji menu on button hover/focus
- Only pre-build the first category of emoji's to avoid jank and quick initial display if necessary
- Load in remaining emoji's after actually opening the menu (we do it after the menu expand transition to avoid jank)
- Adjust the emoji menu CSS transition bezier curve so that it doesn't dip negative(zero) and give a perceptive delay
- Add alias lookup in award emoji menu
Are there points in the code the reviewer needs to double check?
Quick tip: If you are looking for an emoji that will fallback on macOS Sierra(10.12), :rofl:
is unicode 9.0 and will fallback
- Run
bundle exec rake gemojione:digests
- We will need to figure out how best to deal with the cached markdown in production
- Clear out the cache
- Add a post-processor to change the
img.emoji-icon
- Just ignore it and all new cached things will be native emoji's
- Is it okay to have the native emojis be sized to the font-size of the current context instead of always 20px?
- This can lead to mismatched when we fallback to images, https://i.imgur.com/7oamJ35.pngp
We can split into manageable MRs if necessary. Here is the MR/branch dependency tree/graph I made when I though I was going to have to split it up, see https://drive.google.com/file/d/0B4cjIdQwaPXhZzRUd05GWGNTbG8/view?usp=sharing
-> http://i.imgur.com/44CfjCJ.png
Why was this MR needed?
Screenshots (if relevant)
Immediate feedback from first click (freshly loaded page):
For native unicode emoji browser support results, see https://gitlab.com/snippets/1548325
Does this MR meet the acceptance criteria?
-
Changelog entry added -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together
Todo
-
Server-side rendering, ./lib/banzai/renderer.rb
->./lib/banzai/filter/emoji_filter.rb
-
Emoji awards (reactions) buttons -
OP -
Comment
-
-
Emoji awards (reactions) dropdown -
Emoji Typeahead :
-
Unicode fallback
-
Revert ./fixtures/emojis/index.json
-
Use https://github.com/MadLittleMods/emoji-unicode-version to assemble a single json file (like we do for ./fixtures/emojis/digests.json
now) that will get shared across the typeahead and emoji menu for awards- name
- moji
- fallbackImageSrc
- unicodeVersion
- category
-
Emoji award menu -
Mentioned to have category button nav and only show the emoji's in that category, https://gitlab.slack.com/archives/frontend/p1486447966012841 -
Waiting on issue
-
-
Build the menu client-side with the first couple categories initially and then shove the rest in the DOM (have loading indicator at the bottom until the rest are shoved in) -
Build the emoji menu when an award button is hovered/focused (instead of clicked).
-
-
If we see that no native unicode is supported (the whole map is false), set a cookie and server-side render images straight away- We are opting to skip on this iteration because the server time needed might not be worth it. The markdown is cached and would need to post-process every request for the true/false support scenario
- See https://gitlab.slack.com/archives/development/p1486577609004641, https://gitlab.slack.com/archives/D3TH64PAL/p1486582569000002
-
Fallback mode for CSS sprites -
Rename emoji CSS sprite clases to use name, ex..emoji-grinning
, instead of.emoji-1F600
to reduce json payload size- Maybe a v2 improvement. These images are also named this way on the EmojiOne repo and would have to post-process
-
Use npm for https://github.com/WebReflection/document-register-element -
Remove unused award emoji menu route /emojis
and server-side templates -
Remove unused autocomplete emoji endpoint .../autocomplete_sources/emojis
-
Need a check to cover horse_racing_tone1
, etc on macOS Chrome 56- Our current skin tone modifier test is dark skin tone, spy:
'\u{1F575}\u{1F3FF}'
which does pass - Just
- Our current skin tone modifier test is dark skin tone, spy:
-
Get out Windows 8.1 and test the following which have problems in the VM. They used to not work in Chrome as well but now they do 馃槙 -
Need a check to cover family_mmbb
(zwj sequence), etc on Windows 8.1 Firefox 51.0.1 -
Need a check to cover kiss_mm
(zwj sequence), etc on Windows 8.1 Firefox 51.0.1 -
Need a check to cover couple_mm
,couple_with_heart_mm
(zwj sequence), etc on Windows 8.1 Firefox 51.0.1
-
-
Need a check to cover skinModifier
on Windows 8.1 Firefox 51.0.1- Added more complex
skinModifier
with multiple checks
- Added more complex
-
Test on Android Chrome -
Test on Android Firefox - Some black boxes, http://i.imgur.com/pzUmlMN.png
Add tests
-
ESlint -
Test text with raw unicode character gets rendered into gl-emoji
-
Test text with named emoji :grinning:
character gets rendered intogl-emoji
-
Test gl-emoji
fallback to image -
Test gl-emoji
fallback to CSS sprite -
Test award emoji menu -
Test auto_complete (typeahead) -
Get an Array.from
polyfill that works with astral symbols for PhantomJS tests -
Possibly rspec tests for falling back emojis - Will need a way to programmatically define the emoji support map
-
Drop disabling markdown caching commit
What are the relevant issue numbers?
Closes #26371 (closed)