Skip to content

Add an emoji palette to the compose box#1753

Closed
umairwaheed wants to merge 5 commits into
zulip:masterfrom
umairwaheed:147-emoji-palette
Closed

Add an emoji palette to the compose box#1753
umairwaheed wants to merge 5 commits into
zulip:masterfrom
umairwaheed:147-emoji-palette

Conversation

@umairwaheed

Copy link
Copy Markdown
Member

Still need to test this.

@smarx

smarx commented Sep 5, 2016

Copy link
Copy Markdown

Automated message from Dropbox CLA bot

@umairwaheed, it looks like you've already signed the Dropbox CLA. Thanks!

@umairwaheed umairwaheed changed the title [WIP] Add an emoji palette to the compose box Add an emoji palette to the compose box Sep 5, 2016
@umairwaheed

Copy link
Copy Markdown
Member Author

Works now. The only problem is that when compose box is opened against a particular topic and Emoji icon is clicked, the map doesn't stay visible.

@umairwaheed

Copy link
Copy Markdown
Member Author

@timabbott, please review.

@timabbott

Copy link
Copy Markdown
Member

Looks like the test suite doesn't pass? I just triggered a rerun of the tests to see for sure.

@timabbott

Copy link
Copy Markdown
Member

(Also, from a commits perspective, are you imagining we'll squash these together for merging?)

@umairwaheed

Copy link
Copy Markdown
Member Author

Using glue from this PR, jorgebastida/glue#211, as we need Jinja2==2.8.

@umairwaheed umairwaheed force-pushed the 147-emoji-palette branch 2 times, most recently from d98e4cd to b122341 Compare September 8, 2016 10:38
@umairwaheed

Copy link
Copy Markdown
Member Author

@timabbott, tests pass now.

Also, from a commits perspective, are you imagining we'll squash these together for merging?

You want me to merge these commits?

@timabbott

timabbott commented Sep 8, 2016

Copy link
Copy Markdown
Member

OK, I merged all the emoji dump changes (after fixing a few bugs). I think we should squash the frontend changes into one commit since they're now just bug fixes on the main commit (I've done that in the tabbott/emoji-map branch if you want to pick up from there). Additionally, we need to address the following:

  • Opening the emoji pallet box takes like 5s, which is way too slow -- we should profile and debug.
  • Now that we're generating the sprite sheet which takes like 1m to run, to avoid slowing down provisioning, we need to add some sort of caching similar to what we've been doing for venv/npm stuff to make this not a performance problem for the provisioning process.
  • The JS for managing the compose box should auto-close the emoji panel when the compose box is closed, so that it isn't open when one re-opens the compose box.
  • The actual sprite sheet display isn't totally working for me

@umairwaheed

Copy link
Copy Markdown
Member Author

The actual sprite sheet display isn't totally working for me

You mean design wise or there is some bug?

@timabbott

Copy link
Copy Markdown
Member

I mean an actual bug -- the emoji are clickable in the sprite sheet display but invisible.

(I guess you should rebase regardless to drop the backend commits).

@umairwaheed

Copy link
Copy Markdown
Member Author

working on this

@umairwaheed

Copy link
Copy Markdown
Member Author

I mean an actual bug -- the emoji are clickable in the sprite sheet display but invisible.

@timabbott, sprite.css has classes of the type 'emoji-glyph00005' whereas we use classes which are like 'emoji-angry' in our templates, I wonder if this is the problem. I couldn't find where 'emoji-angry' css class was declared in our code.

@umairwaheed

Copy link
Copy Markdown
Member Author

The actual sprite sheet display isn't totally working for me

@timabbott, this is fixed now.

@umairwaheed

umairwaheed commented Sep 16, 2016

Copy link
Copy Markdown
Member Author

Opening the emoji pallet box takes like 5s, which is way too slow -- we should profile and debug.

Most likely due to the size of 'sprite.png', it is 1.5MB.

@umairwaheed

Copy link
Copy Markdown
Member Author

The JS for managing the compose box should auto-close the emoji panel when the compose box is closed, so that it isn't open when one re-opens the compose box.

Done

@umairwaheed

Copy link
Copy Markdown
Member Author

working on this:

Now that we're generating the sprite sheet which takes like 1m to run, to avoid slowing down provisioning, we need to add some sort of caching similar to what we've been doing for venv/npm stuff to make this not a performance problem for the provisioning process

@umairwaheed umairwaheed force-pushed the 147-emoji-palette branch 2 times, most recently from 569e894 to 4820d2e Compare September 23, 2016 11:14
@umairwaheed

Copy link
Copy Markdown
Member Author

@timabbott, caching is done!

@timabbott

Copy link
Copy Markdown
Member

awesome! I'll try to find time to review this soon. I'm still thinking about what we can do about the 1.5MB download issue... it might be worth writing a bit of code to download it in the background once the webapp is idle if it isn't cached already, to make the loading delay happen when the user isn't looking.

@umairwaheed umairwaheed force-pushed the 147-emoji-palette branch 2 times, most recently from c31c7f3 to 95cd782 Compare September 26, 2016 10:11
@umairwaheed

Copy link
Copy Markdown
Member Author

@timabbott, now the code retrieves the sprite image in the background as well.

@brainwane

Copy link
Copy Markdown
Contributor

ccing @brockwhittaker - You might want to take a look at this PR, from a frontend/design perspective.

Comment thread templates/zerver/index.html Outdated
<div class='notifications top-right'></div>
</div>
<!--This is just to retrieve the sprite image from the server and cache it-->
<div class="emoji emoji-100" style='margin-left: -1000'></div>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. Is there a way we can do this so that the network traffic is deferred until after the page is loaded, and it doesn't take up space in the DOM?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add this element, <div class="emoji emoji-100" style='margin-left: -1000'></div>, through javascript after the page has loaded.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. The image is now cached using Javascript.

@umairwaheed

Copy link
Copy Markdown
Member Author

@timabbott, done!

@timabbott

Copy link
Copy Markdown
Member

I merged a couple of the simpler backend commits, but I think the emoji dump caching change probably needs work to interact properly with the update-prod-static tooling for building production release tarballs, right? I think as-is it'll just pack up a symlink that will unpack as a broken symlink.

Also, I think we should include the rest of tools/setup/emoji_dump/* in the files hashed in get_success_stamp, since we want to regenerate the emoji if the code changes as well...

Otherwise, the caching code looks good! The speed improvement to provisioning is pretty noticable!

@umairwaheed

Copy link
Copy Markdown
Member Author

sure. working on this.

@umairwaheed

Copy link
Copy Markdown
Member Author

but I think the emoji dump caching change probably needs work to interact properly with the update-prod-static tooling for building production release tarballs, right? I think as-is it'll just pack up a symlink that will unpack as a broken symlink.

@timabbott, the release tarball comes out correctly. There are no symlinks.

ibrand and others added 5 commits October 4, 2016 10:35
- Expand a box full of emojis into the
compose window for users to graphically select emojis.

- Append an emoji to the end of the message when a user
clicks the emoji in the emoji box.

- Trap the escape key to always close the emoji box
before closing anything else if the box is open.

- Fixes: zulip#147.
`glue` ingores the + sign in the name of the emoji and creates
the css class without it. This causes the emoji pallete to miss
'+1' emoji. This commit creates a translation map from emoji name
to css class and uses that to create the emoji popover.
@umairwaheed

Copy link
Copy Markdown
Member Author

Also, I think we should include the rest of tools/setup/emoji_dump/* in the files hashed in get_success_stamp, since we want to regenerate the emoji if the code changes as well...

@timabbott done.

@timabbott

Copy link
Copy Markdown
Member

Merged, thanks @umairwaheed for getting this finished! (Also, huge thanks to @ibrand for writing the first version of this!).

There's still some things that we should improve soon, which I've opened as #1956.

@timabbott timabbott closed this Oct 10, 2016
@umairwaheed umairwaheed deleted the 147-emoji-palette branch August 14, 2017 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants