Repository navigation
fix: show every emoji match, once - #1151
Conversation
the composer capped suggestions at 8 and the reaction picker at 200, and an emoji with two names showed up once per name. searchEmoji now returns every match, one entry per emoji. Signed-off-by: Younes <git@younes.io>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Search API and picker integration resources/js/lib/emoji.ts, resources/js/components/chat/message-reactions.tsx, tests/Unit/EmojiSearch.test.tsx |
searchEmoji now accepts an optional usage-count map, normalizes queries, deduplicates matches by emoji, and ranks results by match type, usage count, shortcode length, and name. The result limit and searchEmojiByUse export are removed. The chat reaction picker and tests use searchEmoji. Tests check prefix ordering, result counts, emoji pairs, reaction ordering, uniqueness, and unknown shortcodes. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
- dev-null-sh/dev-null.sh#252: Adds composer access to the searchable reaction emoji picker, which this change updates to use the revised search API.
- dev-null-sh/dev-null.sh#359: Uses
searchEmojifor emoji suggestions inMentionTextarea, so the revised search contract is relevant.
Suggested reviewers: xheaven
Merge Risk: 
Minimal · up to 883e2
-
The emoji search change is mergeable; no actionable correctness or availability risk was found.
Security architecture risk: 
Minimal · up to 883e2
-
The change expands and deduplicates local emoji suggestions. Results remain limited to the bundled emoji catalog, and selection uses the existing composer and reaction flows without adding privileges or changing ownership.
Retained concerns
No architecture-level concerns identified.Security review details
-
Security Blast Radius
- inferred — Removing the result caps can increase local suggestion rendering, but query text cannot enlarge the bundled catalog or supply arbitrary result values. The demonstrated expansion is within the user's client-side picker and composer, not a new cross-tenant or privileged operation.
Trust Boundaries and Controls
- observed — Reaction selection retains the pre-existing ownership flow: the picker returns an emoji through injected callbacks, while conversation and pinned-message owners retain message identity and reaction mutation handling. The comparison does not change this boundary or grant the search helper mutation authority.
-
Pre-merge checks: 
5
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
@xHeaven : this is ready for your review btw :) |
|
@xHeaven friendly nudge on this one when you get a chance. CodeRabbit and CI are green, and it's a small change. |
Thanks for the nudge, checking! |
|
This one looks good to me, merging prod into this just in case and let the CI pass, then merging. |
summary
emoji search was hiding emoji.
type
:heartin the composer and you see 8 hearts. there are 34. the rest aren't in the list at all, so if the one you want isn't in the first 8, you have to know its exact name and type it out.the reaction picker does the same thing, just later. it stops at 200, so searching "ar" quietly drops 53.
and some emoji show up twice because they have two names.
:boatgives you ⛵ as:boat:and again as:sailboat:. when you only get 8 slots, that's one wasted.so i took the caps off and made each emoji show up once.
changes
searchEmoji(query, uses)inresources/js/lib/emoji.tsreplaces the two capped search functions. it keeps one entry per emoji and has no limit.searchEmoji.validation
i ran these locally:
vitest run tests/Unit/EmojiSearch.test.tsxpassed all 5 tests.bun run test:typespassed.bun run test:lintpassed. its only warnings are old ones inTranslationLanguages.test.ts.visual evidence
i ran the app locally on
production(5709994) and on this branch with the same seeded data, and took the screenshots. the red outlines mark the rows that matter.:heart, desktop:boat, desktop:boat, mobile:heart, desktop"ar" picker, mobile
:boat, desktop:boat, mobiledevice verification
i tested mobile in chromium's iphone 13 emulation and opened the reaction sheet with a long press sent through cdp. i didn't test on a real phone.
Summary by CodeRabbit