regression: combined picker emojis split into separate symbols - #41534
Conversation
|
Looks like this PR is ready to merge! 🎉 |
|
WalkthroughThe emoji PEG grammar recognizes additional Unicode emoji sequences and refined symbol ranges. A generated emojibase fixture validates parser coverage, while native emoji data now resolves bare Unicode aliases alongside VS16-qualified forms. ChangesEmoji parsing and native rendering
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (2)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-8.7.0 #41534 +/- ##
=================================================
+ Coverage 68.61% 68.67% +0.06%
=================================================
Files 4138 4139 +1
Lines 159416 159678 +262
Branches 28206 28313 +107
=================================================
+ Hits 109384 109662 +278
+ Misses 44893 44871 -22
- Partials 5139 5145 +6
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
4636296 to
e7d1a1d
Compare
e7d1a1d to
0c05727
Compare
There was a problem hiding this comment.
Review completed against the latest diff
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
1c4e7c1 to
e40fb3e
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@packages/message-parser/src/grammar.pegjs`:
- Line 837: Update UnicodeEmojiTransportAndMapSymbols to exclude the reserved
U+1F6ED–U+1F6EF code points instead of accepting the entire surrogate range,
using explicit emoji-data ranges or a generated whitelist. Add parser coverage
confirming reserved values are rejected while valid transport/map emoji continue
to parse.
- Around line 848-855: Update the Unicode emoji grammar near
UnicodeEmojiTextPresentation to recognize bare ⭐ (U+2B50) and ⭕ (U+2B55) as
emoji-default characters, while preserving the existing VS16-required handling
for other text-presentation characters.
- Line 824: Restrict the standalone arrow grammar rule to arrows with required
VS16, rather than allowing the broad UnicodeEmojiArrows rule to match bare
text-default arrows. Preserve UnicodeEmojiArrows for UnicodeEmojiZwjComponent so
arrows remain valid within ZWJ sequences, while standalone ↔ and ↕ require VS16.
🪄 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: 1de64390-008c-443d-92b6-26a6b8ccd732
📒 Files selected for processing (8)
apps/meteor/app/emoji-native/lib/generateEmojiData.tsapps/meteor/app/emoji-native/lib/getEmojiConfig.spec.tsapps/meteor/app/emoji-native/lib/getEmojiConfig.tspackages/message-parser/src/grammar.pegjspackages/message-parser/tests/emoji.test.tspackages/message-parser/tests/fixtures/allEmoji.tsscripts/emoji/README.mdscripts/emoji/generateEmojiFixture.mjs
🚧 Files skipped from review as they are similar to previous changes (4)
- packages/message-parser/tests/emoji.test.ts
- scripts/emoji/README.md
- packages/message-parser/tests/fixtures/allEmoji.ts
- scripts/emoji/generateEmojiFixture.mjs
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
- GitHub Check: 📦 Build Packages
- 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-native/lib/getEmojiConfig.spec.tsapps/meteor/app/emoji-native/lib/getEmojiConfig.tsapps/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.tsextension for test files (e.g.,login.spec.ts)
Files:
apps/meteor/app/emoji-native/lib/getEmojiConfig.spec.ts
🧠 Learnings (6)
📚 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
📚 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.tsapps/meteor/app/emoji-native/lib/getEmojiConfig.tsapps/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.tsapps/meteor/app/emoji-native/lib/getEmojiConfig.tsapps/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
📚 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.tsapps/meteor/app/emoji-native/lib/getEmojiConfig.tsapps/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.tsapps/meteor/app/emoji-native/lib/getEmojiConfig.tsapps/meteor/app/emoji-native/lib/generateEmojiData.ts
🔇 Additional comments (4)
packages/message-parser/src/grammar.pegjs (1)
798-798: LGTM!Also applies to: 808-812, 828-833, 858-859
apps/meteor/app/emoji-native/lib/generateEmojiData.ts (1)
19-19: LGTM!Also applies to: 59-61, 75-75, 77-78, 92-95, 118-118, 138-138
apps/meteor/app/emoji-native/lib/getEmojiConfig.ts (1)
27-27: LGTM!Also applies to: 36-41
apps/meteor/app/emoji-native/lib/getEmojiConfig.spec.ts (1)
55-77: LGTM!
Proposed changes (including videos or screenshots)
@rocket.chat/message-parserrecognizes emojis via hand-maintained Unicode block rules, and several classes weren't covered — so they were split into pieces (🚶♀️ → 🚶 + ♀️) or left as text, and didn't enlarge when sent alone. CORE-2466 reported the "facing right" combined emojis, but the gap was wider.This extends the grammar to recognize combined/ZWJ sequences, keycaps, geometric squares, squared badges, and variation-selector (VS16) forms — every emoji🅰️ Ⓜ️ ) are supported.
emojibase-dataships (283 → 0), guarded by a coverage test. Text-default symbols (©, ™, ▶) require their VS16, so bare punctuation stays text. The only exclusions are the 26 regional indicators — flag-building letters that form a flag only in a pair (🇺 + 🇸 = 🇺🇸); real letter emojis (Issue(s)
Steps to test or reproduce
Send each emoji in a message (paste, or pick from the emoji picker). Each should render as a single emoji and enlarge when sent alone.
Combined / ZWJ sequences: 🚶♀️ 🚶♂️ 🚶➡️ 🚶♀️➡️ 🚶♂️➡️ 🚣♀️ 🚴♂️ 🚵♀️ 🙂↔️ 🙂↕️ 🧑🚀 👨🚒 🐈⬛ 🐦⬛ 🍋🟩 🍄🟫
Geometric squares / circles: 🟠 🟡 🟢 🟣 🟤 🟥 🟦 🟧 🟨 🟩 🟪 🟫 ⬛ ⬜ 🟰
Keycaps: 0️⃣ 1️⃣ 2️⃣ 3️⃣ 4️⃣ 5️⃣ 6️⃣ 7️⃣ 8️⃣ 9️⃣ #️⃣ *️⃣
Squared badges / CJK / joker: 🆎 🆑 🆒 🆓 🆔 🆕 🆖 🆗 🆘 🆙 🆚 🈁 🈶 🉐 🈹 🈲 🉑 🈸 🈴 🈳 🈺 🈵 🃏
Variation-selector (VS16) forms: ©️ ®️ ™️‼️ ⁉️ ℹ️ Ⓜ️ ▶️ ◀️ ⭐️ ⭕️ ⬆️ ⬇️ ⬅️ ↖️ ↗️ ↘️ ↙️ ↩️ ↪️ ⤴️ ⤵️ ▪️ ▫️ ◻️ ◼️ ◽️ ◾️ 〰️ 〽️ ㊗️ ㊙️ 🅰️ 🅱️ 🅾️ 🅿️ 🈂️ 🈚️ 🈯️ 🀄️ 🚇️ 🚑️ 🛳️ 🛎️ 🚹️ 🚺️ 😐️
Should still render as text (not emoji): bare © # → *, plus
*bold*and#channel.Flags still render: 🇺🇸 🇧🇷
Further comments
The coverage test sweeps a committed fixture (
tests/fixtures/allEmoji.ts) — every emojiemojibase-dataships — generated byscripts/emoji/generateEmojiFixture.mjs(see its README). It's a snapshot: after bumpingemojibase-data, re-run the script and the sweep flags any new emoji the grammar doesn't recognize.Summary by CodeRabbit