feat(dm): wire full emoji picker for custom reactions#4711
Conversation
This comment has been minimized.
This comment has been minimized.
hm21
left a comment
There was a problem hiding this comment.
@realmeylisdev LGTM, but I’m wondering if we should just use a basic emoji picker for now instead of removing it temporarily. I don’t think it would have much negative impact on the design, while the usability benefit could be pretty valuable.
We already use thepro_image_editor package for the editor, and it actually includes an emoji picker out of the box. Below is a quick example. WDYT?
EmojiLayer? layer = await showModalBottomSheet(
context: context,
isScrollControlled: true,
useSafeArea: true,
builder: (BuildContext context) => SafeArea(
child: ConstrainedBox(
constraints: BoxConstraints(
maxHeight: 300 + MediaQuery.viewInsetsOf(context).bottom,
),
child: EmojiEditor(),
),
),
);
realmeylisdev
left a comment
There was a problem hiding this comment.
Review: Approve-with-comments (non-blocking).
The change is correct and safe: it does exactly what it claims, all CI is green, the public show() API is unchanged, and the tests were updated honestly to match. The inline notes below are code-health / process items, not correctness blockers.
Note: I'm authenticated here as the PR author, and GitHub doesn't allow approving your own PR — so this is submitted as a Comment review. The formal Approve needs to come from a second reviewer (e.g. @hm21).
Two things worth resolving before merge:
- The preserved
openFullPickerseam is now unreachable dead code, and itsTODO(#4633)breadcrumbs point at a closed issue (#4633) — with #4710 closing on merge, restoration ends up tracked by nothing. Either drop the seam (it's ~4 trivial lines to reshape back later) or repoint the TODOs at a live issue. See inline. - Strategic (from @hm21):
pro_image_editoris already a direct dependency and exports a standaloneEmojiEditorthat popsEmojiLayer(emoji: ...). A picked emoji flows through the existingConversationReactionToggledpath unchanged — no new dependency, no repository/protocol work (the NIP-17 wrapped-reaction plumbing from #4633 already accepts arbitrary emoji). If there's product appetite, wiring the picker now may beat a deferral. Doesn't block this PR.
The "+" affordance in the DM reaction long-press row returned ReactionPickerResult(openFullPicker: true) into a no-op caller stub — tapping it dismissed the sheet and did nothing (#4710). Wire it to pro_image_editor's built-in EmojiEditor (already a direct dependency for the video editor) via a new FullReactionEmojiPickerSheet, shown as a Divine dark-styled bottom sheet. The picked emoji flows through the existing ConversationReactionToggled path unchanged — no new dependency and no repository/protocol work, since the NIP-17 wrapped-reaction plumbing already accepts arbitrary emoji. This supersedes the earlier "temporarily remove the + button" approach per review on #4711, and clears the dead openFullPicker seam and the stale TODO(#4633) breadcrumbs by making the path live. Closes #4710
41ce1ab to
92b51b3
Compare
|
Went with @hm21's suggestion — wired up Making the path live resolves the three self-review threads by construction:
The branch was force-pushed (rebased on fresh |
This comment has been minimized.
This comment has been minimized.
|
@hm21 this is ready for a formal review when you have a moment. ✅ All CI green ( It's the version that wires up your Heads-up on the earlier red |
hm21
left a comment
There was a problem hiding this comment.
Thanks @realmeylisdev for the update, love to see it include now the emoji-picker from my package ;)
I left some small comments for some details but in general it looks good already.
| /// Dark-mode editor configuration. Matches the picker grid background to | ||
| /// the surrounding sheet so the surface reads as a single dark panel. | ||
| static const _editorConfigs = ProImageEditorConfigs( | ||
| emojiEditor: EmojiEditorConfigs( |
There was a problem hiding this comment.
we should also ensure the categories are translated. You can do that in this configs like below
i18n: I18n(
emojiEditor: I18nEmojiEditor(
categoryActivities: '...',
)
),There was a problem hiding this comment.
Done in 92e9e79. Wired I18nEmojiEditor to context.l10n through a @visibleForTesting buildI18n(AppLocalizations) helper — added 10 ARB keys (9 category titles + the search hint) and translated them across all 18 locales. Went the l10n route rather than inline strings because Divine's rules don't allow hardcoded English in widgets, and I18nEmojiEditor defaults to English. A unit test asserts the label mapping and that it follows the active locale (en vs de).
| style: EmojiEditorStyle( | ||
| backgroundColor: VineTheme.surfaceBackground, | ||
| ), |
There was a problem hiding this comment.
I would recommend adding this style configs too
EmojiEditorStyle(
backgroundColor: VineTheme.surfaceBackground,
searchViewConfig: SearchViewConfig(
backgroundColor: VineTheme.surfaceBackground,
buttonIconColor: VineTheme.onSurface,
),
bottomActionBarConfig: BottomActionBarConfig(
backgroundColor: VineTheme.surfaceBackground,
buttonColor: VineTheme.surfaceBackground,
showBackspaceButton: false,
),
categoryViewConfig: CategoryViewConfig(
backgroundColor: VineTheme.surfaceBackground,
),
emojiViewConfig: EmojiViewConfig(
backgroundColor: VineTheme.surfaceBackground,
),
),There was a problem hiding this comment.
Done in 92e9e79. Added all four sub-configs — searchViewConfig, bottomActionBarConfig, categoryViewConfig, emojiViewConfig — on VineTheme.surfaceBackground, with buttonIconColor: VineTheme.onSurface and showBackspaceButton: false. Good catch: those three view configs default to light grey (0xFFEBEFF2) when null, so the search/category/grid surfaces were visibly off against the dark sheet. This pulls the secondary-bar theming I'd originally marked out-of-scope back into the PR.
The "+" affordance in the DM reaction long-press row returned ReactionPickerResult(openFullPicker: true) into a no-op caller stub — tapping it dismissed the sheet and did nothing (#4710). Wire it to pro_image_editor's built-in EmojiEditor (already a direct dependency for the video editor) via a new FullReactionEmojiPickerSheet, shown as a Divine dark-styled bottom sheet. The picked emoji flows through the existing ConversationReactionToggled path unchanged — no new dependency and no repository/protocol work, since the NIP-17 wrapped-reaction plumbing already accepts arbitrary emoji. This supersedes the earlier "temporarily remove the + button" approach per review on #4711, and clears the dead openFullPicker seam and the stale TODO(#4633) breadcrumbs by making the path live. Closes #4710
Address @hm21's review on #4711: - Localize the picker's category / search labels via I18nEmojiEditor, wired to context.l10n. pro_image_editor defaults these to hardcoded English; add 10 ARB keys (9 categories + search hint) with real translations across all 18 locales. - Dark-theme every picker sub-surface (search bar, category bar, emoji grid, bottom action bar) with VineTheme.surfaceBackground. The package defaults searchView/categoryView/emojiView to light grey, which stood out against the dark sheet. - Present via VineBottomSheet instead of a raw showModalBottomSheet so the sheet inherits Divine chrome (rounded corners, drag handle, surface color). Fixed mode preserves the ~320px height and avoids nesting EmojiEditor's internal scroll inside a draggable sheet. Adds a @VisibleForTesting buildI18n covered by a unit test that asserts the label mapping and locale sensitivity.
92b51b3 to
92e9e79
Compare
|
@hm21 thanks for the review — all three are addressed in 92e9e79:
|
Mobile PR PreviewPreview refreshed for Last refresh:
|




Description
The + button in the DM reaction long-press row was intended to open a full emoji picker, but its caller handler was a no-op stub (
TODO(#4633)): tapping it just dismissed the sheet and did nothing (#4710). Per @hm21's review, this PR wires it up rather than removing it.FullReactionEmojiPickerSheet— a Divine dark-styled bottom sheet wrappingpro_image_editor's built-inEmojiEditor, which is already a direct dependency for the video editor. No new picker package.conversation_view._onMessageLongPressnow opens the picker on + and dispatches the picked emoji through the existingConversationReactionToggledpath (extracted a shared_toggleReactionhelper used by both the quick row and the full picker).This supersedes the earlier "temporarily remove the + button" approach. Making the path live also clears the dead
openFullPickerseam, the staleTODO(#4633)breadcrumbs (that issue is closed), and re-uses the previously-orphaneddmReactionAddCustomA11yLabelARB key — resolving all three self-review threads by construction.Out of Scope
pro_image_editorversions. The picker-opens and dismiss→null paths are tested; the final dispatch hop reuses the (tested) quick-reaction_toggleReactionhelper.Verification
flutter analyze lib test integration_test— No issues founddart format <changed files>— clean (0 changed)flutter test test/screens/inbox/conversation/— 119/119 passing, including:full_reaction_emoji_picker_sheet_test.dart(picker mounts; dismiss → null)reaction_picker_overlay_test.dart(+ popsopenFullPicker: true)conversation_view_test.dartcase (long-press → + →EmojiEditoropens)Type of Change
Related Issue: Closes #4710 — completes the full-picker integration deferred by #4633