Close actions menu before opening mobile emoji picker and enable picker scrolling#1895
Close actions menu before opening mobile emoji picker and enable picker scrolling#1895
Conversation
Signed-off-by: prxt6529 <117092621+prxt6529@users.noreply.github.com>
📝 WalkthroughWalkthroughAdds optional props (onOpenPicker, externalOpenSignal, hideTrigger) to WaveDropActionsAddReaction, integrates a signal-based external picker opener from WaveDropMobileMenu, and adjusts mobile picker rendering/overflow and trigger rendering behavior. Mobile menu closes when opening the emoji picker via the new callback/signal. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant MobileMenu as WaveDropMobileMenu
participant ActionsVisible as WaveDropActionsAddReaction (visible)
participant ActionsHidden as WaveDropActionsAddReaction (hidden/external)
participant Picker as EmojiPicker
User->>MobileMenu: tap "reactions" (open menu)
User->>ActionsVisible: tap reaction trigger on mobile
ActionsVisible->>MobileMenu: call onOpenPicker (openEmojiPicker)
MobileMenu->>MobileMenu: closeMenu()
MobileMenu->>ActionsHidden: increment externalOpenSignal
ActionsHidden->>Picker: open picker (mobile mode)
Picker-->>User: show emoji picker (with overflow scrolling)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
Signed-off-by: prxt6529 <117092621+prxt6529@users.noreply.github.com>
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@components/waves/drops/WaveDropActionsAddReaction.tsx`:
- Around line 161-167: The useEffect that opens the picker on mobile when
externalOpenSignal changes should also short‑circuit if reactions are
disallowed; update the effect that references externalOpenSignal, isMobile and
calls setShowPicker so it checks canReact (e.g., if (!isMobile ||
externalOpenSignal === undefined || !canReact) return) and only calls
setShowPicker(true) when canReact is true, ensuring temporary/disabled drops
cannot be opened via externalOpenSignal.
- Line 298: The outside-click predicate currently requires the trigger element
(buttonRef.current) to exist, so when hideTrigger is true the handler never
closes the picker; update the predicate in the outside-click handler used by
WaveDropActionsAddReaction (check where buttonRef and pickerRef are referenced)
to allow a missing trigger by treating a null buttonRef as "outside" (e.g.,
consider it outside when !buttonRef.current) and still check pickerRef.contains
for inside clicks—i.e., change the condition to close the picker when the click
is not inside pickerRef AND (buttonRef is null OR the click is not inside
buttonRef) so the picker closes even if hideTrigger removed the button.



Motivation
MobileWrapperDialogcould not be scrolled vertically, causing poor UX on touch devices.Description
onOpenPickercallback toWaveDropActionsAddReactionand invoke it when the picker is opened on mobile viaonOpenPicker?.()to notify parents to close first.WaveDropMobileMenuto passcloseMenuasonOpenPickerso the mobile actions sheet closes before the emoji picker opens.WaveDropActionsAddReactionto usetw-overflow-y-auto(<div className="tw-flex tw-size-full tw-justify-center tw-overflow-y-auto">) so emoji categories and content can scroll vertically on mobile.Testing
npm run lint:uncommitted:tight, which failed in this environment due to missingeslint(Error: Cannot find package 'eslint').ERR_EMPTY_RESPONSEwhen requestinghttp://127.0.0.1:3001).Codex Task
Summary by CodeRabbit
New Features
Bug Fixes