Skip to content

chore: customizability of context menu#3558

Merged
isekovanic merged 12 commits intodevelopfrom
fix/customizability-of-ctx-menu
Apr 17, 2026
Merged

chore: customizability of context menu#3558
isekovanic merged 12 commits intodevelopfrom
fix/customizability-of-ctx-menu

Conversation

@isekovanic
Copy link
Copy Markdown
Contributor

🎯 Goal

This PR introduces a MessageOverlayWrapper component so that integrations can pick which part of the Message they want to move to the contextual menu. The component handles all bookkeeping on its own and makes sure that a single measurement source (target) is active at a time.

It comes paired with a messageOverlayTargetId for the simple purpose of performance (self registration would work as well here, however I did notice that sometimes 2 layout passes had to be done before registration could be finished, in order for the other portals to unmount - causing a nasty remount on the first render and so this guards against that).

Usage:

import { MessageContent as DefaultMessageContent } from 'stream-chat-react-native';

// ...

const OverlayTargetedMessageContent = (
  props: React.ComponentProps<typeof DefaultMessageContent>,
) => (
  <MessageOverlayWrapper targetId='message-content'>
    <DefaultMessageContent {...props} />
  </MessageOverlayWrapper>
);

// ...

<WithComponents overrides={{ MessageContent: OverlayTargetedMessageContent }}>
      <Channel
       {...otherProps}
        messageOverlayTargetId='message-content'
      >
        {/* channel children */}
      </Channel>
</WithComponents>

🛠 Implementation details

🎨 UI Changes

iOS
Before After
Android
Before After

🧪 Testing

☑️ Checklist

  • I have signed the Stream CLA (required)
  • PR targets the develop branch
  • Documentation is updated
  • New code is tested in main example apps, including all possible scenarios
    • SampleApp iOS and Android
    • Expo iOS and Android

# Conflicts:
#	examples/SampleApp/src/screens/ChannelScreen.tsx
#	package/src/components/Channel/Channel.tsx
#	package/src/components/Channel/hooks/useCreateMessagesContext.ts
#	package/src/components/Message/Message.tsx
#	package/src/contexts/messagesContext/MessagesContext.tsx
@isekovanic isekovanic requested a review from oliverlaz April 17, 2026 13:29
@isekovanic isekovanic changed the title chore: customizability of ctx menu chore: customizability of context menu Apr 17, 2026
@Stream-SDK-Bot
Copy link
Copy Markdown
Contributor

Stream-SDK-Bot commented Apr 17, 2026

SDK Size

title develop branch diff status
js_bundle_size 352 KB 353 KB +311 B 🟡

@isekovanic isekovanic merged commit 7068222 into develop Apr 17, 2026
3 checks passed
@isekovanic isekovanic deleted the fix/customizability-of-ctx-menu branch April 17, 2026 13:54
@github-actions github-actions bot mentioned this pull request Apr 17, 2026
6 tasks
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.

2 participants