Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude deactivated realm emoji from autocomplete #1114

Merged
merged 6 commits into from
Dec 9, 2024

Conversation

gnprice
Copy link
Member

@gnprice gnprice commented Dec 9, 2024

Fixes #1113.

The first commit (toString on some emoji-related data classes) is shared with #1112.

When combining with #1112, the three new test cases will each need a tweak like this one:

       check(store.allEmojiCandidates()).deepEquals([
+        ...arePopularCandidates,

just like #1112 itself does (in its last commit) for several existing test cases.

Selected commit messages

2c276b8 emoji [nfc]: Make realmEmoji internal to EmojiStoreImpl

It's a bit of a trap for the unwary (... like me last month, in
ecd2cb5, causing #1113), because it includes deactivated realm emoji
as well as active ones.

e564806 api [nfc]: Rename RealmEmojiItem.id to emojiCode

This way the binding encapsulates an important fact about this
bit of the API -- namely that these values are the same as the
"emoji code" values seen elsewhere in the API -- so that we don't
have to re-verify it when working elsewhere in the codebase and
using this class.

Also edit a doc comment in the model code to take advantage of
that understanding.

f09aab1 emoji: Exclude deactivated realm emoji from autocomplete

Fixes #1113.

Very useful when these objects appear in test failures.
It's a bit of a trap for the unwary (... like me last month, in
ecd2cb5, causing zulip#1113), because it includes deactivated realm emoji
as well as active ones.
This way the binding encapsulates an important fact about this
bit of the API -- namely that these values are the same as the
"emoji code" values seen elsewhere in the API -- so that we don't
have to re-verify it when working elsewhere in the codebase and
using this class.

Also edit a doc comment in the model code to take advantage of
that understanding.
@gnprice gnprice added the maintainer review PR ready for review by Zulip maintainers label Dec 9, 2024
I spent some time reverse-engineering in full detail the behavior web
has for building its list of possible emoji to present in the UI (and
so for the order that emoji results have when they don't differ on
any of the criteria used at the ranking step after applying a query).

The first output of that study was discovering zulip#1113, fixed earlier
in this branch.  This records the rest.
@chrisbobbe chrisbobbe self-requested a review December 9, 2024 20:28
@chrisbobbe chrisbobbe self-assigned this Dec 9, 2024
@chrisbobbe
Copy link
Collaborator

Thanks! LGTM, merging.

@chrisbobbe chrisbobbe merged commit 489a699 into zulip:main Dec 9, 2024
1 check passed
@gnprice gnprice deleted the pr-emoji-deactivated branch December 9, 2024 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer review PR ready for review by Zulip maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deactivated custom emoji offered in autocomplete
2 participants