Skip to content

fix: show every emoji match, once - #1151

Merged
xHeaven merged 2 commits into
dev-null-sh:productionfrom
younes-io:fix/emoji-search-results
Oct 27, 2026
Merged

xHeaven merged 2 commits into
dev-null-sh:productionfrom
younes-io:fix/emoji-search-results

Conversation

@younes-io

@younes-io younes-io commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

summary

emoji search was hiding emoji.

type :heart in 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. :boat gives 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) in resources/js/lib/emoji.ts replaces the two capped search functions. it keeps one entry per emoji and has no limit.
  • the reaction picker calls searchEmoji.
  • the unit tests check the full match count and the duplicate.

validation

i ran these locally:

  • vitest run tests/Unit/EmojiSearch.test.tsx passed all 5 tests.
  • bun run test:types passed.
  • bun run test:lint passed. its only warnings are old ones in TranslationLanguages.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.

before after
:heart, desktop 8 rows. the list ends at 😻 34 rows. 😻 is still #8
"ar" picker, mobile 200 results. the grid ends at 💞 253 results. 💞 is still #200
:boat, desktop ⛵ twice ⛵ once
:boat, mobile ⛵ twice ⛵ once

:heart, desktop

before after
before-composer-heart-desktop after-composer-heart-desktop

"ar" picker, mobile

before after
before-picker-ar-mobile after-picker-ar-mobile

:boat, desktop

before after
before-composer-boat-desktop after-composer-boat-desktop

:boat, mobile

before after
before-composer-boat-mobile after-composer-boat-mobile

device 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

  • New Features
    • Emoji search now recognizes queries wrapped in colons and handles extra spaces and letter casing.
    • Results prioritize stronger matches, then more frequently used emojis, and show matching results without a fixed result limit.
  • Bug Fixes
    • Chat reaction emoji search now follows the same matching and ranking behavior as the emoji picker.

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>
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 80635775-41e8-4b2a-8991-6d8be8dc9f35
Commits

Reviewing files that changed from the base of the PR and between 58be913 and 883e20f.

Files selected for processing: 1
  • resources/js/components/chat/message-reactions.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The emoji search API now accepts optional usage counts and returns uncapped results. The chat reaction picker and unit tests use the updated API.

Changes: Emoji search

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: Normal

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 searchEmoji for emoji suggestions in MentionTextarea, 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: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title accurately summarizes the main change: showing all emoji matches once without duplicates.
Docstring Coverage Passed Docstring coverage is inconclusive: files from earlier reviews still need to be rechecked within the check's analysis limits. Not blocking.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
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.

@younes-io
younes-io marked this pull request as ready for review October 25, 2026 17:53
@younes-io

Copy link
Copy Markdown
Contributor Author

@xHeaven : this is ready for your review btw :)

@younes-io

Copy link
Copy Markdown
Contributor Author

@xHeaven friendly nudge on this one when you get a chance. CodeRabbit and CI are green, and it's a small change.

@xHeaven

xHeaven commented Oct 27, 2026

Copy link
Copy Markdown
Member

@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!

@xHeaven

xHeaven commented Oct 27, 2026

Copy link
Copy Markdown
Member

This one looks good to me, merging prod into this just in case and let the CI pass, then merging.

@xHeaven
xHeaven merged commit 8ac93e0 into dev-null-sh:production Oct 27, 2026
7 checks passed
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.

2 participants