Skip to content

regression: Legacy emoji in composer popup - #41581

Open
yash-rajpal wants to merge 2 commits into
release-8.7.0from
reg/legacy-emoji-popup
Open

regression: Legacy emoji in composer popup#41581
yash-rajpal wants to merge 2 commits into
release-8.7.0from
reg/legacy-emoji-popup

Conversation

@yash-rajpal

@yash-rajpal yash-rajpal commented Jul 27, 2026

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

Currently we don't show legacy emojis in emoji picker but we still show them in composer popup. This results in inconsistent behavior. To keep consistency, we should also remove legacy emojis from composer emoji popup.

This PR introduces a new flag on emoji list legacy which is true for legacy emojis and based on this flag we render the emoji on composer popup.

Issue(s)

Steps to test or reproduce

  • Open a message composer.
  • Type :dog2.
  • Observe the emoji autocomplete popup.
  • Confirm that 🐕 🐕 is displayed as a suggestion.
  • Open the emoji picker and search for dog2.
  • Confirm that no result is returned.
  • Enter the complete 🐕 shortcode manually and send the message.
  • Confirm that it renders as 🐕

Further comments

CORE-2467

Summary by CodeRabbit

  • Bug Fixes
    • Improved emoji autocomplete by excluding legacy emojis from suggestions and local filtering, while keeping compatibility for manually typed legacy shortcodes.
    • Updated emoji search behavior to avoid returning legacy-only entries in results and partial matches.
  • Tests
    • Expanded emoji helper tests to verify legacy exclusion in search/autocomplete and continued support for rendering legacy shortcodes.

@dionisio-bot

dionisio-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f7a91eb

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

@coderabbitai

coderabbitai Bot commented Jul 27, 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 Plus

Run ID: 83ccac92-99f8-4702-8f83-ddebe02d287e

📥 Commits

Reviewing files that changed from the base of the PR and between f7a91eb and 52de5d7.

📒 Files selected for processing (2)
  • apps/meteor/app/emoji/client/helpers.ts
  • apps/meteor/tests/unit/app/emoji/helpers.spec.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: 📦 Build Packages
  • GitHub Check: Hacktron Security Check
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🧰 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/app/emoji/client/helpers.ts
  • apps/meteor/tests/unit/app/emoji/helpers.spec.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 (6)
📚 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/client/helpers.ts
  • 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 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/client/helpers.ts
  • 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/app/emoji/client/helpers.ts
  • apps/meteor/tests/unit/app/emoji/helpers.spec.ts
📚 Learning: 2026-07-22T19:03:06.706Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 41520
File: apps/meteor/app/emoji-native/lib/getEmojiConfig.ts:59-62
Timestamp: 2026-07-22T19:03:06.706Z
Learning: In Rocket.Chat’s native emoji pipeline, keep the legacy-parity behavior for ASCII emoticons that appear inside `<code>`/`<pre>`: `apps/meteor/app/emoji-native/lib/getEmojiConfig.ts` may convert matching ASCII emoticons into emoji-span nodes, but the downstream DOM pass in `apps/meteor/app/emoji/client/emojiParser.ts` must restore the emoji span’s literal `title` text when the span’s parent is a `CODE` element. When changing emoji config or parsing, ensure this `<code>` protection behavior is preserved; the planned structural HTML protection should be handled by the post-release message-parser/gazzodown migration rather than by removing/altering this restore logic ad-hoc.

Applied to files:

  • apps/meteor/app/emoji/client/helpers.ts
📚 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-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
🔇 Additional comments (2)
apps/meteor/app/emoji/client/helpers.ts (1)

175-180: LGTM!

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

7-7: LGTM!

Also applies to: 31-51, 91-107


Walkthrough

The emoji list now supports legacy metadata, native Emjione fallback entries are marked as legacy, and legacy entries are excluded from composer autocomplete and search results while remaining manually renderable.

Changes

Legacy emoji autocomplete handling

Layer / File(s) Summary
Mark legacy emoji entries
apps/meteor/app/emoji/lib/rocketchat.ts, apps/meteor/client/views/root/hooks/useNativeEmoji.ts
EmojiPackages['list'] supports an optional legacy property, and registered legacy Emjione entries set it to true.
Filter legacy emoji discovery
apps/meteor/client/views/room/providers/ComposerPopupProvider.tsx, apps/meteor/app/emoji/client/helpers.ts
Composer popup filters and emoji search skip entries marked as legacy.
Validate legacy behavior
apps/meteor/tests/unit/app/emoji/helpers.spec.ts
Tests verify legacy-only names are excluded from search, base names remain searchable, and manual legacy shortcode rendering still works.

Estimated code review effort: 2 (Simple) | ~15 minutes

Sequence Diagram(s)

sequenceDiagram
  participant useNativeEmoji
  participant EmojiList
  participant ComposerPopupProvider
  participant getEmojisBySearchTerm
  useNativeEmoji->>EmojiList: Register legacy shortcode with legacy=true
  ComposerPopupProvider->>EmojiList: Read emoji entry
  ComposerPopupProvider->>ComposerPopupProvider: Exclude legacy autocomplete entry
  getEmojisBySearchTerm->>EmojiList: Iterate emoji entries
  getEmojisBySearchTerm->>getEmojisBySearchTerm: Skip legacy search entry
Loading

Possibly related PRs

Suggested labels: type: bug

Suggested reviewers: martinschoeler, cardoso, ricardogarim

🚥 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 is concise and accurately highlights the main change: fixing legacy emoji behavior in the composer popup.
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-2467: 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.

@yash-rajpal
yash-rajpal marked this pull request as ready for review July 27, 2026 09:45
@yash-rajpal
yash-rajpal requested a review from a team as a code owner July 27, 2026 09:45
@yash-rajpal yash-rajpal added the stat: QA assured Means it has been tested and approved by a company insider label Jul 27, 2026
@yash-rajpal yash-rajpal added this to the 8.7.0 milestone Jul 27, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Jul 27, 2026

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

No issues found across 3 files

Re-trigger cubic

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 28.57143% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.58%. Comparing base (fcf244e) to head (52de5d7).
⚠️ Report is 1 commits behind head on release-8.7.0.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           release-8.7.0   #41581      +/-   ##
=================================================
- Coverage          68.61%   68.58%   -0.04%     
=================================================
  Files               4138     4138              
  Lines             159416   159424       +8     
  Branches           28206    28217      +11     
=================================================
- Hits              109384   109341      -43     
- Misses             44893    44942      +49     
- Partials            5139     5141       +2     
Flag Coverage Δ
e2e 58.86% <0.00%> (+0.01%) ⬆️
e2e-api 45.36% <ø> (-0.26%) ⬇️
unit 70.56% <33.33%> (-0.02%) ⬇️

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.

@yash-rajpal
yash-rajpal requested a review from a team as a code owner July 27, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants