efck-chat-keyboard/efck

Turning OFF 'person' does not hide 'person' emoji variants

Symbian9 opened this issue ยท 3 comments

Describe the bug
Disabling person does not hide person emoji variants

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Options > Gender'
  2. Click on man and/or woman to turns ON
  3. Click on person to turns OFF
  4. See error

Expected behavior
Hide person variants if is person is turned OFF, while man and/or woman is turned ON.

Versions
Specify versions:
OS: Linux (Debian 11)
Qt: 5.15.2
EFCK: 1.0

Additional context, screenshots

Screenshot_2023-01-02_07-57-30
Screenshot_2023-01-02_07-58-15

kernc commented

I see we just do a rudimentary scan for "person":

efck/efck/emoji.py

Lines 26 to 30 in 096a7b6

# Invert emoji filters from options
should_skip_emoji = {k for filters in config_state[EmojiTab.__name__].values()
for k, is_enabled in filters.items()
if not is_enabled}
should_skip_emoji = re.compile(fr'(?:^|(?:[:,] ))\b(?:{"|".join(should_skip_emoji)})').search

but a "person emoji" is apparently any "X" for which also "man X" and "woman X" exist:
U+1F9D1 U+200D U+2695 U+FE0F ; 12.1 # ๐Ÿง‘โ€โš•๏ธ health worker
U+1F9D1 U+1F3FB U+200D U+2695 U+FE0F ; 12.1 # ๐Ÿง‘๐Ÿปโ€โš•๏ธ health worker: light skin tone
U+1F9D1 U+1F3FC U+200D U+2695 U+FE0F ; 12.1 # ๐Ÿง‘๐Ÿผโ€โš•๏ธ health worker: medium-light skin tone
U+1F9D1 U+1F3FD U+200D U+2695 U+FE0F ; 12.1 # ๐Ÿง‘๐Ÿฝโ€โš•๏ธ health worker: medium skin tone
U+1F9D1 U+1F3FE U+200D U+2695 U+FE0F ; 12.1 # ๐Ÿง‘๐Ÿพโ€โš•๏ธ health worker: medium-dark skin tone
U+1F9D1 U+1F3FF U+200D U+2695 U+FE0F ; 12.1 # ๐Ÿง‘๐Ÿฟโ€โš•๏ธ health worker: dark skin tone
U+1F468 U+200D U+2695 U+FE0F ; 4.0 # ๐Ÿ‘จโ€โš•๏ธ man health worker
U+1F468 U+1F3FB U+200D U+2695 U+FE0F ; 4.0 # ๐Ÿ‘จ๐Ÿปโ€โš•๏ธ man health worker: light skin tone
U+1F468 U+1F3FC U+200D U+2695 U+FE0F ; 4.0 # ๐Ÿ‘จ๐Ÿผโ€โš•๏ธ man health worker: medium-light skin tone
U+1F468 U+1F3FD U+200D U+2695 U+FE0F ; 4.0 # ๐Ÿ‘จ๐Ÿฝโ€โš•๏ธ man health worker: medium skin tone
U+1F468 U+1F3FE U+200D U+2695 U+FE0F ; 4.0 # ๐Ÿ‘จ๐Ÿพโ€โš•๏ธ man health worker: medium-dark skin tone
U+1F468 U+1F3FF U+200D U+2695 U+FE0F ; 4.0 # ๐Ÿ‘จ๐Ÿฟโ€โš•๏ธ man health worker: dark skin tone
U+1F469 U+200D U+2695 U+FE0F ; 4.0 # ๐Ÿ‘ฉโ€โš•๏ธ woman health worker

๐Ÿค”

Is it Unicode version: 12.1 and 4.0?

U+1F9D1 U+200D U+2695 U+FE0F ; 12.1 # ๐Ÿง‘โ€โš•๏ธ health worker
...
U+1F468 U+200D U+2695 U+FE0F ; 4.0 # ๐Ÿ‘จโ€โš•๏ธ man health worker 

If so, maybe it needs to add setting for "Unicode version" in "Options".

N.B. In Android app "UnicodePad" there is Unicode version setting for compatibility issues:

kernc commented

Is it Unicode version: 12.1 and 4.0?

Those are just Unicode versions that introduced the symbol. Unreliable and not future-compatible.

I'd rather not (have the user) filter by Unicode version. We simply enumerate all the glyphs from the latest (vendored) Unicode standard, and the user might see some of the emoji icons blank, depending on the platform/font availability.