Skip to content

Conversation

@josefinalliende
Copy link
Collaborator

@josefinalliende josefinalliende commented Jan 23, 2026

Description

We wanted to add an emoji picker as the white noise app did. Also, the message menu was not really a widget but a whole screen that now needs to handle more than just a modal. So besides adding the emoji picker logic, in this PR the widget is moved to screens and renamed to MessageActionsScreen

Short video of reaction using emoji picker:

custom-reaction.MP4

Emoji picker icons changes

whitenoise sloth
whitenoise sloth

⚠️ When testing this feature I found a bug related to reactions not working to some specific emojis. Wrote the issue on the rust crate 🦀 marmot-protocol/whitenoise-rs#457

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore
  • 🧪 Tests

Checklist

  • Run just precommit to ensure that formatting and linting are correct
  • Updated the CHANGELOG.md file with your changes (if they affect the user experience)

Summary by CodeRabbit

  • New Features

    • Emoji picker for selecting reaction emojis with customizable category tabs (recent, smileys, animals, foods, activities, travel, objects, symbols, flags)
    • 9 new icons available: apple, bee bat, building, face satisfied, flag, hashtag, idea, running, time
  • UI/UX Improvements

    • Redesigned message actions interface with improved reactions, emoji picker integration, and automatic input unfocus after actions
  • Tests

    • Updated and expanded tests covering message actions and emoji-picker interactions

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

Walkthrough

Replaces WnMessageMenu with a new MessageActionsScreen/MessageActionsModal, adds WnEmojiPicker and emoji_picker_flutter dependency, extends WnIcons, registers the plugin on desktop platforms, and updates tests and chat screen invocation to await and unfocus after the actions screen.

Changes

Cohort / File(s) Summary
Message actions UI
lib/screens/message_actions_screen.dart, lib/screens/chat_screen.dart
New public MessageActionsScreen (HookWidget) with static show(...) and internal MessageActionsModal. Replaces WnMessageMenu usage; chat_screen.showMessageMenu signature became Future<void> and now awaits MessageActionsScreen.show. Adds unfocus step after closing.
Emoji picker widget & tests
lib/widgets/wn_emoji_picker.dart, test/widgets/wn_emoji_picker_test.dart
New WnEmojiPicker widget wrapping emoji_picker_flutter with custom category bar (9 categories), onClose and onEmojiSelected callbacks; new comprehensive widget tests.
Tests for message actions
test/screens/chat_screen_test.dart, test/screens/message_actions_screen_test.dart
Tests updated to use MessageActionsScreen/MessageActionsModal, added scenarios for emoji picker, open/close behavior, and input unfocus.
Icon additions
lib/widgets/wn_icon.dart
Added WnIcons entries: apple, beeBat, building, faceSatisfied, flag, hashtag, idea, running, time.
Dependency & plugin registration
pubspec.yaml, linux/...generated_plugin_registrant.cc, linux/...generated_plugins.cmake, macos/Flutter/GeneratedPluginRegistrant.swift, windows/...generated_plugin_registrant.cc, windows/...generated_plugins.cmake`
Added emoji_picker_flutter: ^4.4.0; registered EmojiPickerFlutterPlugin for Linux, macOS, and Windows (and added related cmake entries). Also added shared_preferences registration on macOS.
Changelog
CHANGELOG.md
Added "Emoji picker for reactions" entry under Unreleased (PR #81).

Sequence Diagram

sequenceDiagram
    participant User
    participant ChatScreen
    participant MessageActionsScreen
    participant MessageActionsModal
    participant WnEmojiPicker
    participant MessageService

    User->>ChatScreen: Long-press message
    ChatScreen->>MessageActionsScreen: MessageActionsScreen.show(message, ...)
    MessageActionsScreen->>MessageActionsModal: build & present modal
    MessageActionsModal-->>User: show message, reactions, emoji button

    alt open emoji picker
        User->>MessageActionsModal: tap emoji picker
        MessageActionsModal->>WnEmojiPicker: show picker
        User->>WnEmojiPicker: select emoji
        WnEmojiPicker->>MessageActionsModal: onEmojiSelected(emoji)
        MessageActionsModal->>MessageService: onReaction(emoji)
        MessageActionsModal->>ChatScreen: pop modal
        ChatScreen->>ChatScreen: unfocus input
    else delete message
        User->>MessageActionsModal: tap delete
        MessageActionsModal->>MessageService: onDelete()
        MessageActionsModal->>ChatScreen: pop modal
        ChatScreen->>ChatScreen: unfocus input
    else close
        User->>MessageActionsModal: tap close
        MessageActionsModal->>ChatScreen: pop modal
        ChatScreen->>ChatScreen: unfocus input
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Suggested reviewers

  • erskingardner
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Emoji picker for reactions' directly and clearly describes the primary feature addition in the PR—an emoji picker widget for selecting reactions on messages.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

@github-actions
Copy link

❌ Coverage: 99.6% → 97.85% (-1.75%)

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@lib/screens/message_actions_screen.dart`:
- Around line 64-118: The Delete button is currently shown for own messages even
when the optional onDelete callback is null; update the prop passed to
MessageActionsModal so onDelete is only provided when both isOwnMessage and
onDelete != null (i.e., change the onDelete argument from onDelete: isOwnMessage
? handleDelete : null to onDelete: (isOwnMessage && onDelete != null) ?
handleDelete : null) so the modal only renders a delete action when a real
handler exists; ensure references are to the existing handleDelete function and
the MessageActionsModal's onDelete prop.

@josefinalliende josefinalliende changed the title Feat/emoji picker Emoji picker for message reactions Jan 26, 2026
@github-actions
Copy link

✅ Coverage: 99.6% → 99.61% (+0.01%)

Copy link

@coderabbitai coderabbitai bot left a 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/screens/chat_screen_test.dart (1)

557-569: Minor typo in test description.

The test description has a typo: "close messages actions" should be "closes message actions".

Suggested fix
-        testWidgets('close messages actions after deletion', (tester) async {
+        testWidgets('closes message actions after deletion', (tester) async {
🤖 Fix all issues with AI agents
In `@lib/screens/message_actions_screen.dart`:
- Around line 476-479: The icon mapping for Category.ACTIVITIES and
Category.TRAVEL is reversed; update the return values in the switch handling (in
message_actions_screen.dart where Category.ACTIVITIES and Category.TRAVEL are
matched) so ACTIVITIES returns WnIcon(WnIcons.running, color: color, size: size)
and TRAVEL returns WnIcon(WnIcons.building, color: color, size: size); adjust
the two case branches (the switch/method that builds these icons) accordingly
and run a quick UI check to confirm the icons now match their categories.

In `@test/screens/message_actions_screen_test.dart`:
- Around line 850-895: The mountCategoryBar helper duplicates the widget setup
used by mountShowTest—extract the shared TestWidget scaffold into a new helper
in test_helpers.dart (e.g., buildTestApp or mountTestScaffold) that constructs
ScreenUtilInit, MaterialApp, DefaultTabController, and accepts parameters like
PageController, CategoryViewBuilder, EmojiViewState or a callback to build it;
update mountCategoryBar and mountShowTest to call this new helper and pass only
the differing pieces (customCategoryView, emojiConfig, onTabController, pc) so
the common setup is centralized and reused.

@josefinalliende josefinalliende changed the title Emoji picker for message reactions Emoji picker for reactions Jan 26, 2026
@github-actions
Copy link

✅ Coverage: 99.6% → 99.61% (+0.01%)

@josefinalliende josefinalliende marked this pull request as ready for review January 26, 2026 02:12
Copy link
Member

@untreu2 untreu2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The feature works great - left a few comments about the code.

return WnIcon(WnIcons.flag, color: color, size: size);
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I think we should modularize this - could split into separate widgets I mean.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was doubting if to move the emoji picker to its own widget or not cause it's only used in this screen but it was getting bigger. I'll move it.

@github-actions
Copy link

✅ Coverage: 99.62% → 99.63% (+0.01%)

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@test/screens/message_actions_screen_test.dart`:
- Around line 689-753: Add an end-to-end widget test that verifies selecting an
emoji from the picker invokes the provided onReaction callback and closes the
MessageActionsScreen: reuse the openEmojiPicker helper to open the picker (which
taps the widget keyed 'emoji_picker_button' and shows MessageActionsScreen via
MessageActionsScreen.show), provide an onReaction that captures the emoji
string, simulate tapping an emoji widget (e.g., find.text('😀') or the emoji
tile used by the picker), pumpAndSettle, then assert the captured emoji equals
the expected value and that the menu is closed (e.g., expect(find.text('Message
actions'), findsNothing) and that the 'emoji_picker_close_button' is not found).

@github-actions
Copy link

✅ Coverage: 99.62% → 99.63% (+0.01%)

Copy link
Member

@untreu2 untreu2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅🤌🏼

@josefinalliende josefinalliende merged commit e55e2f3 into master Jan 26, 2026
4 checks passed
@josefinalliende josefinalliende deleted the feat/emoji-picker branch January 26, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants