-
Notifications
You must be signed in to change notification settings - Fork 12.9k
feat: Move quick reactions out of feature preview #36966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Move quick reactions out of feature preview #36966
Conversation
🦋 Changeset detectedLatest commit: 2fc2e50 The changes in this PR will be included in the next version bump. This PR includes changesets to release 39 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Looks like this PR is ready to merge! 🎉 |
WalkthroughRemoves the quickReactions feature-preview surface and related i18n keys, always renders the first three quick reactions in the message toolbar, updates feature-preview types and tests to stop referencing Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Toolbar as MessageToolbar
participant Action as ReactionMessageAction
participant Picker as EmojiPicker
User->>Toolbar: hover message
Toolbar->>Action: render actions
Note right of Action #ffffcc: quickReactions feature-flag removed\nAlways render first 3 quick reactions
Action-->>User: show 3 quick-reaction buttons
User->>Action: click reaction
Action->>Action: toggleReaction(reaction)
alt open emoji picker
Action->>Picker: open for more reactions
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## release-8.0.0 #36966 +/- ##
=================================================
- Coverage 66.43% 65.19% -1.25%
=================================================
Files 3276 3273 -3
Lines 109596 110744 +1148
Branches 20860 20711 -149
=================================================
- Hits 72814 72197 -617
- Misses 34116 36037 +1921
+ Partials 2666 2510 -156
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (6)
.changeset/purple-mayflies-approve.md (2)
7-7: Expand the release note with explicit BREAKING changes and migration steps.Downstream consumers will miss why majors occurred. Recommend a clearer note.
-Move quick reactions out of feature preview. +BREAKING: Quick Reactions no longer uses Feature Preview + +- Removes 'quickReactions' from Feature Preview (client UI and types). +- Removes i18n keys: Quick_reactions, Quick_reactions_description (all locales). +- Reaction toolbar now shows quick reactions unconditionally. +- Tests and code using useFeaturePreview('quickReactions') must migrate. + +Migration: +- Replace any `useFeaturePreview('quickReactions')` and conditional rendering with the new default behavior. +- Remove usage of removed i18n keys; no replacement is needed because the feature is no longer configurable. +- If your app persisted userPreferences.featuresPreview entries for 'quickReactions', they are now ignored and may be cleaned up.
7-7: Consider adding a small cleanup migration for stale user preferences.Optional but nice: remove
featuresPreview.name === 'quickReactions'entries from user documents to reduce clutter.Example Mongo migration (for your migrations framework):
// Pseudocode: remove quickReactions from featuresPreview array on all users db.users.updateMany( { 'settings.preferences.featuresPreview.name': 'quickReactions' }, [ { $set: { 'settings.preferences.featuresPreview': { $filter: { input: '$settings.preferences.featuresPreview', as: 'fp', cond: { $ne: ['$$fp.name', 'quickReactions'] }, }, }, }, }, ], );packages/ui-client/src/components/FeaturePreview/FeaturePreview.spec.tsx (1)
6-6: Tighten test names and drop unnecessary async.Minor polish: clearer names and no async when nothing is awaited.
-test('should renders off if the feature is disabled', async () => { +test('renders "off" when feature preview is allowed but newNavigation is not enabled', () => { @@ -test('should renders on if the feature is enabled', async () => { +test('renders "on" when newNavigation is enabled in user preferences', () => {Optionally make the first test explicit about the absence of the flag:
// inside the first test render options wrapper: mockAppRoot() .withSetting('Accounts_AllowFeaturePreview', true) .withUserPreference('featuresPreview', []) .build();Also applies to: 20-20
apps/meteor/client/components/message/toolbar/items/actions/ReactionMessageAction.tsx (1)
44-51: Harden toggleReaction: handle endpoint errors and memoize.Avoid unhandled promise rejections and reduce re-renders from new function instances on each render.
Example change:
- const toggleReaction = (emoji: string) => { - setReaction({ - emoji: `:${emoji}:`, - messageId: message._id, - }); - addRecentEmoji(emoji); - }; + const toggleReaction = useCallback((emoji: string) => { + void setReaction({ emoji: `:${emoji}:`, messageId: message._id }).catch(() => { + // optionally log or surface a toast + }); + addRecentEmoji(emoji); + }, [setReaction, addRecentEmoji, message._id]);packages/ui-client/src/hooks/useFeaturePreview.spec.tsx (1)
16-20: Fix test setup to match its description (and remove the TODO).The test name says "featurePreviewEnabled is true but feature is not in userPreferences," but it sets the setting to false and includes the feature. Update setup as below.
- wrapper: mockAppRoot() - .withSetting('Accounts_AllowFeaturePreview', false) - .withUserPreference('featuresPreview', [{ name: 'newNavigation', value: true }]) - .build(), + wrapper: mockAppRoot() + .withSetting('Accounts_AllowFeaturePreview', true) + .withUserPreference('featuresPreview', []) + .build(),packages/ui-client/src/hooks/useFeaturePreviewList.ts (1)
3-3: Prevent drift: derive FeaturesAvailable from the source of truth.Now that 'quickReactions' is removed, consider deriving the union from defaultFeaturesPreview to avoid future mismatches.
For example:
// Define first, as a const, without relying on FeaturesAvailable export const defaultFeaturesPreview = [ /* ... */ ] as const; // Then derive the union export type FeaturesAvailable = (typeof defaultFeaturesPreview)[number]['name'];Also, ensure we clean up persisted 'quickReactions' entries in user preferences/settings to avoid orphaned data in payloads/UI.
I can draft a small migration to strip 'quickReactions' from featuresPreview in user prefs and any admin settings.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
apps/meteor/public/images/featurePreview/quick-reactions.pngis excluded by!**/*.png
📒 Files selected for processing (11)
.changeset/purple-mayflies-approve.md(1 hunks)apps/meteor/client/components/message/toolbar/items/actions/ReactionMessageAction.tsx(1 hunks)packages/i18n/src/locales/en.i18n.json(1 hunks)packages/i18n/src/locales/hi-IN.i18n.json(0 hunks)packages/i18n/src/locales/nb.i18n.json(0 hunks)packages/i18n/src/locales/nn.i18n.json(0 hunks)packages/i18n/src/locales/pt-BR.i18n.json(0 hunks)packages/i18n/src/locales/sv.i18n.json(0 hunks)packages/ui-client/src/components/FeaturePreview/FeaturePreview.spec.tsx(2 hunks)packages/ui-client/src/hooks/useFeaturePreview.spec.tsx(2 hunks)packages/ui-client/src/hooks/useFeaturePreviewList.ts(1 hunks)
💤 Files with no reviewable changes (5)
- packages/i18n/src/locales/pt-BR.i18n.json
- packages/i18n/src/locales/nb.i18n.json
- packages/i18n/src/locales/nn.i18n.json
- packages/i18n/src/locales/sv.i18n.json
- packages/i18n/src/locales/hi-IN.i18n.json
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use descriptive test names that clearly communicate expected behavior
Applied to files:
packages/ui-client/src/components/FeaturePreview/FeaturePreview.spec.tsxpackages/ui-client/src/hooks/useFeaturePreview.spec.tsx
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (test, page, expect) consistently
Applied to files:
packages/ui-client/src/components/FeaturePreview/FeaturePreview.spec.tsx
🔇 Additional comments (5)
.changeset/purple-mayflies-approve.md (1)
1-5: Approve — major bumps appropriate; verify peer/dep ranges
Scan of repository package.json files found no references to @rocket.chat/ui-client, @rocket.chat/i18n, or @rocket.chat/meteor; double-check workspace/peer dependency ranges and external consumers to avoid inconsistent installs.packages/i18n/src/locales/en.i18n.json (2)
2248-2248: LGTM: non-semantic copy tweak onlyNo behavioral impact. Safe to merge.
2248-2248: No dangling Quick_reactions i18n keys; remaining quickReactions are local state (no action required)
rg shows no Quick_reactions i18n keys in code or locales. The only matches for quickReactions are local state/context and consumers in: apps/meteor/client/providers/EmojiPickerProvider/EmojiPickerProvider.tsx, apps/meteor/client/contexts/EmojiPickerContext.ts, apps/meteor/client/components/message/toolbar/items/actions/ReactionMessageAction.tsx.apps/meteor/client/components/message/toolbar/items/actions/ReactionMessageAction.tsx (1)
54-56: Quick reactions now always-on — LGTM.Rendering the first three quick reactions unconditionally aligns with moving the feature out of preview.
packages/ui-client/src/hooks/useFeaturePreview.spec.tsx (1)
7-7: Feature key swap to 'newNavigation' — LGTM.Consistent with removing 'quickReactions' from feature preview.
Also applies to: 27-27
packages/ui-client/src/components/FeaturePreview/FeaturePreview.spec.tsx
Outdated
Show resolved
Hide resolved
packages/ui-client/src/components/FeaturePreview/FeaturePreview.spec.tsx
Outdated
Show resolved
Hide resolved
packages/ui-client/src/components/FeaturePreview/FeaturePreview.spec.tsx
Outdated
Show resolved
Hide resolved
packages/ui-client/src/components/FeaturePreview/FeaturePreview.spec.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Proposed changes (including videos or screenshots)
Move quick reactions feature outside feature preview
Issue(s)
Steps to test or reproduce
Further comments
CORE-1348
Summary by CodeRabbit
New Features
Chores