Skip to content

regression: shortcodes changed meaning - #41587

Open
cardoso wants to merge 2 commits into
release-8.7.0from
fix/CORE-2453
Open

regression: shortcodes changed meaning#41587
cardoso wants to merge 2 commits into
release-8.7.0from
fix/CORE-2453

Conversation

@cardoso

@cardoso cardoso commented Jul 27, 2026

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

Issue(s)

CORE-2453

Steps to test or reproduce

Further comments

Review in cubic

Summary by CodeRabbit

  • New Features
    • Emoji shortcode generation now resolves to JoyPixels shortcodes first, falling back to Emojibase when needed.
  • Bug Fixes
    • Fixed contested shortcode rendering and picker output when ASCII is disabled.
    • Corrected several skin-tone alias resolutions, including thumbs-up/clap variants.
    • Narrowed legacy shortcode backfill to a smaller, targeted set.
  • Tests
    • Added/updated coverage for shortcode precedence, alias hygiene, stranded emoji detection, picker/category mapping, and legacy fallback behavior.

@dionisio-bot

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

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 639c3a4

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

@cardoso cardoso added this to the 8.7.0 milestone Jul 27, 2026
@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: 8f7d90f6-8111-4a12-9906-d6473dc8badd

📥 Commits

Reviewing files that changed from the base of the PR and between 698c194 and 639c3a4.

📒 Files selected for processing (1)
  • apps/meteor/tests/e2e/messaging.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/tests/e2e/messaging.spec.ts

Walkthrough

Native emoji generation now prioritizes JoyPixels shortcodes over Emojibase fallbacks. Legacy backfills are narrowed, and tests cover contested aliases, skin-tone variants, picker mappings, rendering, search behavior, attachment input, alias ordering, and shortcode integrity.

Changes

Native emoji shortcode precedence

Layer / File(s) Summary
Shortcode merge
apps/meteor/app/emoji-native/lib/generateEmojiData.ts
getShortcodes prefers JoyPixels shortcodes and falls back to Emojibase data.
Legacy shortcode backfills
apps/meteor/app/emoji-native/lib/legacyEmojioneMap.ts, apps/meteor/app/emoji-native/lib/generateEmojiData.spec.ts
The legacy map is reduced to targeted missing emojione shortcodes, with tests covering retained and redundant entries.
Generated data validation
apps/meteor/app/emoji-native/lib/generateEmojiData.spec.ts
Tests verify contested resolution, fallback aliases, skin-tone variants, picker mappings, reachability, registration order, and alias ownership.
Consumer behavior validation
apps/meteor/app/emoji-native/lib/getEmojiConfig.spec.ts, apps/meteor/tests/unit/app/emoji/*, apps/meteor/tests/e2e/messaging.spec.ts
Tests update rendering, picker, parser, skin-tone alias, search, and attachment emoji expectations.

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

Sequence Diagram(s)

sequenceDiagram
  participant EmojiRenderer
  participant EmojiDataGenerator
  participant JoyPixels
  participant Emojibase
  EmojiRenderer->>EmojiDataGenerator: resolve shortcode
  EmojiDataGenerator->>JoyPixels: look up codepoint shortcodes
  JoyPixels-->>EmojiDataGenerator: return preferred shortcodes
  EmojiDataGenerator->>Emojibase: fall back when JoyPixels is missing
  Emojibase-->>EmojiDataGenerator: return fallback shortcodes
  EmojiDataGenerator-->>EmojiRenderer: return emoji mapping
Loading

Possibly related PRs

Suggested labels: type: bug

Suggested reviewers: 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 matches the main change: a regression in emoji shortcode resolution and precedence.
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-2453: 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.

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

🧹 Nitpick comments (1)
apps/meteor/app/emoji-native/lib/generateEmojiData.ts (1)

56-57: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the implementation comment.

The group check is self-explanatory. As per coding guidelines, “Avoid code comments in the implementation.”

🤖 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-native/lib/generateEmojiData.ts` around lines 56 - 57,
Remove the implementation comment immediately above the emojiData.group check,
while leaving the existing group filtering logic unchanged.

Source: Coding guidelines

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

Nitpick comments:
In `@apps/meteor/app/emoji-native/lib/generateEmojiData.ts`:
- Around line 56-57: Remove the implementation comment immediately above the
emojiData.group check, while leaving the existing group filtering logic
unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 526751f1-2a1a-4e43-aef9-43c07d4cc9ab

📥 Commits

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

📒 Files selected for processing (4)
  • .changeset/emoji-joypixels-shortcode-precedence.md
  • apps/meteor/app/emoji-native/lib/generateEmojiData.spec.ts
  • apps/meteor/app/emoji-native/lib/generateEmojiData.ts
  • apps/meteor/app/emoji-native/lib/getEmojiConfig.spec.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: 📦 Build Packages
  • 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/app/emoji-native/lib/getEmojiConfig.spec.ts
  • apps/meteor/app/emoji-native/lib/generateEmojiData.spec.ts
  • apps/meteor/app/emoji-native/lib/generateEmojiData.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/app/emoji-native/lib/getEmojiConfig.spec.ts
  • apps/meteor/app/emoji-native/lib/generateEmojiData.spec.ts
🧠 Learnings (7)
📚 Learning: 2026-03-16T21:50:37.589Z
Learnt from: amitb0ra
Repo: RocketChat/Rocket.Chat PR: 39676
File: .changeset/migrate-users-register-openapi.md:3-3
Timestamp: 2026-03-16T21:50:37.589Z
Learning: For changes related to OpenAPI migrations in Rocket.Chat/OpenAPI, when removing endpoint types and validators from rocket.chat/rest-typings (e.g., UserRegisterParamsPOST, /v1/users.register) document this as a minor changeset (not breaking) per RocketChat/Rocket.Chat-Open-API#150 Rule 7. Note that the endpoint type is re-exposed via a module augmentation .d.ts in the consuming package (e.g., packages/web-ui-registration/src/users-register.d.ts). In reviews, ensure the changeset clearly states: this is a non-breaking change, the major version should not be bumped, and the changeset reflects a minor version bump. Do not treat this as a breaking change during OpenAPI migrations.

Applied to files:

  • .changeset/emoji-joypixels-shortcode-precedence.md
📚 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/app/emoji-native/lib/getEmojiConfig.spec.ts
  • apps/meteor/app/emoji-native/lib/generateEmojiData.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/app/emoji-native/lib/getEmojiConfig.spec.ts
  • apps/meteor/app/emoji-native/lib/generateEmojiData.spec.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-native/lib/getEmojiConfig.spec.ts
  • apps/meteor/app/emoji-native/lib/generateEmojiData.spec.ts
  • apps/meteor/app/emoji-native/lib/generateEmojiData.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/app/emoji-native/lib/getEmojiConfig.spec.ts
  • apps/meteor/app/emoji-native/lib/generateEmojiData.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-native/lib/getEmojiConfig.spec.ts
  • apps/meteor/app/emoji-native/lib/generateEmojiData.spec.ts
  • apps/meteor/app/emoji-native/lib/generateEmojiData.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-native/lib/getEmojiConfig.spec.ts
  • apps/meteor/app/emoji-native/lib/generateEmojiData.spec.ts
  • apps/meteor/app/emoji-native/lib/generateEmojiData.ts
🔇 Additional comments (4)
apps/meteor/app/emoji-native/lib/generateEmojiData.ts (1)

4-4: LGTM!

Also applies to: 48-55, 58-93, 108-108, 118-118, 173-173

apps/meteor/app/emoji-native/lib/generateEmojiData.spec.ts (1)

1-132: LGTM!

apps/meteor/app/emoji-native/lib/getEmojiConfig.spec.ts (1)

55-71: LGTM!

.changeset/emoji-joypixels-shortcode-precedence.md (1)

1-6: LGTM!

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.37%. Comparing base (fcf244e) to head (639c3a4).
⚠️ Report is 2 commits behind head on release-8.7.0.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           release-8.7.0   #41587      +/-   ##
=================================================
- Coverage          68.61%   68.37%   -0.25%     
=================================================
  Files               4138     4138              
  Lines             159416   158030    -1386     
  Branches           28206    28173      -33     
=================================================
- Hits              109384   108048    -1336     
+ Misses             44893    44852      -41     
+ Partials            5139     5130       -9     
Flag Coverage Δ
e2e 58.86% <100.00%> (+0.01%) ⬆️
e2e-api 45.36% <ø> (-0.26%) ⬇️
unit 70.29% <100.00%> (-0.29%) ⬇️

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 4 files

Re-trigger cubic

@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

🤖 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-native/lib/generateEmojiData.ts`:
- Around line 68-75: Remove the implementation rationale comments in
generateEmojiData.ts, including the noted additional ranges, while leaving the
shortcode registration behavior and surrounding code unchanged.
🪄 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 Plus

Run ID: 60837b76-af89-4dba-8f3a-81fbb13d8b4c

📥 Commits

Reviewing files that changed from the base of the PR and between b51b638 and d3bf53e.

📒 Files selected for processing (4)
  • .changeset/emoji-joypixels-shortcode-precedence.md
  • apps/meteor/app/emoji-native/lib/generateEmojiData.spec.ts
  • apps/meteor/app/emoji-native/lib/generateEmojiData.ts
  • apps/meteor/app/emoji-native/lib/getEmojiConfig.spec.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • .changeset/emoji-joypixels-shortcode-precedence.md
  • apps/meteor/app/emoji-native/lib/generateEmojiData.spec.ts
  • apps/meteor/app/emoji-native/lib/getEmojiConfig.spec.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🧰 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-native/lib/generateEmojiData.ts
🧠 Learnings (4)
📚 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-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-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-native/lib/generateEmojiData.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-native/lib/generateEmojiData.ts
🔇 Additional comments (1)
apps/meteor/app/emoji-native/lib/generateEmojiData.ts (1)

4-4: LGTM!

Also applies to: 48-52, 76-79, 88-89, 91-91, 110-110, 116-116, 119-127, 153-156, 158-158, 161-176, 179-181

Comment thread apps/meteor/app/emoji-native/lib/generateEmojiData.ts Outdated
@cardoso
cardoso requested a review from a team as a code owner July 27, 2026 16:04
@cardoso
cardoso requested a review from a team as a code owner July 27, 2026 17:44
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