regression: quick-reaction emojis rendered larger on message toolbar - #41535
Conversation
|
Looks like this PR is ready to merge! 🎉 |
|
WalkthroughEmojiElement now applies a component-scoped smaller font size to the rendered emoji when its ChangesEmoji rendering
Estimated code review effort: 2 (Simple) | ~5 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 (1)
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 #41535 +/- ##
=================================================
- Coverage 68.59% 68.59% -0.01%
=================================================
Files 4138 4138
Lines 159415 159415
Branches 28188 28174 -14
=================================================
- Hits 109351 109344 -7
Misses 44934 44934
- Partials 5130 5137 +7
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
7e155b2 to
ffc3ba6
Compare
Co-authored-by: Kevin Aleman <kevin.aleman@rocket.chat>
ffc3ba6 to
c7bbb92
Compare
There was a problem hiding this comment.
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/client/views/composer/EmojiPicker/EmojiElement.tsx`:
- Line 32: Update the EmojiElement props handling to destructure the
caller-provided className and explicitly combine it with smallEmojiClass when
small is enabled. Ensure the merged class is applied after spreading the
remaining props so caller classes are preserved without overriding the small
emoji styling.
🪄 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: cff317fc-d140-49ab-8294-7f3cbad3538a
📒 Files selected for processing (1)
apps/meteor/client/views/composer/EmojiPicker/EmojiElement.tsx
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
- GitHub Check: cubic · AI code reviewer
- GitHub Check: Hacktron Security Check
- GitHub Check: 📦 Build Packages
- 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/client/views/composer/EmojiPicker/EmojiElement.tsx
🧠 Learnings (2)
📚 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/composer/EmojiPicker/EmojiElement.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/composer/EmojiPicker/EmojiElement.tsx
🔇 Additional comments (1)
apps/meteor/client/views/composer/EmojiPicker/EmojiElement.tsx (1)
1-1: LGTM!Also applies to: 15-19
|
|
||
| return ( | ||
| <IconButton | ||
| {...(small && { className: smallEmojiClass })} |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
file="apps/meteor/client/views/composer/EmojiPicker/EmojiElement.tsx"
if [ -f "$file" ]; then
echo "== file exists =="
wc -l "$file"
echo "== outline =="
ast-grep outline "$file" || true
echo "== relevant source =="
sed -n '1,140p' "$file" | cat -n
else
echo "file not found: $file"
echo "candidate files:"
fd -i 'EmojiElement\.tsx$|EmojiPicker' .
fi
echo "== search EmojiElement usages =="
rg -n "EmojiElement|EmojiPicker|smallEmojiClass|smallEmoji" . --glob '*.{ts,tsx,js}' || trueRepository: RocketChat/Rocket.Chat
Length of output: 30602
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
node - <<'JS'
const smallEmojiClass = 'smallEmojiClass';
const createProps = ({ className, onClick = () => {}, small }) => {
const props = {};
if (className) props.className = className;
if (onClick) props.onClick = onClick;
const { emoji, image, ...rest } = props;
return (
small && { className: smallEmojiClass },
rest
);
};
console.log(JSON.stringify(createProps({ className: 'caller-class', small: true }), null, 2));
console.log(JSON.stringify(createProps({ className: 'another-class other-class', small: true }), null, 2));
console.log(JSON.stringify(createProps({ small: true }), null, 2));
JSRepository: RocketChat/Rocket.Chat
Length of output: 244
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "== Fusion IconButton declarations/usages =="
rg -n "function IconButton|const IconButton|export .*IconButton|IconButton" packages apps --glob '*.{ts,tsx,js}' -g '!*emoji/EmojiElement*' | head -200
echo "== likely fuselage source candidates =="
fd -i 'IconButton' packages apps .Repository: RocketChat/Rocket.Chat
Length of output: 29497
Merge the generated class with caller-provided className.
Spreading {...props} after small && { className: smallEmojiClass } lets a passed className overwrite smallEmojiClass, so small can fail to apply the 1.125rem emoji size. Destructure className and explicitly merge both classes.
🤖 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/client/views/composer/EmojiPicker/EmojiElement.tsx` at line 32,
Update the EmojiElement props handling to destructure the caller-provided
className and explicitly combine it with smallEmojiClass when small is enabled.
Ensure the merged class is applied after spreading the remaining props so caller
classes are preserved without overriding the small emoji styling.
| .emoji { | ||
| font-size: 1.125rem; | ||
| } | ||
| `; |
There was a problem hiding this comment.
Just curious, do you think we should also have one for custom emojis?
.emoji--custom {
width: 1.125rem;
height: 1.125rem;
}
There was a problem hiding this comment.
Oh yeah, maybe we gonna need that 😫
…41535) Co-authored-by: Douglas Fabris <devfabris@gmail.com>
Proposed changes (including videos or screenshots)
Since #39411 (native emoji renderer), quick-reaction emojis on the message toolbar render at 1.375rem instead of 1.125rem.
#39411 removed the
small-variant css-in-js override inEmojiElement(width/height: 1.125rem) and replaced sprite sizing with a single global rule.rcx-button .emoji { font-size: 1.375rem }, which also hits the small IconButtons on the toolbar.This restores the small-variant sizing in the new font-size scheme, scoped to small icon buttons (
.rcx-button--small-square), covering custom emojis as well. Emoji picker (medium buttons), message body emojis and reaction pills are unaffected.Steps to test or reproduce
Further comments
https://rocketchat.atlassian.net/browse/CORE-2461
Summary by CodeRabbit