After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 755579 - Easily insert emojis
Easily insert emojis
Status: RESOLVED FIXED
Product: polari
Classification: Applications
Component: general
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Polari maintainers
Polari maintainers
Depends on:
Blocks:
 
 
Reported: 2015-09-24 19:59 UTC by Moo
Modified: 2017-08-11 23:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
flatpak: Temporarily add fontconfig/cairo (3.95 KB, patch)
2017-08-09 20:10 UTC, Florian Müllner
committed Details | Review
flatpak: Include color emoji font (1.55 KB, patch)
2017-08-09 20:10 UTC, Florian Müllner
committed Details | Review
data: Include Emoji definitions (307.31 KB, patch)
2017-08-09 20:10 UTC, Florian Müllner
committed Details | Review
emojiPicker: Add a simple emoji picker (9.25 KB, patch)
2017-08-09 20:10 UTC, Florian Müllner
none Details | Review
entryArea: Include emoji picker (2.54 KB, patch)
2017-08-09 20:10 UTC, Florian Müllner
none Details | Review
app: Add keybinding to show emoji picker (2.50 KB, patch)
2017-08-09 20:11 UTC, Florian Müllner
committed Details | Review
emojiPicker: Add a simple emoji picker (9.25 KB, patch)
2017-08-09 22:36 UTC, Florian Müllner
none Details | Review
entryArea: Include emoji picker (2.60 KB, patch)
2017-08-09 22:37 UTC, Florian Müllner
committed Details | Review
emojiPicker: Add a simple emoji picker (9.51 KB, patch)
2017-08-09 23:37 UTC, Florian Müllner
none Details | Review
entryArea: Share a single emoji picker (2.84 KB, patch)
2017-08-09 23:55 UTC, Florian Müllner
committed Details | Review
emojiPicker: Add a simple emoji picker (10.30 KB, patch)
2017-08-11 00:18 UTC, Florian Müllner
committed Details | Review

Description Moo 2015-09-24 19:59:25 UTC
Inserting emojis is very complicated, I have to open my web browser, Go to google, type in Unicode emojis, find some site, then copy & paste it.

Add a emoji button that I can click on that opens up a popover that conveniently let me insert common Unicode emojis.

Like is easily done on Android in apps such as Hangouts, Kik and WhatsApp.

Comment 1 gregoire 2015-09-28 18:58:39 UTC

Comment 2 gregoire 2015-09-28 19:04:39 UTC
Oups, it looks like bugzilla doesn't like emoji either...

Since my message seems to be lost, I'll repeat it here:

> <facebook-ish emoji> I came to suggest the same feature <sunglass emoji>

> @Moo Try using GNOME Characters, it makes the process a bit easier than googling for the icons :-)
Comment 3 Moo 2015-09-28 20:40:56 UTC
Yeah, I can use GNOME Characters (except I don't  have it right now, its in 3.18, I have 3.16).

But it would be awesome with an emoji-button so that I have emojis at my fingertips, without having to switch applications and stuff and juggle copy paste.
Comment 4 Florian Müllner 2017-08-09 20:10:27 UTC
Created attachment 357297 [details] [review]
flatpak: Temporarily add fontconfig/cairo

The versions included in the runtime don't have the recently added
support for color emojis, so bundle them in the meantime in order
to make use of all the colorful goodness right away ...
Comment 5 Florian Müllner 2017-08-09 20:10:34 UTC
Created attachment 357298 [details] [review]
flatpak: Include color emoji font

We want emoji support to work, independently from what fonts the user
has installed on their system. So simply bundle an appropriate font
and make sure fontconfig picks it up correctly.
Comment 6 Florian Müllner 2017-08-09 20:10:42 UTC
Created attachment 357299 [details] [review]
data: Include Emoji definitions

The file is imported from the (MIT-licensed) emoji.json[0] node
module, which generates it from the emoji list published by the
Unicode Consortium.

[0] https://github.com/amio/emoji.json
Comment 7 Florian Müllner 2017-08-09 20:10:49 UTC
Created attachment 357300 [details] [review]
emojiPicker: Add a simple emoji picker

Rejoice, pango, fontconfig and cairo now support color emojis. GTK+
should gain an emoji picker eventually, but in order to enjoy the
colorful goodness right away, implement a simple picker ourselves
in the meantime.
Comment 8 Florian Müllner 2017-08-09 20:10:55 UTC
Created attachment 357301 [details] [review]
entryArea: Include emoji picker

Now that the platform supports color emoji, expose the newly added
picker as secondary icon in the entry area to make it easy to insert
emojis.
Comment 9 Florian Müllner 2017-08-09 20:11:03 UTC
Created attachment 357302 [details] [review]
app: Add keybinding to show emoji picker

In order to make the newly added emoji picker more accessible, add
a new keybinding for popping it up (if available).
Comment 10 Florian Müllner 2017-08-09 22:36:18 UTC
Created attachment 357308 [details] [review]
emojiPicker: Add a simple emoji picker

Swap signal emission <-> popdown, to not delete existing text when inserting an emoji.
Comment 11 Florian Müllner 2017-08-09 22:37:34 UTC
Created attachment 357309 [details] [review]
entryArea: Include emoji picker

Improve insertion handling.

(FWIW, as patches are getting out of order, I'm updating the wip/fmuellner/emoji-picker branch as well)
Comment 12 Florian Müllner 2017-08-09 23:37:07 UTC
Created attachment 357310 [details] [review]
emojiPicker: Add a simple emoji picker

Base section indicator on last child in row rather than first, so that the expected indicator gets selected when clicking on it.
Comment 13 Florian Müllner 2017-08-09 23:55:17 UTC
Created attachment 357311 [details] [review]
entryArea: Share a single emoji picker

The emoji picker contains a lot of widgets, so it isn't exactly cheap
to create; it's also based on static data that doesn't differ between
rooms, so with a bit of extra book-keeping we can share a single picker
between all rooms.
Comment 14 Moo 2017-08-10 08:38:38 UTC
Even a basic picker with just the most common 10-20 emojis would be very appreciated.

However, if the picker offers thousands of emojis then it would be useful with a search function.

Also the UI could be implemented so that it can browse emojis by categories. This could be implemented using a GtkGrid inside a GtkNotebook.
Comment 15 Florian Müllner 2017-08-10 09:42:13 UTC
(In reply to Moo from comment #14)
> However, if the picker offers thousands of emojis then it would be useful
> with a search function.

How about *trying* the patch set? The patches follow the mockups in https://wiki.gnome.org/Design/OS/Emoji, so yes, there *is* a filter entry and there *are* sections ...
Comment 16 Moo 2017-08-10 11:27:01 UTC
Emoji column count:
- OS X: 6 (Characters), 7 (popover?)
- Windows: 10
- EmojiHelper: 11
- Android (Gboard): 7
- GNOME (tentative design): 5

Perhaps consider increasing the column count from 5 to 7?
Comment 17 Florian Müllner 2017-08-10 12:05:53 UTC
(In reply to Moo from comment #16)
> - GNOME (tentative design): 5

Actual patch: 6

Seriously, can you actually *use* the patches before you comment on what you *think* they do?
Comment 18 Moo 2017-08-10 13:28:35 UTC
(In reply to Florian Müllner from comment #17)
> (In reply to Moo from comment #16)
> > - GNOME (tentative design): 5
> 
> Actual patch: 6
> 
> Seriously, can you actually *use* the patches before you comment on what you
> *think* they do?

Sorry, I just looked at the screenshots at the link you provided.

6 seems to be a saner value and more close what other implementations do.
Perhaps it ought to be 7 columns though?
Comment 19 Bastian Ilsø 2017-08-10 21:58:00 UTC
Review of attachment 357297 [details] [review]:

lgtm
Comment 20 Bastian Ilsø 2017-08-10 21:59:18 UTC
Review of attachment 357298 [details] [review]:

lgtm
Comment 21 Bastian Ilsø 2017-08-10 22:00:05 UTC
Review of attachment 357299 [details] [review]:

lgtm
Comment 22 Bastian Ilsø 2017-08-10 22:35:47 UTC
Review of attachment 357310 [details] [review]:

code works and genreally looks good to me (+ lapo's tweaks), just a few questions out of curiosity:

is it the norm that the implementation of a class and the actual use of a class is separated into two different patch sets?

::: src/emojiPicker.js
@@ +67,3 @@
+
+    _init: function(emojiData) {
+        this._name = emojiData.name;

so I see that the smiley name is private in each Emoji object, but i can still search "cry" and find crying smileys? o.o

@@ +125,3 @@
+});
+
+let sections = {

i only see sections used inside the EmojiPicker class so why do you prefer to keep it outside here?
Comment 23 Bastian Ilsø 2017-08-10 22:35:48 UTC
Review of attachment 357310 [details] [review]:

code works and genreally looks good to me (+ lapo's tweaks), just a few questions out of curiosity:

is it the norm that the implementation of a class and the actual use of a class is separated into two different patch sets?

::: src/emojiPicker.js
@@ +67,3 @@
+
+    _init: function(emojiData) {
+        this._name = emojiData.name;

so I see that the smiley name is private in each Emoji object, but i can still search "cry" and find crying smileys? o.o

@@ +125,3 @@
+});
+
+let sections = {

i only see sections used inside the EmojiPicker class so why do you prefer to keep it outside here?
Comment 24 Bastian Ilsø 2017-08-10 22:41:51 UTC
Review of attachment 357309 [details] [review]:

generally looks good. hmm, I'm noticing that if I write 'abcdefg', select only 'defg' and go to the emoji picker to select an emoji, then the whole entry to cleared. I was expecting that only the text I had selected was replaced with the emoji of my choosing.
Comment 25 Bastian Ilsø 2017-08-10 22:43:06 UTC
Review of attachment 357302 [details] [review]:

lgtm
Comment 26 Bastian Ilsø 2017-08-10 22:45:00 UTC
Review of attachment 357311 [details] [review]:

lgtm
Comment 27 Florian Müllner 2017-08-11 00:18:48 UTC
Created attachment 357371 [details] [review]
emojiPicker: Add a simple emoji picker

(In reply to Bastian Ilsø from comment #22)

> is it the norm that the implementation of a class and the actual use of a
> class is separated into two different patch sets?

No, not really. On the one hand, the picker itself is a big enough change to be self-contained, on the other hand the entry-area patch to use it is not - so this could really go either way.


> ::: src/emojiPicker.js
> @@ +67,3 @@
> +        this._name = emojiData.name;
> 
> so I see that the smiley name is private in each Emoji object, but i can
> still search "cry" and find crying smileys? o.o

Yup, the Emoji object has a public match() function that is used for filtering (and which uses a normalized version of the private _name property) :-)


> i only see sections used inside the EmojiPicker class so why do you prefer
> to keep it outside here?

It looked a bit weird between all the widget-setup stuff, but you are right, putting it outside the class is odd too. I've moved it back inside ...
Comment 28 Florian Müllner 2017-08-11 00:20:35 UTC
(In reply to Bastian Ilsø from comment #24)
> generally looks good. hmm, I'm noticing that if I write 'abcdefg', select
> only 'defg' and go to the emoji picker to select an emoji, then the whole
> entry to cleared. I was expecting that only the text I had selected was
> replaced with the emoji of my choosing.

Was that with the flatpak? The patch versions from comment #10 and #11 should have addressed that.
Comment 29 Florian Müllner 2017-08-11 23:13:14 UTC
Attachment 357297 [details] pushed as 163fe24 - flatpak: Temporarily add fontconfig/cairo
Attachment 357298 [details] pushed as 3febd52 - flatpak: Include color emoji font
Attachment 357299 [details] pushed as fda8c9a - data: Include Emoji definitions
Attachment 357302 [details] pushed as c56c33a - app: Add keybinding to show emoji picker
Attachment 357309 [details] pushed as 9c4eaeb - entryArea: Include emoji picker
Attachment 357311 [details] pushed as 0bd7b89 - entryArea: Share a single emoji picker
Attachment 357371 [details] pushed as 0396590 - emojiPicker: Add a simple emoji picker