Skip to content

regression: canned response emojis appear as shortcodes to livechat visitors#41558

Open
nazabucciarelli wants to merge 3 commits into
release-8.7.0from
regression/emoji-canned-response
Open

regression: canned response emojis appear as shortcodes to livechat visitors#41558
nazabucciarelli wants to merge 3 commits into
release-8.7.0from
regression/emoji-canned-response

Conversation

@nazabucciarelli

@nazabucciarelli nazabucciarelli commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Proposed changes (including videos or screenshots)

Root cause: When inserting an emoji in the canned response text, the CannedResponsesComposer.tsx component saved the literal shortcode (e.g :grinning_face_with_big_eyes:) instead of the unicode character. I guided myself with the MessageBox.tsx component, which resolved the shortcode to unicode before inserting it.

To address it, the same lookup that MessageBox.tsx does was implemented: look for the entry in emoji.list[':name:'] and, if it has unicode, then the real character is inserted, otherwise it falls back to the shortcode.

Issue(s)

CORE-2468 [Regression] Canned response emojis appear as shortcodes to Livechat visitors

Steps to test or reproduce

You'll need a EE license for the Canned Responses feature.

  1. Go to Omnichannel → Canned Responses.
  2. Create a canned response.
  3. Select 😃 using the emoji picker in the Message field.
  4. Save the response.
  5. Use the response in a Livechat conversation.
  6. Compare the agent and visitor views.

Further comments

Review in cubic

Summary by CodeRabbit

  • Bug Fixes

    • Improved emoji insertion in canned responses.
    • Native emojis now insert as Unicode characters, while custom emojis fall back to their shortcode.
    • Inserted emojis include a trailing space for easier continued typing.
  • Tests

    • Added coverage for native and custom emoji insertion behavior.

@dionisio-bot

dionisio-bot Bot commented Jul 24, 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

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e10b25e

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 24, 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: d2790f8e-97f8-449b-b56c-7feeec92e0f4

📥 Commits

Reviewing files that changed from the base of the PR and between fcf244e and e10b25e.

📒 Files selected for processing (2)
  • apps/meteor/client/views/omnichannel/cannedResponses/components/CannedResponsesComposer/CannedResponsesComposer.spec.tsx
  • apps/meteor/client/views/omnichannel/cannedResponses/components/CannedResponsesComposer/CannedResponsesComposer.tsx
📜 Recent review details
⏰ Context from checks skipped due to timeout. (12)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Hacktron Security Check
  • GitHub Check: 🚢 Build Docker (amd64, account-service, presence-service, omnichannel-transcript-service, fips)
  • GitHub Check: 🚢 Build Docker (arm64, rocketchat, coverage)
  • GitHub Check: 🚢 Build Docker (amd64, rocketchat, fips)
  • GitHub Check: 🚢 Build Docker (arm64, account-service, presence-service, omnichannel-transcript-service, cove...
  • GitHub Check: 🚢 Build Docker (amd64, authorization-service, queue-worker-service, ddp-streamer-service, cove...
  • GitHub Check: 🚢 Build Docker (amd64, account-service, presence-service, omnichannel-transcript-service, cove...
  • GitHub Check: 🚢 Build Docker (arm64, authorization-service, queue-worker-service, ddp-streamer-service, cove...
  • GitHub Check: 🚢 Build Docker (amd64, rocketchat, coverage)
  • GitHub Check: 🚢 Build Docker (amd64, authorization-service, queue-worker-service, ddp-streamer-service, fips)
  • GitHub Check: 🔎 Code Check / Code Lint
🧰 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/client/views/omnichannel/cannedResponses/components/CannedResponsesComposer/CannedResponsesComposer.spec.tsx
  • apps/meteor/client/views/omnichannel/cannedResponses/components/CannedResponsesComposer/CannedResponsesComposer.tsx
🧠 Learnings (3)
📚 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/client/views/omnichannel/cannedResponses/components/CannedResponsesComposer/CannedResponsesComposer.spec.tsx
📚 Learning: 2026-03-27T14:52:56.865Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39892
File: apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx:150-155
Timestamp: 2026-03-27T14:52:56.865Z
Learning: In Rocket.Chat, there are two different `ModalBackdrop` components with different prop APIs. During review, confirm the import source: (1) `rocket.chat/fuselage` `ModalBackdrop` uses `ModalBackdropProps` based on `BoxProps` (so it supports `onClick` and other Box/DOM props) and does not have an `onDismiss` prop; (2) `rocket.chat/ui-client` `ModalBackdrop` uses a narrower props interface like `{ children?: ReactNode; onDismiss?: () => void }` and handles Escape keypress and outside mouse-up, and it does not forward arbitrary DOM props such as `onClick`. Flag mismatched props (e.g., `onDismiss` passed to the fuselage component or `onClick` passed to the ui-client component) and ensure the usage matches the correct component being imported.

Applied to files:

  • apps/meteor/client/views/omnichannel/cannedResponses/components/CannedResponsesComposer/CannedResponsesComposer.spec.tsx
  • apps/meteor/client/views/omnichannel/cannedResponses/components/CannedResponsesComposer/CannedResponsesComposer.tsx
📚 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/client/views/omnichannel/cannedResponses/components/CannedResponsesComposer/CannedResponsesComposer.spec.tsx
  • apps/meteor/client/views/omnichannel/cannedResponses/components/CannedResponsesComposer/CannedResponsesComposer.tsx
🔇 Additional comments (2)
apps/meteor/client/views/omnichannel/cannedResponses/components/CannedResponsesComposer/CannedResponsesComposer.tsx (1)

16-16: LGTM!

Also applies to: 65-70, 90-90

apps/meteor/client/views/omnichannel/cannedResponses/components/CannedResponsesComposer/CannedResponsesComposer.spec.tsx (1)

1-83: LGTM!


Walkthrough

CannedResponsesComposer now resolves selected emoji names through emoji.list, inserting Unicode when available or a shortcode fallback otherwise. New tests cover both native and custom emoji insertion, including the trailing space.

Changes

Canned response emoji insertion

Layer / File(s) Summary
Resolve picker emoji names
apps/meteor/client/views/omnichannel/cannedResponses/components/CannedResponsesComposer/CannedResponsesComposer.tsx
The composer passes the picker’s emojiName to a handler that inserts the matching Unicode character or :<name>: fallback with a trailing space.
Validate emoji insertion
apps/meteor/client/views/omnichannel/cannedResponses/components/CannedResponsesComposer/CannedResponsesComposer.spec.tsx
Tests verify insertion of native Unicode and custom emoji shortcodes.
Estimated code review effort: 2 (Simple) ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant useEmojiPicker
  participant CannedResponsesComposer
  participant emoji.list
  participant onChange
  useEmojiPicker->>CannedResponsesComposer: selected emojiName
  CannedResponsesComposer->>emoji.list: look up emoji metadata
  emoji.list-->>CannedResponsesComposer: Unicode or missing Unicode
  CannedResponsesComposer->>onChange: insert Unicode or :name: with trailing space
Loading

Possibly related PRs

Suggested labels: type: bug

Suggested reviewers: tassoevan, 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 describes the regression being fixed and matches the canned response emoji shortcode issue in the changeset.
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-2468: 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.

@nazabucciarelli
nazabucciarelli marked this pull request as ready for review July 24, 2026 22:13
@nazabucciarelli
nazabucciarelli requested a review from a team as a code owner July 24, 2026 22:13
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.65%. Comparing base (fcf244e) to head (e10b25e).

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           release-8.7.0   #41558      +/-   ##
=================================================
+ Coverage          68.61%   68.65%   +0.03%     
=================================================
  Files               4138     4138              
  Lines             159416   159421       +5     
  Branches           28206    28160      -46     
=================================================
+ Hits              109384   109451      +67     
+ Misses             44893    44842      -51     
+ Partials            5139     5128      -11     
Flag Coverage Δ
e2e 58.95% <25.00%> (+0.09%) ⬆️
e2e-api 45.34% <ø> (-0.29%) ⬇️
unit 70.65% <100.00%> (+0.08%) ⬆️

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.

@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 2 files

Re-trigger cubic

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.

1 participant