From 75fbce5b88cef419563c4d8a4a7ffac48e79f870 Mon Sep 17 00:00:00 2001 From: Oliver Lazoroski Date: Sat, 21 Mar 2026 23:38:13 +0100 Subject: [PATCH 1/2] fix: resolve circular dependencies and add missing React imports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace barrel imports from MessageComposer with direct file imports to break circular dependency chains (MessageComposer → MediaRecorder → MessageComposer). Add missing React imports in Alert.tsx and QuotedMessageIndicator.tsx. Restore Preview prop on ChannelListItem lost during rename. Add JSDoc warning to useDebouncedTypingActive about the user?.id requirement. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../ChannelListItem/ChannelListItem.tsx | 7 +++- .../ChannelListItemTimestamp.tsx | 5 ++- .../ChannelListItem/ChannelListItemUI.tsx | 4 ++- src/components/Dialog/components/Alert.tsx | 2 +- .../Location/ShareLocationDialog.tsx | 2 +- .../AudioRecorderRecordingControls.tsx | 2 +- .../AudioRecordingButtonWithNotification.tsx | 2 +- .../MediaRecorder/hooks/useMediaRecorder.ts | 2 +- src/components/Message/QuotedMessage.tsx | 2 +- .../MessageActions.defaults.tsx | 23 +++++-------- .../QuotedMessageIndicator.tsx | 1 + .../MultipleAnswersField.tsx | 2 +- .../Poll/PollCreationDialog/NameField.tsx | 2 +- .../PollCreationDialog/OptionFieldSet.tsx | 2 +- .../PollCreationDialog/PollCreationDialog.tsx | 2 +- .../PollCreationDialogControls.tsx | 3 +- .../ReactFileUtilities/UploadButton.tsx | 2 +- .../SuggestionList/SuggestionList.tsx | 2 +- .../SuggestionList/SuggestionListItem.tsx | 2 +- .../TextareaComposer/TextareaComposer.tsx | 3 +- .../hooks/useTextareaPlaceholder.ts | 6 ++-- .../hooks/useDebouncedTypingActive.ts | 32 ++++++++++++++++--- 22 files changed, 68 insertions(+), 42 deletions(-) diff --git a/src/components/ChannelListItem/ChannelListItem.tsx b/src/components/ChannelListItem/ChannelListItem.tsx index 7df5158fca..a3610df4b3 100644 --- a/src/components/ChannelListItem/ChannelListItem.tsx +++ b/src/components/ChannelListItem/ChannelListItem.tsx @@ -63,6 +63,8 @@ export type ChannelListItemProps = { key?: string; /** Custom ChannelListItem click handler function */ onSelect?: (event: React.MouseEvent) => void; + /** Custom UI component to display the channel preview in the list, defaults to and accepts same props as: [ChannelListItemUI](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChannelListItem/ChannelListItemUI.tsx) */ + Preview?: React.ComponentType; /** Setter for selected Channel */ setActiveChannel?: ChatContextValue['setActiveChannel']; /** Object containing watcher parameters */ @@ -81,8 +83,11 @@ export const ChannelListItem = (props: ChannelListItemProps) => { channel, channelUpdateCount, getLatestMessagePreview = defaultGetLatestMessagePreview, + Preview, } = props; - const { ChannelListItemUI = DefaultChannelListItemUI } = useComponentContext(); + const { ChannelListItemUI: ContextChannelListItemUI = DefaultChannelListItemUI } = + useComponentContext(); + const ChannelListItemUI = Preview ?? ContextChannelListItemUI; const { channel: activeChannel, client, diff --git a/src/components/ChannelListItem/ChannelListItemTimestamp.tsx b/src/components/ChannelListItem/ChannelListItemTimestamp.tsx index a0aba65f5b..1de5921482 100644 --- a/src/components/ChannelListItem/ChannelListItemTimestamp.tsx +++ b/src/components/ChannelListItem/ChannelListItemTimestamp.tsx @@ -30,7 +30,10 @@ export function ChannelListItemTimestamp({ lastMessage }: ChannelListItemTimesta if (!when) return null; return ( -