Skip to content

regression: missing emojis in picker search#41342

Open
MartinSchoeler wants to merge 2 commits into
developfrom
reg/missing-search-alias-emoji
Open

regression: missing emojis in picker search#41342
MartinSchoeler wants to merge 2 commits into
developfrom
reg/missing-search-alias-emoji

Conversation

@MartinSchoeler

@MartinSchoeler MartinSchoeler commented Jul 13, 2026

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

Issue(s)

CORE-2415

Steps to test or reproduce

Further comments

Review in cubic

Summary by CodeRabbit

  • Bug Fixes

    • Improved emoji search results with cross-package deduplication.
    • Enhanced matching for primary shortcodes and aliases (including partial alias matching).
    • Prevented skin-tone variant names from appearing in default results while still honoring the selected tone.
    • Continued searching gracefully when an emoji can’t be rendered.
  • Tests

    • Added unit coverage for emoji search behavior, including aliases, partial matches, deduplication, and tone filtering.

@dionisio-bot

dionisio-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 702168b9-1b8c-4856-b6f1-0a6a376834fb

📥 Commits

Reviewing files that changed from the base of the PR and between d64ad1c and 3e56567.

📒 Files selected for processing (4)
  • apps/meteor/app/emoji-native/lib/generateEmojiData.ts
  • apps/meteor/app/emoji/client/helpers.ts
  • apps/meteor/app/emoji/lib/rocketchat.ts
  • apps/meteor/tests/unit/app/emoji/helpers.spec.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/meteor/tests/unit/app/emoji/helpers.spec.ts
  • apps/meteor/app/emoji/client/helpers.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: CodeQL-Build
  • GitHub Check: Hacktron Security Check
  • GitHub Check: CodeQL-Build
⚠️ CI failures not shown inline (5)

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ❌ **Has milestone or project** — This PR is missing the required milestone or project
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ❌ **Has milestone or project** — This PR is missing the required milestone or project
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ❌ **Has milestone or project** — This PR is missing the required milestone or project
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ❌ **Has milestone or project** — This PR is missing the required milestone or project
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ❌ **Has milestone or project** — This PR is missing the required milestone or project
- ✅ **Valid PR title**
- ✅ **Correct target version**
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/emoji/lib/rocketchat.ts
  • apps/meteor/app/emoji-native/lib/generateEmojiData.ts
🧠 Learnings (3)
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/app/emoji/lib/rocketchat.ts
  • apps/meteor/app/emoji-native/lib/generateEmojiData.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/app/emoji/lib/rocketchat.ts
  • apps/meteor/app/emoji-native/lib/generateEmojiData.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/meteor/app/emoji/lib/rocketchat.ts
  • apps/meteor/app/emoji-native/lib/generateEmojiData.ts
🔇 Additional comments (2)
apps/meteor/app/emoji-native/lib/generateEmojiData.ts (1)

20-20: LGTM!

Also applies to: 77-77, 113-113

apps/meteor/app/emoji/lib/rocketchat.ts (1)

23-23: LGTM!

Also applies to: 38-38


Walkthrough

Emoji data now carries entry names, and emoji search deduplicates matches across packages, uses category and shortcode data for matching, and continues when rendered emoji lookup fails. Unit tests register native emoji data and cover aliases, partial matches, duplicates, and skin tones.

Changes

Emoji search behavior

Layer / File(s) Summary
Emoji data name contract
apps/meteor/app/emoji-native/lib/generateEmojiData.ts, apps/meteor/app/emoji/lib/rocketchat.ts
Native emoji entries now include generated names, and package list types distinguish entries with and without names.
Search matching and deduplication
apps/meteor/app/emoji/client/helpers.ts
getEmojisBySearchTerm deduplicates results, matches using category and shortcode data, and skips unavailable rendered emojis.
Native emoji search tests
apps/meteor/tests/unit/app/emoji/helpers.spec.ts
Registers native emoji metadata and tests shortcode, alias, partial-match, duplicate, and skin-tone filtering behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: type: bug

Suggested reviewers: sampaiodiego, cardoso

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main regression fix: missing emojis in picker search.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • CORE-2415: Request failed with status code 401

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@changeset-bot

changeset-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3e56567

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 65.78947% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.22%. Comparing base (ed594fd) to head (3e56567).
⚠️ Report is 8 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #41342      +/-   ##
===========================================
- Coverage    69.11%   68.22%   -0.90%     
===========================================
  Files         3759     3968     +209     
  Lines       147859   154749    +6890     
  Branches     26420    27802    +1382     
===========================================
+ Hits        102196   105573    +3377     
- Misses       41179    44383    +3204     
- Partials      4484     4793     +309     
Flag Coverage Δ
e2e 59.19% <0.00%> (-0.05%) ⬇️
e2e-api 44.34% <ø> (-4.62%) ⬇️
unit 70.62% <57.89%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MartinSchoeler MartinSchoeler marked this pull request as ready for review July 13, 2026 19:57
@MartinSchoeler MartinSchoeler requested a review from a team as a code owner July 13, 2026 19:57
KevLehman
KevLehman previously approved these changes Jul 13, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
apps/meteor/tests/unit/app/emoji/helpers.spec.ts (1)

37-39: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

No teardown for registerNativeEmojis — mutates shared singleton for the rest of the suite.

before(registerNativeEmojis) populates emoji.packages.native and adds many entries to emoji.list on the shared emoji singleton (imported from apps/meteor/app/emoji/client/lib.ts), but there's no after hook to remove them. Any other test blocks in this file or process sharing this module instance (e.g. tests for updateRecent/removeFromRecent/replaceEmojiInRecent) that run after this describe block could observe polluted state.

🧹 Suggested cleanup
 	describe('getEmojisBySearchTerm', () => {
 		before(registerNativeEmojis);
+		after(() => {
+			delete emoji.packages.native;
+			// also remove entries added to emoji.list by registerNativeEmojis
+		});
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/tests/unit/app/emoji/helpers.spec.ts` around lines 37 - 39, Add
teardown to the getEmojisBySearchTerm suite that reverses the shared emoji
singleton mutations performed by registerNativeEmojis, including clearing
emoji.packages.native and removing its entries from emoji.list. Use the existing
emoji state and cleanup utilities if available, and ensure subsequent tests
start with the same state as before setup.
apps/meteor/app/emoji/client/helpers.ts (1)

189-194: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Category-membership scan runs per matching candidate.

Object.values(...emojisByCategory).some(contents => contents.indexOf(categoryName) !== -1) linearly scans every category array for every key that passes the initial regex test. For short search terms that match many keys (e.g. a single character while typing), this becomes an O(candidates × categories × itemsPerCategory) scan on a UI hot path. Consider building a Set<string> of category members once per package (memoized outside the loop or cached alongside the package) and doing an O(1) .has() lookup instead.

♻️ Possible optimization
+	const categoryMembership = new Map<string, Set<string>>();
+
 	for (let current in emoji.list) {
 		...
-		const isCategoryEmoji = Object.values(emoji.packages[emojiPackage].emojisByCategory).some(
-			(contents) => contents.indexOf(categoryName) !== -1,
-		);
+		if (!categoryMembership.has(emojiPackage)) {
+			categoryMembership.set(
+				emojiPackage,
+				new Set(Object.values(emoji.packages[emojiPackage].emojisByCategory).flat()),
+			);
+		}
+		const isCategoryEmoji = categoryMembership.get(emojiPackage)!.has(categoryName);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/app/emoji/client/helpers.ts` around lines 189 - 194, In the
candidate-filtering loop around isCategoryEmoji, avoid rescanning every
emojisByCategory array for each matching key. Build or reuse a per-package Set
containing the category members before the loop, then replace the per-candidate
Object.values(...).some(...) scan with an O(1) membership lookup while
preserving the existing !isCategoryEmoji && shortnames.length === 0 filtering
behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/meteor/app/emoji/client/helpers.ts`:
- Around line 171-173: Update the deduplication logic in the emoji-processing
flow to check and record the resolved actualEmoji value rather than emojiObject.
Move the seenEmojis check/add so entries resolving to the same actualEmoji are
emitted only once, while preserving the existing row-generation behavior.

---

Nitpick comments:
In `@apps/meteor/app/emoji/client/helpers.ts`:
- Around line 189-194: In the candidate-filtering loop around isCategoryEmoji,
avoid rescanning every emojisByCategory array for each matching key. Build or
reuse a per-package Set containing the category members before the loop, then
replace the per-candidate Object.values(...).some(...) scan with an O(1)
membership lookup while preserving the existing !isCategoryEmoji &&
shortnames.length === 0 filtering behavior.

In `@apps/meteor/tests/unit/app/emoji/helpers.spec.ts`:
- Around line 37-39: Add teardown to the getEmojisBySearchTerm suite that
reverses the shared emoji singleton mutations performed by registerNativeEmojis,
including clearing emoji.packages.native and removing its entries from
emoji.list. Use the existing emoji state and cleanup utilities if available, and
ensure subsequent tests start with the same state as before setup.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a92cf746-ec38-460c-9577-df15aef68893

📥 Commits

Reviewing files that changed from the base of the PR and between ed594fd and d64ad1c.

📒 Files selected for processing (2)
  • apps/meteor/app/emoji/client/helpers.ts
  • apps/meteor/tests/unit/app/emoji/helpers.spec.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Hacktron Security Check
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/tests/unit/app/emoji/helpers.spec.ts
  • apps/meteor/app/emoji/client/helpers.ts
**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use .spec.ts extension for test files (e.g., login.spec.ts)

Files:

  • apps/meteor/tests/unit/app/emoji/helpers.spec.ts
🧠 Learnings (5)
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.

Applied to files:

  • apps/meteor/tests/unit/app/emoji/helpers.spec.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/tests/unit/app/emoji/helpers.spec.ts
  • apps/meteor/app/emoji/client/helpers.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/tests/unit/app/emoji/helpers.spec.ts
  • apps/meteor/app/emoji/client/helpers.ts
📚 Learning: 2026-03-06T18:10:15.268Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/code/CodeBlock.spec.tsx:47-68
Timestamp: 2026-03-06T18:10:15.268Z
Learning: In tests (especially those using testing-library/dom/jsdom) for Rocket.Chat components, the HTML <code> element has an implicit ARIA role of 'code'. Therefore, screen.getByRole('code') or screen.findByRole('code') will locate <code> elements even without a role attribute. Do not flag findByRole('code') as invalid in reviews; prefer using the implicit role instead of adding role="code" unless necessary for accessibility.

Applied to files:

  • apps/meteor/tests/unit/app/emoji/helpers.spec.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/meteor/tests/unit/app/emoji/helpers.spec.ts
  • apps/meteor/app/emoji/client/helpers.ts
🪛 ast-grep (0.44.1)
apps/meteor/app/emoji/client/helpers.ts

[warning] 160-160: Do not use variable for regular expressions
Context: new RegExp(escapeRegExp(searchTerm.replace(/:/g, '')), 'i')
Note: [CWE-1333] Inefficient Regular Expression Complexity. Security best practice.

(regexp-non-literal-typescript)

🔇 Additional comments (3)
apps/meteor/app/emoji/client/helpers.ts (1)

195-208: LGTM on the breakcontinue fix.

Skipping (instead of aborting the whole search) when the rendered emoji for a candidate can't be resolved directly addresses the "missing emojis in picker search" regression — a single unrenderable candidate no longer terminates the entire scan.

apps/meteor/tests/unit/app/emoji/helpers.spec.ts (2)

40-68: LGTM!


11-22: 🎯 Functional Correctness

No typing issue here EmojiPackages['native'] is assignable to EmojiPackage, and categoryIndex is optional. getEmojiConfig() already returns emojiList entries with emojiPackage, so the direct mutation and emoji.packages.native assignment match the existing types.

			> Likely an incorrect or invalid review comment.

Comment on lines +171 to +173
if (seenEmojis.has(emojiObject)) {
continue;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="apps/meteor/app/emoji/client/helpers.ts"

# Map the file structure first, then inspect the relevant section.
ast-grep outline "$file" --view expanded || true
wc -l "$file"
sed -n '140,235p' "$file"

Repository: RocketChat/Rocket.Chat

Length of output: 4526


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find where emoji.list is defined/populated and inspect the relevant parts.
rg -n "emoji\.list|packages\.base|renderPicker|emojisByCategory|toneList" apps/meteor/app/emoji -g '*.ts' -g '*.js' -g '*.tsx' || true

# Inspect the helper around the dedupe logic and nearby calls.
sed -n '153,235p' apps/meteor/app/emoji/client/helpers.ts

# Inspect the emoji data source if present in the repo.
fd -a "emoji" apps/meteor/app | sed -n '1,40p'

Repository: RocketChat/Rocket.Chat

Length of output: 7018


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect emoji list construction and package loading for object identity / aliasing.
sed -n '1,220p' apps/meteor/app/emoji/client/lib.ts
printf '\n---\n'
sed -n '1,220p' apps/meteor/app/emoji/server/lib.ts
printf '\n---\n'
sed -n '1,260p' apps/meteor/app/emoji/lib/rocketchat.ts
printf '\n---\n'
rg -n "emoji\.list\s*=|list\[[^]]+\]|alias|shortnames|emojiPackage" apps/meteor/app/emoji -g '*.ts' -g '*.js'

Repository: RocketChat/Rocket.Chat

Length of output: 6246


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the category picker path that uses the same emoji lookup pattern.
sed -n '60,120p' apps/meteor/app/emoji/client/helpers.ts

# Show the search helper with line numbers for exact control flow.
cat -n apps/meteor/app/emoji/client/helpers.ts | sed -n '153,210p'

# Look for alias handling in emoji data generation / loading.
rg -n "aliasOf|aliases|shortnames|emojiToRender|seenEmojis" apps/meteor/app/emoji-native apps/meteor/app/emoji-custom apps/meteor/app/emoji/client -g '*.ts' -g '*.js'

Repository: RocketChat/Rocket.Chat

Length of output: 9332


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the emoji data generation/loading path where list entries and aliases are created.
cat -n apps/meteor/app/emoji-native/lib/generateEmojiData.ts | sed -n '1,220p'
printf '\n---\n'
cat -n apps/meteor/app/emoji-native/server/lib.ts | sed -n '1,220p'
printf '\n---\n'
cat -n apps/meteor/app/emoji-custom/server/lib/insertOrUpdateEmoji.ts | sed -n '1,240p'

Repository: RocketChat/Rocket.Chat

Length of output: 12901


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect custom emoji registration to see whether multiple keys can share or replace objects.
rg -n "emoji\.list\[|emojiCustom|aliases|renderPicker" apps/meteor/app/emoji-custom apps/meteor/app/emoji -g '*.ts' -g '*.js'

Repository: RocketChat/Rocket.Chat

Length of output: 4568


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect custom emoji client/server registration code to see how aliases map into emoji.list.
rg -n "setAliases|updateCustom|emoji.list\\[.*alias|emojiCustom" apps/meteor/app -g '*.ts' -g '*.js'

Repository: RocketChat/Rocket.Chat

Length of output: 2012


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the native emoji config path that handles custom overrides.
cat -n apps/meteor/app/emoji-native/lib/getEmojiConfig.ts | sed -n '1,220p'

printf '\n---\n'

# Find direct emoji.list assignments across the emoji codepaths.
rg -n "emoji\.list\s*\[.*\]\s*=" apps/meteor/app/emoji apps/meteor/app/emoji-native apps/meteor/app/emoji-custom -g '*.ts' -g '*.js'

printf '\n---\n'

# Inspect any custom emoji package registration/loading path if present.
fd -a "emoji-custom" apps/meteor/app | sed -n '1,80p'

Repository: RocketChat/Rocket.Chat

Length of output: 4952


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the custom emoji startup/registration path to see how its entries enter emoji.list.
sed -n '1,220p' apps/meteor/app/emoji-custom/server/startup/emoji-custom.js
printf '\n---\n'
rg -n "emoji\.list|EmojiCustom|emoji.updateCustom|aliases" apps/meteor/app/emoji-custom/server -g '*.ts' -g '*.js'

Repository: RocketChat/Rocket.Chat

Length of output: 14383


Deduplicate on the resolved emoji object. emojiObject can differ while actualEmoji is the same (for example, base and tone-specific keys resolving to one render target), so duplicate rows still slip through. Move the seenEmojis check/add to actualEmoji.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/app/emoji/client/helpers.ts` around lines 171 - 173, Update the
deduplication logic in the emoji-processing flow to check and record the
resolved actualEmoji value rather than emojiObject. Move the seenEmojis
check/add so entries resolving to the same actualEmoji are emitted only once,
while preserving the existing row-generation behavior.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread apps/meteor/app/emoji/client/helpers.ts Outdated

@jessicaschelly jessicaschelly left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a test to the scenario mentioned by Cubic?

something like:

  it('applies the selected skin tone when searching by an alias', () => {
        const result = getEmojisBySearchTerm('thumbsup', 2, [], () => undefined).find(({ image }) =>
        image?.includes('👍'));

        expect(result).to.exist;
        expect(result?.image).to.include('👍🏼');
  });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants