-
Notifications
You must be signed in to change notification settings - Fork 2.7k
ABC-92 Add paging and server search for custom emojis to emoji picker #657
Conversation
@jasonblais I loaded a bunch of emojis and it should be ready for testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jwilander As discussed briefly as an option yesterday, can we make a slight change where the next page of emojis load before you hit the end of the previous page?
Right now it looks like there are no more emoji at the bottom once you've scrolled down.
I'm 0/5 on how early we start loading without trying it out. Perhaps once you've reached the last 50 on the page (half of the emoji picker UI), we load the next 200?
Yep, I'll make that change |
|
Spinmint test server created at: http:https://i-06133eee40c5f4919.spinmint.com Test Account 1: Email: Test Account 2: Email: Instance ID: i-06133eee40c5f4919 |
@jasonblais this one is ready too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Performance-wise it feels better compared to current master
. Scrolling through the picker feels smooth.
@jwilander Not related to this PR, but I get a blank screen initially when I switch to the custom emoji category on the picker (same as on master
). Anything we can do there to improve it,
perhaps a loading screen?
@hmhealey @stephenkiers ready for your review.
2 Questions:
|
I feel like this component group needs to be split into multiple, simpler components that do one thing each. However that is another task in and of itself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am approving in the assumption that the bug I put in the comment above is simply because the other related PR isn't loaded yet.
|
@jasonblais is this just before the custom emojis load in? If so yeah we can definitely add a loading indicator but I think there's still going to be some delay between that disappearing and the emojis loading in to cover the gap of time between when the getting metadata request completes and the get emoji images requests start going out. We could do a bunch of refactoring to make that gap not exist (at least from the user's perspective) but that's a lot more work |
@jwilander I see that with the system emoji too. If I click on a category, the emoji picker is just blank, after which the emoji appear. Should I just create a ticket to look into it? |
Oh interesting.. I guess that's just waiting for the images to load in. Yeah I'd say that's another ticket |
Cool, ticket: https://mattermost.atlassian.net/browse/ICU-684 |
That should be easy to fix. I will take that one next sprint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good unless we have a batched API for getting emojis that I don't know about
const missingEmojis = recentEmojis.filter((name) => !emojiMap.has(name)); | ||
|
||
missingEmojis.forEach((name) => { | ||
EmojiActions.getCustomEmojiByName(name)(dispatch, getState); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if we had a bulk API for this. As it is, we're making up to 27 requests for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I agree, with this there will be caching by both the proxy and the browser. With a bulk request it's going to always go the whole way to the server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ABC team does have a ticket to look into which is really better and when but using the force I think it's going to be better to have more individual GETs most of the time
https://mattermost.atlassian.net/browse/ABC-163
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types'; | |||
import React from 'react'; | |||
import {Overlay} from 'react-bootstrap'; | |||
|
|||
import EmojiPicker from './emoji_picker.jsx'; | |||
import EmojiPicker from './'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This import state looks really weird to me, but it makes sense without moving a bunch of files around
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it weirded me out a bit but I didn't want to have to go rearrange a bunch of files
package.json
Outdated
@@ -27,7 +27,7 @@ | |||
"localforage": "1.5.6", | |||
"localforage-observable": "1.4.0", | |||
"marked": "mattermost/marked#802e981ade71149a497cbe79d12b8a3f82f7657e", | |||
"mattermost-redux": "mattermost/mattermost-redux", | |||
"mattermost-redux": "mattermost/mattermost-redux#abc-92-no-emoji", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to be changed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was while we were testing, I'll update it back to normal
Summary
Add paging and server search for custom emojis to emoji picker.
@hmhealey @stephenkiers let me know if I should approach this differently. This is my first time in the emoji picker code and it's a bit complex, so if you guys have better ideas on how to do this let me know :)
Ticket Link
https://mattermost.atlassian.net/browse/ABC-92
Checklist
make check-style
to check for style errors (required for all pull requests)make test
to ensure unit and component tests passed