Skip to content

feat: add icons to ComponentContext - #3246

Merged
arnautov-anton merged 4 commits into
masterfrom
add-icons-to-component-context
Jul 29, 2026
Merged

feat: add icons to ComponentContext#3246
arnautov-anton merged 4 commits into
masterfrom
add-icons-to-component-context

Conversation

@arnautov-anton

@arnautov-anton arnautov-anton commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

🎯 Goal

Adds ability to override icons through the component context.

Ref: GetStream/stream-chat-react-native#3731

Summary by CodeRabbit

  • New Features
    • Added useComponentContextIcons, enabling centralized, context-based icon customization (with SDK defaults) across messages, attachments, dialogs, forms, media, polls, reactions, and channel views.
  • Bug Fixes
    • Improved icon override merging so nested icons customizations are preserved and combined correctly instead of being replaced.
  • Documentation
    • Expanded deprecation guidance for select icon customization props in favor of ComponentContext icon slots.
  • Tests
    • Updated test mocks to support component-context icon resolution.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▢️ Resume reviews
  • πŸ” Trigger review
πŸ“ Walkthrough

Walkthrough

The PR adds typed icon override slots to ComponentContext, deep-merges nested icon overrides, and updates components across attachments, messaging, composer, dialogs, plugins, and media flows to resolve contextual icons with existing defaults as fallbacks. Deprecated icon props retain compatibility precedence.

Changes

Context-driven icon customization

Layer / File(s) Summary
Icon slot contract and propagation
src/components/Icons/*, src/context/*, src/components/Avatar/Avatar.tsx, src/plugins/Emojis/EmojiPicker.tsx
Adds typed icon slots, exposes them through component context, merges nested overrides, and preserves explicit icon prop precedence.
Shared component icon resolution
src/components/Attachment/*, src/components/Badge/*, src/components/Dialog/*, src/components/Form/*, src/components/Gallery/*, src/components/MediaRecorder/*
Replaces fixed icon usage with contextual icons and default fallbacks across shared UI components.
Composer and message icon flows
src/components/MessageComposer/*, src/components/Message/*, src/components/MessageActions/*, src/components/MessageList/*, src/components/Notifications/*
Applies contextual icon selection to composer controls, attachment previews, message actions, status indicators, lists, and notifications.
Plugin integration and validation
src/plugins/ChannelDetail/*, src/plugins/Emojis/*, src/plugins/*/__tests__/*
Wires icon overrides into channel detail and related plugin views, and updates affected context mocks in tests.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested labels: released on @latest``

Suggested reviewers: martincupela, oliverlaz

πŸš₯ Pre-merge checks | βœ… 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
βœ… Passed checks (4 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title clearly matches the main change: adding icon override support to ComponentContext.
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches πŸ’‘ 1
πŸ“ Generate docstrings πŸ’‘
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-icons-to-component-context

Warning

Tools execution failed with the following error:

Failed to run tools: 14 UNAVAILABLE: read ECONNRESET


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.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

Size Change: +2.86 kB (+0.32%)

Total Size: 884 kB

πŸ“¦ View Changed
Filename Size Change
dist/cjs/channel-detail.js 23.3 kB +230 B (+1%)
dist/cjs/emojis.js 2.58 kB +18 B (+0.7%)
dist/cjs/index.js 293 kB +720 B (+0.25%)
dist/cjs/ReactPlayerWrapper.js 546 B -1 B (-0.18%)
dist/cjs/useChannelHeaderOnlineStatus.js 41.2 kB +91 B (+0.22%)
dist/cjs/useNotificationApi.js 57.9 kB +433 B (+0.75%)
dist/es/channel-detail.mjs 22.7 kB +59 B (+0.26%)
dist/es/emojis.mjs 2.5 kB +22 B (+0.89%)
dist/es/index.mjs 290 kB +742 B (+0.26%)
dist/es/useChannelHeaderOnlineStatus.mjs 40.6 kB +6 B (+0.01%)
dist/es/useMessageComposerController.mjs 937 B +2 B (+0.21%)
dist/es/useNotificationApi.mjs 56.7 kB +540 B (+0.96%)
ℹ️ View Unchanged
Filename Size
dist/cjs/audioProcessing.js 1.74 kB
dist/cjs/mp3-encoder.js 814 B
dist/cjs/useMessageComposerController.js 1.01 kB
dist/css/channel-detail.css 2.84 kB
dist/css/emoji-picker.css 178 B
dist/css/emoji-replacement.css 456 B
dist/css/index.css 41.4 kB
dist/es/audioProcessing.mjs 1.65 kB
dist/es/mp3-encoder.mjs 768 B
dist/es/ReactPlayerWrapper.mjs 485 B

compressed-size-action

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementView.tsx (1)

62-67: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | πŸ’€ Low value

Consolidate redundant useComponentContext calls.

Both components fetch from useComponentContext() multiple times in a row. You can consolidate these calls into a single destructuring statement to clean up the component bodies.

  • src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementView.tsx#L62-L67: combine the icons and Avatar lookups into one hook call in ChannelManagementInfoBody.
  • src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementView.tsx#L323-L324: combine the icons and Avatar lookups into one hook call in ChannelManagementEditBody.
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementView.tsx`
around lines 62 - 67, Consolidate the adjacent useComponentContext calls in
ChannelManagementInfoBody at
src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementView.tsx
lines 62-67 into one destructuring statement containing both icons and Avatar,
preserving their existing defaults. Apply the same consolidation in
ChannelManagementEditBody at lines 323-324; both sites require direct changes.
src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersBrowseView.tsx (1)

82-100: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | πŸ’€ Low value

Hoist the hook call to the parent component.

useComponentContext is currently called inside a dynamically created function (MemberTrailingSlot). Depending on how the layout component invokes TrailingSlot (as a render prop TrailingSlot() vs a component <TrailingSlot />), this might violate the Rules of Hooks. Hoisting it to the top level of ChannelMembersBrowseViewItem is safer and more idiomatic.

♻️ Proposed refactor
-  const TrailingSlot = useMemo(
-    () =>
-      function MemberTrailingSlot() {
-        const { icons: { IconMute = DefaultIconMute } = {} } = useComponentContext();
-        return (
-          <div className='str-chat__channel-detail__channel-members-view__list-item__trailing-slot'>
-            {roleTranslation ? (
-              <span className='str-chat__channel-detail__channel-members-view__role-label'>
-                {roleTranslation}
-              </span>
-            ) : null}
-            {isMuted ? (
-              <IconMute className='str-chat__channel-detail__channel-members-view__list-item__indicator-icon str-chat__channel-detail__channel-members-view__list-item__indicator-icon--mute' />
-            ) : null}
-          </div>
-        );
-      },
-    [isMuted, roleTranslation],
-  );
+  const { icons: { IconMute = DefaultIconMute } = {} } = useComponentContext();
+
+  const TrailingSlot = useMemo(
+    () =>
+      function MemberTrailingSlot() {
+        return (
+          <div className='str-chat__channel-detail__channel-members-view__list-item__trailing-slot'>
+            {roleTranslation ? (
+              <span className='str-chat__channel-detail__channel-members-view__role-label'>
+                {roleTranslation}
+              </span>
+            ) : null}
+            {isMuted ? (
+              <IconMute className='str-chat__channel-detail__channel-members-view__list-item__indicator-icon str-chat__channel-detail__channel-members-view__list-item__indicator-icon--mute' />
+            ) : null}
+          </div>
+        );
+      },
+    [isMuted, roleTranslation, IconMute],
+  );
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersBrowseView.tsx`
around lines 82 - 100, Move the useComponentContext call out of the dynamically
created MemberTrailingSlot function and invoke it at the top level of
ChannelMembersBrowseViewItem. Derive the IconMute fallback there, then have
MemberTrailingSlot reuse that value while preserving the existing mute and
role-label rendering.
src/components/MessageComposer/AttachmentPreviewList/GeolocationPreview.tsx (1)

12-15: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | πŸ’€ Low value

Remove the deprecated string argument.

The _componentName parameter in useComponentContext is marked as @deprecated. It is recommended to call the hook without any arguments.

♻️ Proposed refactor
 const GeolocationPreviewImage = () => {
-  const { icons: { IconLocation = DefaultIconLocation } = {} } = useComponentContext(
-    'GeolocationPreviewImage',
-  );
+  const { icons: { IconLocation = DefaultIconLocation } = {} } = useComponentContext();
   return (
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/MessageComposer/AttachmentPreviewList/GeolocationPreview.tsx`
around lines 12 - 15, Update GeolocationPreviewImage to call useComponentContext
without the deprecated string argument, while preserving the existing icons
destructuring and DefaultIconLocation fallback.
src/components/MessageActions/MessageActions.defaults.tsx (1)

94-94: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | πŸ’€ Low value

Merge duplicate useComponentContext invocations.

useComponentContext() is already invoked earlier in this action function (around line 80) to retrieve ReactionSelector. You can consolidate these calls into a single destructuring statement.

♻️ Proposed refactor
     React() {
-      const { ReactionSelector = DefaultReactionSelector } = useComponentContext();
       const { anchorReferenceElement } = useContextMenuContext();
       const { isMyMessage, message, threadList } = useMessageContext();
@@ -91,3 +90,5 @@
       const dialogIsOpen = useDialogIsOpen(dialogId, dialogManager?.id);
 
-      const { icons: { IconEmoji = DefaultIconEmoji } = {} } = useComponentContext();
+      const {
+        icons: { IconEmoji = DefaultIconEmoji } = {},
+        ReactionSelector = DefaultReactionSelector,
+      } = useComponentContext();
       return (
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/MessageActions/MessageActions.defaults.tsx` at line 94, Merge
the later useComponentContext() call used to obtain IconEmoji into the earlier
invocation that retrieves ReactionSelector in the same action function. Extend
the existing destructuring to read both values, preserving DefaultIconEmoji as
the fallback when icons or IconEmoji are unavailable.
πŸ€– Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/Badge/MediaBadge.tsx`:
- Around line 17-30: Update the voice entry in MediaBadge’s
mediaBadgeVariantToIcon mapping to use the exact MediaBadgeVariant value
"voice-recording" instead of "voiceRecording", while preserving the existing
microphone icon mapping.

---

Nitpick comments:
In `@src/components/MessageActions/MessageActions.defaults.tsx`:
- Line 94: Merge the later useComponentContext() call used to obtain IconEmoji
into the earlier invocation that retrieves ReactionSelector in the same action
function. Extend the existing destructuring to read both values, preserving
DefaultIconEmoji as the fallback when icons or IconEmoji are unavailable.

In `@src/components/MessageComposer/AttachmentPreviewList/GeolocationPreview.tsx`:
- Around line 12-15: Update GeolocationPreviewImage to call useComponentContext
without the deprecated string argument, while preserving the existing icons
destructuring and DefaultIconLocation fallback.

In
`@src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementView.tsx`:
- Around line 62-67: Consolidate the adjacent useComponentContext calls in
ChannelManagementInfoBody at
src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementView.tsx
lines 62-67 into one destructuring statement containing both icons and Avatar,
preserving their existing defaults. Apply the same consolidation in
ChannelManagementEditBody at lines 323-324; both sites require direct changes.

In
`@src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersBrowseView.tsx`:
- Around line 82-100: Move the useComponentContext call out of the dynamically
created MemberTrailingSlot function and invoke it at the top level of
ChannelMembersBrowseViewItem. Derive the IconMute fallback there, then have
MemberTrailingSlot reuse that value while preserving the existing mute and
role-label rendering.
πŸͺ„ Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
βš™οΈ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 954d8a21-faf0-4bb8-bc63-0199423c5c8d

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 20936d6 and da9db39.

πŸ“’ Files selected for processing (103)
  • src/components/Attachment/Geolocation.tsx
  • src/components/Attachment/Giphy.tsx
  • src/components/Attachment/LinkPreview/Card.tsx
  • src/components/Attachment/LinkPreview/CardAudio.tsx
  • src/components/Attachment/ModalGallery.tsx
  • src/components/Attachment/UnsupportedAttachment.tsx
  • src/components/Attachment/VisibilityDisclaimer.tsx
  • src/components/Attachment/components/DownloadButton.tsx
  • src/components/Avatar/Avatar.tsx
  • src/components/Badge/Badge.tsx
  • src/components/Badge/MediaBadge.tsx
  • src/components/BaseImage/ImagePlaceholder.tsx
  • src/components/Button/PlayButton.tsx
  • src/components/ChannelListItem/ChannelListItemActionButtons.defaults.tsx
  • src/components/ChannelListItem/ChannelListItemUI.tsx
  • src/components/ChatView/ChatView.tsx
  • src/components/Dialog/components/Callout.tsx
  • src/components/Dialog/components/ContextMenu.tsx
  • src/components/Dialog/components/Prompt.tsx
  • src/components/Dialog/components/Viewer.tsx
  • src/components/EmptyStateIndicator/EmptyStateIndicator.tsx
  • src/components/Form/NumericInput.tsx
  • src/components/Form/TextInput.tsx
  • src/components/Gallery/GalleryHeader.tsx
  • src/components/Gallery/GalleryUI.tsx
  • src/components/Icons/index.ts
  • src/components/Icons/slots.ts
  • src/components/Loading/LoadingIndicator.tsx
  • src/components/Location/ShareLocationDialog.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecorderRecordingControls.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecordingButtonWithNotification.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecordingPlayback.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecordingPreview.tsx
  • src/components/MediaRecorder/AudioRecorder/__tests__/AudioRecordingPreview.test.tsx
  • src/components/Message/MessageAlsoSentInChannelIndicator.tsx
  • src/components/Message/MessageDeletedBubble.tsx
  • src/components/Message/MessageStatus.tsx
  • src/components/Message/MessageTranslationIndicator.tsx
  • src/components/Message/PinIndicator.tsx
  • src/components/Message/ReminderNotification.tsx
  • src/components/MessageActions/DownloadSubmenu.tsx
  • src/components/MessageActions/MessageActions.defaults.tsx
  • src/components/MessageActions/RemindMeSubmenu.tsx
  • src/components/MessageBounce/MessageBouncePrompt.tsx
  • src/components/MessageComposer/AttachmentPreviewList/AudioAttachmentPreview.tsx
  • src/components/MessageComposer/AttachmentPreviewList/FileAttachmentPreview.tsx
  • src/components/MessageComposer/AttachmentPreviewList/GeolocationPreview.tsx
  • src/components/MessageComposer/AttachmentPreviewList/MediaAttachmentPreview.tsx
  • src/components/MessageComposer/AttachmentPreviewList/UnsupportedAttachmentPreview.tsx
  • src/components/MessageComposer/AttachmentSelector/AttachmentSelector.tsx
  • src/components/MessageComposer/AttachmentSelector/CommandsMenu.tsx
  • src/components/MessageComposer/AttachmentSelector/__tests__/CommandsMenu.test.tsx
  • src/components/MessageComposer/CommandChip.tsx
  • src/components/MessageComposer/LinkPreviewList.tsx
  • src/components/MessageComposer/MessageComposerActions.tsx
  • src/components/MessageComposer/QuotedMessagePreview.tsx
  • src/components/MessageComposer/RemoveAttachmentPreviewButton.tsx
  • src/components/MessageComposer/SendButton.tsx
  • src/components/MessageComposer/SendToChannelCheckbox.tsx
  • src/components/MessageComposer/WithDragAndDropUpload.tsx
  • src/components/MessageComposer/__tests__/CommandChip.test.tsx
  • src/components/MessageList/ScrollToLatestMessageButton.tsx
  • src/components/MessageList/UnreadMessagesNotification.tsx
  • src/components/MessageList/UnreadMessagesSeparator.tsx
  • src/components/Modal/CloseButtonOnModalOverlay.tsx
  • src/components/Notifications/Notification.tsx
  • src/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.tsx
  • src/components/Poll/PollCreationDialog/OptionFieldSet.tsx
  • src/components/Poll/PollCreationDialog/PollCreationDialogControls.tsx
  • src/components/Poll/PollCreationDialog/PollOptionReorderHandle.tsx
  • src/components/Reactions/MessageReactionsDetail.tsx
  • src/components/Reactions/ReactionSelector.tsx
  • src/components/Reactions/ReactionSelectorWithButton.tsx
  • src/components/SummarizedMessagePreview/SummarizedMessagePreview.tsx
  • src/components/TextareaComposer/SuggestionList/MentionItem/BroadcastMentionItem.tsx
  • src/components/TextareaComposer/SuggestionList/MentionItem/RoleItem.tsx
  • src/components/TextareaComposer/SuggestionList/MentionItem/UserGroupItem.tsx
  • src/components/TextareaComposer/__tests__/CommandItem.test.tsx
  • src/components/Thread/ThreadHeader.tsx
  • src/components/Threads/ThreadList/ThreadListEmptyPlaceholder.tsx
  • src/components/Threads/ThreadList/ThreadListUnseenThreadsBanner.tsx
  • src/components/VideoPlayer/VideoThumbnail.tsx
  • src/context/ComponentContext.tsx
  • src/context/WithComponents.tsx
  • src/plugins/ChannelDetail/ChannelDetail.tsx
  • src/plugins/ChannelDetail/ChannelDetailEmptyList.tsx
  • src/plugins/ChannelDetail/ChannelDetailSearchInput.tsx
  • src/plugins/ChannelDetail/SectionNavigator/SectionNavigatorHeader.tsx
  • src/plugins/ChannelDetail/Views/ChannelFilesView/ChannelFilesEmptyList.tsx
  • src/plugins/ChannelDetail/Views/ChannelFilesView/__tests__/ChannelFilesView.test.tsx
  • src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementActions.defaults.tsx
  • src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementView.tsx
  • src/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaEmptyList.tsx
  • src/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaView.tsx
  • src/plugins/ChannelDetail/Views/ChannelMemberDetailView/ChannelMemberActions.defaults.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersAddView.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersBrowseView.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersHeaderActions.defaults.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/__tests__/ChannelMembersAddView.test.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/__tests__/ChannelMembersBrowseView.test.tsx
  • src/plugins/ChannelDetail/Views/PinnedMessagesView/PinnedMessagesEmptyList.tsx
  • src/plugins/ChannelDetail/Views/PinnedMessagesView/__tests__/PinnedMessagesView.test.tsx
  • src/plugins/Emojis/EmojiPicker.tsx

Comment on lines 17 to +30
export const MediaBadge = ({ attachment, variant }: MediaBadgeProps) => {
const Icon = MediaBadgeVariantToIcon[variant];
const {
icons: {
IconMicrophoneSolid = DefaultIconMicrophoneSolid,
IconVideoFill = DefaultIconVideoFill,
} = {},
} = useComponentContext();

const mediaBadgeVariantToIcon: Record<MediaBadgeVariant, ComponentType> = {
video: IconVideoFill,
voiceRecording: IconMicrophoneSolid,
};

const Icon = mediaBadgeVariantToIcon[variant];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | πŸ”΄ Critical | ⚑ Quick win

Fix variant mapping key to match the exact string type.

The MediaBadgeVariant type defines the voice variant as 'voice-recording', but the mediaBadgeVariantToIcon dictionary uses the camelCased key voiceRecording. Consequently, when variant='voice-recording' is passed, the icon will fail to resolve and render.

πŸ› Proposed fix for the dictionary key
   const mediaBadgeVariantToIcon: Record<MediaBadgeVariant, ComponentType> = {
     video: IconVideoFill,
-    voiceRecording: IconMicrophoneSolid,
+    'voice-recording': IconMicrophoneSolid,
   };
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const MediaBadge = ({ attachment, variant }: MediaBadgeProps) => {
const Icon = MediaBadgeVariantToIcon[variant];
const {
icons: {
IconMicrophoneSolid = DefaultIconMicrophoneSolid,
IconVideoFill = DefaultIconVideoFill,
} = {},
} = useComponentContext();
const mediaBadgeVariantToIcon: Record<MediaBadgeVariant, ComponentType> = {
video: IconVideoFill,
voiceRecording: IconMicrophoneSolid,
};
const Icon = mediaBadgeVariantToIcon[variant];
export const MediaBadge = ({ attachment, variant }: MediaBadgeProps) => {
const {
icons: {
IconMicrophoneSolid = DefaultIconMicrophoneSolid,
IconVideoFill = DefaultIconVideoFill,
} = {},
} = useComponentContext();
const mediaBadgeVariantToIcon: Record<MediaBadgeVariant, ComponentType> = {
video: IconVideoFill,
'voice-recording': IconMicrophoneSolid,
};
const Icon = mediaBadgeVariantToIcon[variant];
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/Badge/MediaBadge.tsx` around lines 17 - 30, Update the voice
entry in MediaBadge’s mediaBadgeVariantToIcon mapping to use the exact
MediaBadgeVariant value "voice-recording" instead of "voiceRecording", while
preserving the existing microphone icon mapping.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@MartinCupela - would you know whether this is a type issue or is the mapping is wrong?

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.63063% with 43 lines in your changes missing coverage. Please review.
βœ… Project coverage is 85.18%. Comparing base (9704393) to head (bb7309e).

Files with missing lines Patch % Lines
src/plugins/ChannelDetail/ChannelDetail.tsx 33.33% 10 Missing ⚠️
...MemberDetailView/ChannelMemberActions.defaults.tsx 33.33% 10 Missing ⚠️
...rc/components/Attachment/LinkPreview/CardAudio.tsx 0.00% 4 Missing ⚠️
src/components/Modal/CloseButtonOnModalOverlay.tsx 0.00% 4 Missing ⚠️
src/plugins/Emojis/EmojiPicker.tsx 0.00% 3 Missing ⚠️
...ListItem/ChannelListItemActionButtons.defaults.tsx 75.00% 2 Missing ⚠️
...Views/ChannelMembersView/ChannelMembersAddView.tsx 33.33% 2 Missing ⚠️
src/components/Attachment/VisibilityDisclaimer.tsx 0.00% 1 Missing ⚠️
src/components/Dialog/components/Viewer.tsx 0.00% 1 Missing ⚠️
src/components/Message/PinIndicator.tsx 0.00% 1 Missing ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3246      +/-   ##
==========================================
- Coverage   85.22%   85.18%   -0.05%     
==========================================
  Files         506      507       +1     
  Lines       15795    15949     +154     
  Branches     5023     5025       +2     
==========================================
+ Hits        13462    13586     +124     
- Misses       2333     2363      +30     

β˜” View full report in Codecov by Harness.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

πŸ€– Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/Badge/Badge.tsx`:
- Around line 51-59: Add tests in Badge.test.tsx covering the error Badge’s
default IconExclamationMarkFill rendering and the contextual
icons.IconExclamationMarkFill override. Use the existing component-context test
patterns and assert that each configuration renders the expected icon.
πŸͺ„ Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
βš™οΈ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a05bb20e-b68b-401c-8a35-93d20fd53884

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between da9db39 and 5611b39.

πŸ“’ Files selected for processing (103)
  • src/components/Attachment/Geolocation.tsx
  • src/components/Attachment/Giphy.tsx
  • src/components/Attachment/LinkPreview/Card.tsx
  • src/components/Attachment/LinkPreview/CardAudio.tsx
  • src/components/Attachment/ModalGallery.tsx
  • src/components/Attachment/UnsupportedAttachment.tsx
  • src/components/Attachment/VisibilityDisclaimer.tsx
  • src/components/Attachment/components/DownloadButton.tsx
  • src/components/Avatar/Avatar.tsx
  • src/components/Badge/Badge.tsx
  • src/components/Badge/MediaBadge.tsx
  • src/components/BaseImage/ImagePlaceholder.tsx
  • src/components/Button/PlayButton.tsx
  • src/components/ChannelListItem/ChannelListItemActionButtons.defaults.tsx
  • src/components/ChannelListItem/ChannelListItemUI.tsx
  • src/components/ChatView/ChatView.tsx
  • src/components/Dialog/components/Callout.tsx
  • src/components/Dialog/components/ContextMenu.tsx
  • src/components/Dialog/components/Prompt.tsx
  • src/components/Dialog/components/Viewer.tsx
  • src/components/EmptyStateIndicator/EmptyStateIndicator.tsx
  • src/components/Form/NumericInput.tsx
  • src/components/Form/TextInput.tsx
  • src/components/Gallery/GalleryHeader.tsx
  • src/components/Gallery/GalleryUI.tsx
  • src/components/Icons/index.ts
  • src/components/Icons/slots.ts
  • src/components/Loading/LoadingIndicator.tsx
  • src/components/Location/ShareLocationDialog.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecorderRecordingControls.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecordingButtonWithNotification.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecordingPlayback.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecordingPreview.tsx
  • src/components/MediaRecorder/AudioRecorder/__tests__/AudioRecordingPreview.test.tsx
  • src/components/Message/MessageAlsoSentInChannelIndicator.tsx
  • src/components/Message/MessageDeletedBubble.tsx
  • src/components/Message/MessageStatus.tsx
  • src/components/Message/MessageTranslationIndicator.tsx
  • src/components/Message/PinIndicator.tsx
  • src/components/Message/ReminderNotification.tsx
  • src/components/MessageActions/DownloadSubmenu.tsx
  • src/components/MessageActions/MessageActions.defaults.tsx
  • src/components/MessageActions/RemindMeSubmenu.tsx
  • src/components/MessageBounce/MessageBouncePrompt.tsx
  • src/components/MessageComposer/AttachmentPreviewList/AudioAttachmentPreview.tsx
  • src/components/MessageComposer/AttachmentPreviewList/FileAttachmentPreview.tsx
  • src/components/MessageComposer/AttachmentPreviewList/GeolocationPreview.tsx
  • src/components/MessageComposer/AttachmentPreviewList/MediaAttachmentPreview.tsx
  • src/components/MessageComposer/AttachmentPreviewList/UnsupportedAttachmentPreview.tsx
  • src/components/MessageComposer/AttachmentSelector/AttachmentSelector.tsx
  • src/components/MessageComposer/AttachmentSelector/CommandsMenu.tsx
  • src/components/MessageComposer/AttachmentSelector/__tests__/CommandsMenu.test.tsx
  • src/components/MessageComposer/CommandChip.tsx
  • src/components/MessageComposer/LinkPreviewList.tsx
  • src/components/MessageComposer/MessageComposerActions.tsx
  • src/components/MessageComposer/QuotedMessagePreview.tsx
  • src/components/MessageComposer/RemoveAttachmentPreviewButton.tsx
  • src/components/MessageComposer/SendButton.tsx
  • src/components/MessageComposer/SendToChannelCheckbox.tsx
  • src/components/MessageComposer/WithDragAndDropUpload.tsx
  • src/components/MessageComposer/__tests__/CommandChip.test.tsx
  • src/components/MessageList/ScrollToLatestMessageButton.tsx
  • src/components/MessageList/UnreadMessagesNotification.tsx
  • src/components/MessageList/UnreadMessagesSeparator.tsx
  • src/components/Modal/CloseButtonOnModalOverlay.tsx
  • src/components/Notifications/Notification.tsx
  • src/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.tsx
  • src/components/Poll/PollCreationDialog/OptionFieldSet.tsx
  • src/components/Poll/PollCreationDialog/PollCreationDialogControls.tsx
  • src/components/Poll/PollCreationDialog/PollOptionReorderHandle.tsx
  • src/components/Reactions/MessageReactionsDetail.tsx
  • src/components/Reactions/ReactionSelector.tsx
  • src/components/Reactions/ReactionSelectorWithButton.tsx
  • src/components/SummarizedMessagePreview/SummarizedMessagePreview.tsx
  • src/components/TextareaComposer/SuggestionList/MentionItem/BroadcastMentionItem.tsx
  • src/components/TextareaComposer/SuggestionList/MentionItem/RoleItem.tsx
  • src/components/TextareaComposer/SuggestionList/MentionItem/UserGroupItem.tsx
  • src/components/TextareaComposer/__tests__/CommandItem.test.tsx
  • src/components/Thread/ThreadHeader.tsx
  • src/components/Threads/ThreadList/ThreadListEmptyPlaceholder.tsx
  • src/components/Threads/ThreadList/ThreadListUnseenThreadsBanner.tsx
  • src/components/VideoPlayer/VideoThumbnail.tsx
  • src/context/ComponentContext.tsx
  • src/context/WithComponents.tsx
  • src/plugins/ChannelDetail/ChannelDetail.tsx
  • src/plugins/ChannelDetail/ChannelDetailEmptyList.tsx
  • src/plugins/ChannelDetail/ChannelDetailSearchInput.tsx
  • src/plugins/ChannelDetail/SectionNavigator/SectionNavigatorHeader.tsx
  • src/plugins/ChannelDetail/Views/ChannelFilesView/ChannelFilesEmptyList.tsx
  • src/plugins/ChannelDetail/Views/ChannelFilesView/__tests__/ChannelFilesView.test.tsx
  • src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementActions.defaults.tsx
  • src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementView.tsx
  • src/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaEmptyList.tsx
  • src/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaView.tsx
  • src/plugins/ChannelDetail/Views/ChannelMemberDetailView/ChannelMemberActions.defaults.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersAddView.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersBrowseView.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersHeaderActions.defaults.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/__tests__/ChannelMembersAddView.test.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/__tests__/ChannelMembersBrowseView.test.tsx
  • src/plugins/ChannelDetail/Views/PinnedMessagesView/PinnedMessagesEmptyList.tsx
  • src/plugins/ChannelDetail/Views/PinnedMessagesView/__tests__/PinnedMessagesView.test.tsx
  • src/plugins/Emojis/EmojiPicker.tsx
🚧 Files skipped from review as they are similar to previous changes (96)
  • src/components/Icons/index.ts
  • src/components/MessageComposer/tests/CommandChip.test.tsx
  • src/components/MediaRecorder/AudioRecorder/tests/AudioRecordingPreview.test.tsx
  • src/plugins/ChannelDetail/SectionNavigator/SectionNavigatorHeader.tsx
  • src/plugins/ChannelDetail/Views/ChannelFilesView/ChannelFilesEmptyList.tsx
  • src/components/Message/MessageTranslationIndicator.tsx
  • src/components/Attachment/VisibilityDisclaimer.tsx
  • src/components/Loading/LoadingIndicator.tsx
  • src/components/MessageComposer/AttachmentPreviewList/FileAttachmentPreview.tsx
  • src/components/Modal/CloseButtonOnModalOverlay.tsx
  • src/components/TextareaComposer/SuggestionList/MentionItem/UserGroupItem.tsx
  • src/components/MessageComposer/AttachmentPreviewList/UnsupportedAttachmentPreview.tsx
  • src/components/Message/MessageAlsoSentInChannelIndicator.tsx
  • src/components/Icons/slots.ts
  • src/components/BaseImage/ImagePlaceholder.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecordingButtonWithNotification.tsx
  • src/components/Dialog/components/Callout.tsx
  • src/components/MessageComposer/LinkPreviewList.tsx
  • src/components/Reactions/MessageReactionsDetail.tsx
  • src/components/MessageList/ScrollToLatestMessageButton.tsx
  • src/components/Threads/ThreadList/ThreadListEmptyPlaceholder.tsx
  • src/components/ChannelListItem/ChannelListItemUI.tsx
  • src/components/MessageComposer/AttachmentSelector/tests/CommandsMenu.test.tsx
  • src/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecorderRecordingControls.tsx
  • src/components/Button/PlayButton.tsx
  • src/components/Reactions/ReactionSelectorWithButton.tsx
  • src/components/Attachment/Geolocation.tsx
  • src/context/ComponentContext.tsx
  • src/components/TextareaComposer/SuggestionList/MentionItem/BroadcastMentionItem.tsx
  • src/context/WithComponents.tsx
  • src/plugins/ChannelDetail/Views/ChannelFilesView/tests/ChannelFilesView.test.tsx
  • src/components/Poll/PollCreationDialog/PollOptionReorderHandle.tsx
  • src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementActions.defaults.tsx
  • src/components/Form/NumericInput.tsx
  • src/components/Message/ReminderNotification.tsx
  • src/components/Gallery/GalleryUI.tsx
  • src/plugins/ChannelDetail/ChannelDetailSearchInput.tsx
  • src/components/MessageComposer/AttachmentPreviewList/AudioAttachmentPreview.tsx
  • src/components/MessageComposer/AttachmentPreviewList/MediaAttachmentPreview.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersHeaderActions.defaults.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersAddView.tsx
  • src/components/MessageList/UnreadMessagesSeparator.tsx
  • src/components/Gallery/GalleryHeader.tsx
  • src/components/Reactions/ReactionSelector.tsx
  • src/components/Poll/PollCreationDialog/PollCreationDialogControls.tsx
  • src/components/MessageComposer/SendToChannelCheckbox.tsx
  • src/components/Location/ShareLocationDialog.tsx
  • src/plugins/ChannelDetail/Views/PinnedMessagesView/PinnedMessagesEmptyList.tsx
  • src/components/Thread/ThreadHeader.tsx
  • src/components/Attachment/ModalGallery.tsx
  • src/components/Attachment/LinkPreview/Card.tsx
  • src/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaEmptyList.tsx
  • src/components/Attachment/LinkPreview/CardAudio.tsx
  • src/components/VideoPlayer/VideoThumbnail.tsx
  • src/components/Notifications/Notification.tsx
  • src/components/Badge/MediaBadge.tsx
  • src/plugins/ChannelDetail/ChannelDetailEmptyList.tsx
  • src/components/MessageComposer/SendButton.tsx
  • src/components/MessageActions/RemindMeSubmenu.tsx
  • src/components/Form/TextInput.tsx
  • src/components/Message/PinIndicator.tsx
  • src/components/ChatView/ChatView.tsx
  • src/components/TextareaComposer/SuggestionList/MentionItem/RoleItem.tsx
  • src/components/Avatar/Avatar.tsx
  • src/components/MessageList/UnreadMessagesNotification.tsx
  • src/components/Dialog/components/Prompt.tsx
  • src/components/Poll/PollCreationDialog/OptionFieldSet.tsx
  • src/components/MessageComposer/CommandChip.tsx
  • src/plugins/ChannelDetail/Views/ChannelMemberDetailView/ChannelMemberActions.defaults.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecordingPreview.tsx
  • src/plugins/ChannelDetail/ChannelDetail.tsx
  • src/plugins/ChannelDetail/Views/PinnedMessagesView/tests/PinnedMessagesView.test.tsx
  • src/components/Attachment/Giphy.tsx
  • src/components/MessageComposer/RemoveAttachmentPreviewButton.tsx
  • src/components/Message/MessageStatus.tsx
  • src/components/MessageActions/DownloadSubmenu.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecordingPlayback.tsx
  • src/components/MessageComposer/AttachmentSelector/AttachmentSelector.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersBrowseView.tsx
  • src/components/MessageBounce/MessageBouncePrompt.tsx
  • src/components/Attachment/UnsupportedAttachment.tsx
  • src/components/MessageComposer/MessageComposerActions.tsx
  • src/components/TextareaComposer/tests/CommandItem.test.tsx
  • src/components/MessageComposer/AttachmentSelector/CommandsMenu.tsx
  • src/components/MessageComposer/WithDragAndDropUpload.tsx
  • src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementView.tsx
  • src/components/Dialog/components/ContextMenu.tsx
  • src/components/Dialog/components/Viewer.tsx
  • src/components/Attachment/components/DownloadButton.tsx
  • src/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaView.tsx
  • src/components/Threads/ThreadList/ThreadListUnseenThreadsBanner.tsx
  • src/plugins/Emojis/EmojiPicker.tsx
  • src/components/EmptyStateIndicator/EmptyStateIndicator.tsx
  • src/components/MessageComposer/AttachmentPreviewList/GeolocationPreview.tsx
  • src/components/ChannelListItem/ChannelListItemActionButtons.defaults.tsx

Comment on lines +51 to +59
}: Omit<BadgeProps, 'variant'>) => {
const { icons: { IconExclamationMarkFill = DefaultIconExclamationMarkFill } = {} } =
useComponentContext();
return (
<Badge {...rest} className={className} size={size} variant='error'>
<IconExclamationMarkFill />
</Badge>
);
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

πŸ“ Maintainability & Code Quality | 🟑 Minor | ⚑ Quick win

Add coverage for the contextual icon override.

Extend src/components/Badge/__tests__/Badge.test.tsx to verify both the default icon and an icons.IconExclamationMarkFill override.

As per coding guidelines, β€œAdd and extend tests in the matching module's __tests__/ folder.”

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/Badge/Badge.tsx` around lines 51 - 59, Add tests in
Badge.test.tsx covering the error Badge’s default IconExclamationMarkFill
rendering and the contextual icons.IconExclamationMarkFill override. Use the
existing component-context test patterns and assert that each configuration
renders the expected icon.

Source: Coding guidelines

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
src/plugins/ChannelDetail/Views/PinnedMessagesView/__tests__/PinnedMessagesView.test.tsx (1)

225-225: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | ⚑ Quick win

Use deterministic icon-hook mocks in both tests.

The original useComponentContextIcons implementation resolves through its original useComponentContext binding, bypassing each test’s mocked context hook.

  • src/plugins/ChannelDetail/Views/PinnedMessagesView/__tests__/PinnedMessagesView.test.tsx#L225-L225: return DEFAULT_ICONS from the mocked icon hook.
  • src/plugins/ChannelDetail/__tests__/ChannelManagementActions.defaults.test.tsx#L115-L115: replace actual.useComponentContextIcons with the same deterministic default-icon stub.
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/plugins/ChannelDetail/Views/PinnedMessagesView/__tests__/PinnedMessagesView.test.tsx`
at line 225, Use deterministic icon-hook mocks in both tests: keep the
useComponentContextIcons mock returning DEFAULT_ICONS in
src/plugins/ChannelDetail/Views/PinnedMessagesView/__tests__/PinnedMessagesView.test.tsx:225-225,
and replace actual.useComponentContextIcons with the same DEFAULT_ICONS stub in
src/plugins/ChannelDetail/__tests__/ChannelManagementActions.defaults.test.tsx:115-115.
πŸ€– Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/context/index.ts`:
- Line 7: Update the public API documentation and affected guide pages to
document the newly exported useComponentContextIcons hook, alongside its inline
JSDoc. Ensure consumer-facing documentation reflects the hook’s availability and
usage before merging.

In `@src/context/useComponentContextIcons.ts`:
- Around line 20-22: Update useComponentContextIcons so undefined values in
icons cannot overwrite entries from DEFAULT_ICONS. Merge only defined icon
overrides while preserving the existing defaults and Required<IconSlots> return
contract.

In `@src/plugins/ChannelDetail/__tests__/ChannelManagementView.test.tsx`:
- Line 45: Remove the duplicate useTranslationContext property from the test
mock configuration, retaining a single implementation of the translation
context. Ensure the resulting object has no duplicate keys or related
diagnostics.

---

Nitpick comments:
In
`@src/plugins/ChannelDetail/Views/PinnedMessagesView/__tests__/PinnedMessagesView.test.tsx`:
- Line 225: Use deterministic icon-hook mocks in both tests: keep the
useComponentContextIcons mock returning DEFAULT_ICONS in
src/plugins/ChannelDetail/Views/PinnedMessagesView/__tests__/PinnedMessagesView.test.tsx:225-225,
and replace actual.useComponentContextIcons with the same DEFAULT_ICONS stub in
src/plugins/ChannelDetail/__tests__/ChannelManagementActions.defaults.test.tsx:115-115.
πŸͺ„ Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
βš™οΈ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6f857dcc-8d0e-4cc9-8b0a-a30dafbd50e3

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 5611b39 and ce26cf2.

πŸ“’ Files selected for processing (107)
  • src/components/Attachment/Geolocation.tsx
  • src/components/Attachment/Giphy.tsx
  • src/components/Attachment/LinkPreview/Card.tsx
  • src/components/Attachment/LinkPreview/CardAudio.tsx
  • src/components/Attachment/ModalGallery.tsx
  • src/components/Attachment/UnsupportedAttachment.tsx
  • src/components/Attachment/VisibilityDisclaimer.tsx
  • src/components/Attachment/__tests__/Giphy.test.tsx
  • src/components/Attachment/components/DownloadButton.tsx
  • src/components/Avatar/Avatar.tsx
  • src/components/Badge/Badge.tsx
  • src/components/Badge/MediaBadge.tsx
  • src/components/BaseImage/ImagePlaceholder.tsx
  • src/components/Button/PlayButton.tsx
  • src/components/ChannelListItem/ChannelListItemActionButtons.defaults.tsx
  • src/components/ChannelListItem/ChannelListItemUI.tsx
  • src/components/ChatView/ChatView.tsx
  • src/components/Dialog/components/Callout.tsx
  • src/components/Dialog/components/ContextMenu.tsx
  • src/components/Dialog/components/Prompt.tsx
  • src/components/Dialog/components/Viewer.tsx
  • src/components/EmptyStateIndicator/EmptyStateIndicator.tsx
  • src/components/Form/NumericInput.tsx
  • src/components/Form/TextInput.tsx
  • src/components/Gallery/GalleryHeader.tsx
  • src/components/Gallery/GalleryUI.tsx
  • src/components/Loading/LoadingIndicator.tsx
  • src/components/Location/ShareLocationDialog.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecorderRecordingControls.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecordingButtonWithNotification.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecordingPlayback.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecordingPreview.tsx
  • src/components/MediaRecorder/AudioRecorder/__tests__/AudioRecordingPreview.test.tsx
  • src/components/Message/MessageAlsoSentInChannelIndicator.tsx
  • src/components/Message/MessageDeletedBubble.tsx
  • src/components/Message/MessageStatus.tsx
  • src/components/Message/MessageTranslationIndicator.tsx
  • src/components/Message/PinIndicator.tsx
  • src/components/Message/ReminderNotification.tsx
  • src/components/MessageActions/DownloadSubmenu.tsx
  • src/components/MessageActions/MessageActions.defaults.tsx
  • src/components/MessageActions/RemindMeSubmenu.tsx
  • src/components/MessageBounce/MessageBouncePrompt.tsx
  • src/components/MessageComposer/AttachmentPreviewList/AudioAttachmentPreview.tsx
  • src/components/MessageComposer/AttachmentPreviewList/FileAttachmentPreview.tsx
  • src/components/MessageComposer/AttachmentPreviewList/GeolocationPreview.tsx
  • src/components/MessageComposer/AttachmentPreviewList/MediaAttachmentPreview.tsx
  • src/components/MessageComposer/AttachmentPreviewList/UnsupportedAttachmentPreview.tsx
  • src/components/MessageComposer/AttachmentSelector/AttachmentSelector.tsx
  • src/components/MessageComposer/AttachmentSelector/CommandsMenu.tsx
  • src/components/MessageComposer/AttachmentSelector/__tests__/CommandsMenu.test.tsx
  • src/components/MessageComposer/CommandChip.tsx
  • src/components/MessageComposer/LinkPreviewList.tsx
  • src/components/MessageComposer/MessageComposerActions.tsx
  • src/components/MessageComposer/QuotedMessagePreview.tsx
  • src/components/MessageComposer/RemoveAttachmentPreviewButton.tsx
  • src/components/MessageComposer/SendButton.tsx
  • src/components/MessageComposer/SendToChannelCheckbox.tsx
  • src/components/MessageComposer/WithDragAndDropUpload.tsx
  • src/components/MessageComposer/__tests__/CommandChip.test.tsx
  • src/components/MessageList/ScrollToLatestMessageButton.tsx
  • src/components/MessageList/UnreadMessagesNotification.tsx
  • src/components/MessageList/UnreadMessagesSeparator.tsx
  • src/components/Modal/CloseButtonOnModalOverlay.tsx
  • src/components/Notifications/Notification.tsx
  • src/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.tsx
  • src/components/Poll/PollCreationDialog/OptionFieldSet.tsx
  • src/components/Poll/PollCreationDialog/PollCreationDialogControls.tsx
  • src/components/Poll/PollCreationDialog/PollOptionReorderHandle.tsx
  • src/components/Reactions/MessageReactionsDetail.tsx
  • src/components/Reactions/ReactionSelector.tsx
  • src/components/Reactions/ReactionSelectorWithButton.tsx
  • src/components/SummarizedMessagePreview/SummarizedMessagePreview.tsx
  • src/components/TextareaComposer/SuggestionList/MentionItem/BroadcastMentionItem.tsx
  • src/components/TextareaComposer/SuggestionList/MentionItem/RoleItem.tsx
  • src/components/TextareaComposer/SuggestionList/MentionItem/UserGroupItem.tsx
  • src/components/TextareaComposer/__tests__/CommandItem.test.tsx
  • src/components/Thread/ThreadHeader.tsx
  • src/components/Threads/ThreadList/ThreadListEmptyPlaceholder.tsx
  • src/components/Threads/ThreadList/ThreadListUnseenThreadsBanner.tsx
  • src/components/VideoPlayer/VideoThumbnail.tsx
  • src/context/index.ts
  • src/context/useComponentContextIcons.ts
  • src/plugins/ChannelDetail/ChannelDetail.tsx
  • src/plugins/ChannelDetail/ChannelDetailEmptyList.tsx
  • src/plugins/ChannelDetail/ChannelDetailSearchInput.tsx
  • src/plugins/ChannelDetail/SectionNavigator/SectionNavigatorHeader.tsx
  • src/plugins/ChannelDetail/Views/ChannelFilesView/ChannelFilesEmptyList.tsx
  • src/plugins/ChannelDetail/Views/ChannelFilesView/__tests__/ChannelFilesView.test.tsx
  • src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementActions.defaults.tsx
  • src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementView.tsx
  • src/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaEmptyList.tsx
  • src/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaView.tsx
  • src/plugins/ChannelDetail/Views/ChannelMediaView/__tests__/ChannelMediaView.test.tsx
  • src/plugins/ChannelDetail/Views/ChannelMemberDetailView/ChannelMemberActions.defaults.tsx
  • src/plugins/ChannelDetail/Views/ChannelMemberDetailView/__tests__/ChannelMemberDetail.test.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersAddView.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersBrowseView.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersHeaderActions.defaults.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/__tests__/ChannelMembersAddView.test.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/__tests__/ChannelMembersBrowseView.test.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/__tests__/ChannelMembersView.test.tsx
  • src/plugins/ChannelDetail/Views/PinnedMessagesView/PinnedMessagesEmptyList.tsx
  • src/plugins/ChannelDetail/Views/PinnedMessagesView/__tests__/PinnedMessagesView.test.tsx
  • src/plugins/ChannelDetail/__tests__/ChannelManagementActions.defaults.test.tsx
  • src/plugins/ChannelDetail/__tests__/ChannelManagementView.test.tsx
  • src/plugins/Emojis/EmojiPicker.tsx
🚧 Files skipped from review as they are similar to previous changes (38)
  • src/plugins/ChannelDetail/Views/PinnedMessagesView/PinnedMessagesEmptyList.tsx
  • src/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaEmptyList.tsx
  • src/components/TextareaComposer/tests/CommandItem.test.tsx
  • src/components/Button/PlayButton.tsx
  • src/components/SummarizedMessagePreview/SummarizedMessagePreview.tsx
  • src/components/Poll/PollCreationDialog/PollCreationDialogControls.tsx
  • src/components/Modal/CloseButtonOnModalOverlay.tsx
  • src/plugins/ChannelDetail/Views/ChannelFilesView/ChannelFilesEmptyList.tsx
  • src/plugins/ChannelDetail/ChannelDetailEmptyList.tsx
  • src/components/MessageComposer/tests/CommandChip.test.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecordingButtonWithNotification.tsx
  • src/components/Message/MessageStatus.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/tests/ChannelMembersBrowseView.test.tsx
  • src/components/Loading/LoadingIndicator.tsx
  • src/components/MessageComposer/AttachmentSelector/tests/CommandsMenu.test.tsx
  • src/components/MessageComposer/LinkPreviewList.tsx
  • src/components/Badge/MediaBadge.tsx
  • src/components/Message/MessageTranslationIndicator.tsx
  • src/components/Message/ReminderNotification.tsx
  • src/components/Threads/ThreadList/ThreadListEmptyPlaceholder.tsx
  • src/components/MessageComposer/AttachmentPreviewList/FileAttachmentPreview.tsx
  • src/plugins/ChannelDetail/Views/ChannelFilesView/tests/ChannelFilesView.test.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecordingPlayback.tsx
  • src/components/Gallery/GalleryUI.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/tests/ChannelMembersAddView.test.tsx
  • src/components/MessageComposer/AttachmentPreviewList/GeolocationPreview.tsx
  • src/components/Notifications/Notification.tsx
  • src/components/Dialog/components/Prompt.tsx
  • src/components/Gallery/GalleryHeader.tsx
  • src/components/Reactions/MessageReactionsDetail.tsx
  • src/components/Avatar/Avatar.tsx
  • src/components/MessageComposer/AttachmentSelector/CommandsMenu.tsx
  • src/components/Form/NumericInput.tsx
  • src/components/Form/TextInput.tsx
  • src/plugins/Emojis/EmojiPicker.tsx
  • src/components/MessageActions/RemindMeSubmenu.tsx
  • src/components/MessageComposer/QuotedMessagePreview.tsx
  • src/components/Reactions/ReactionSelectorWithButton.tsx

Comment thread src/context/index.ts
export * from './ChannelStateContext';
export * from './ChatContext';
export * from './ComponentContext';
export * from './useComponentContextIcons';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

πŸ“ Maintainability & Code Quality | 🟠 Major | ⚑ Quick win

Update public API documentation for the new hook.

This export adds useComponentContextIcons to the consumer-facing API. Update the affected guide pages in addition to the inline JSDoc before merging.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/context/index.ts` at line 7, Update the public API documentation and
affected guide pages to document the newly exported useComponentContextIcons
hook, alongside its inline JSDoc. Ensure consumer-facing documentation reflects
the hook’s availability and usage before merging.

Source: Coding guidelines

Comment thread src/context/useComponentContextIcons.ts Outdated
Comment thread src/plugins/ChannelDetail/__tests__/ChannelManagementView.test.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

πŸ€– Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/context/useComponentContextIcons.ts`:
- Around line 23-32: Update the useMemo in useComponentContextIcons to include
the context icons value in its dependency array, so definedOverrides and the
merged DEFAULT_ICONS result recompute when overrides change. Remove the
exhaustive-deps suppression comment while preserving the existing filtering and
merge behavior.
πŸͺ„ Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
βš™οΈ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3a7ec3e6-9209-4d58-ae45-c03b3724379a

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 3bb6370 and bb7309e.

πŸ“’ Files selected for processing (111)
  • src/components/Attachment/Geolocation.tsx
  • src/components/Attachment/Giphy.tsx
  • src/components/Attachment/LinkPreview/Card.tsx
  • src/components/Attachment/LinkPreview/CardAudio.tsx
  • src/components/Attachment/ModalGallery.tsx
  • src/components/Attachment/UnsupportedAttachment.tsx
  • src/components/Attachment/VisibilityDisclaimer.tsx
  • src/components/Attachment/__tests__/Giphy.test.tsx
  • src/components/Attachment/components/DownloadButton.tsx
  • src/components/Avatar/Avatar.tsx
  • src/components/Badge/Badge.tsx
  • src/components/Badge/MediaBadge.tsx
  • src/components/BaseImage/ImagePlaceholder.tsx
  • src/components/Button/PlayButton.tsx
  • src/components/ChannelListItem/ChannelListItemActionButtons.defaults.tsx
  • src/components/ChannelListItem/ChannelListItemUI.tsx
  • src/components/ChatView/ChatView.tsx
  • src/components/Dialog/components/Callout.tsx
  • src/components/Dialog/components/ContextMenu.tsx
  • src/components/Dialog/components/Prompt.tsx
  • src/components/Dialog/components/Viewer.tsx
  • src/components/EmptyStateIndicator/EmptyStateIndicator.tsx
  • src/components/Form/NumericInput.tsx
  • src/components/Form/TextInput.tsx
  • src/components/Gallery/GalleryHeader.tsx
  • src/components/Gallery/GalleryUI.tsx
  • src/components/Icons/index.ts
  • src/components/Icons/slots.ts
  • src/components/Loading/LoadingIndicator.tsx
  • src/components/Location/ShareLocationDialog.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecorderRecordingControls.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecordingButtonWithNotification.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecordingPlayback.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecordingPreview.tsx
  • src/components/MediaRecorder/AudioRecorder/__tests__/AudioRecordingPreview.test.tsx
  • src/components/Message/MessageAlsoSentInChannelIndicator.tsx
  • src/components/Message/MessageDeletedBubble.tsx
  • src/components/Message/MessageStatus.tsx
  • src/components/Message/MessageTranslationIndicator.tsx
  • src/components/Message/PinIndicator.tsx
  • src/components/Message/ReminderNotification.tsx
  • src/components/MessageActions/DownloadSubmenu.tsx
  • src/components/MessageActions/MessageActions.defaults.tsx
  • src/components/MessageActions/RemindMeSubmenu.tsx
  • src/components/MessageBounce/MessageBouncePrompt.tsx
  • src/components/MessageComposer/AttachmentPreviewList/AudioAttachmentPreview.tsx
  • src/components/MessageComposer/AttachmentPreviewList/FileAttachmentPreview.tsx
  • src/components/MessageComposer/AttachmentPreviewList/GeolocationPreview.tsx
  • src/components/MessageComposer/AttachmentPreviewList/MediaAttachmentPreview.tsx
  • src/components/MessageComposer/AttachmentPreviewList/UnsupportedAttachmentPreview.tsx
  • src/components/MessageComposer/AttachmentSelector/AttachmentSelector.tsx
  • src/components/MessageComposer/AttachmentSelector/CommandsMenu.tsx
  • src/components/MessageComposer/AttachmentSelector/__tests__/CommandsMenu.test.tsx
  • src/components/MessageComposer/CommandChip.tsx
  • src/components/MessageComposer/LinkPreviewList.tsx
  • src/components/MessageComposer/MessageComposerActions.tsx
  • src/components/MessageComposer/QuotedMessagePreview.tsx
  • src/components/MessageComposer/RemoveAttachmentPreviewButton.tsx
  • src/components/MessageComposer/SendButton.tsx
  • src/components/MessageComposer/SendToChannelCheckbox.tsx
  • src/components/MessageComposer/WithDragAndDropUpload.tsx
  • src/components/MessageComposer/__tests__/CommandChip.test.tsx
  • src/components/MessageList/ScrollToLatestMessageButton.tsx
  • src/components/MessageList/UnreadMessagesNotification.tsx
  • src/components/MessageList/UnreadMessagesSeparator.tsx
  • src/components/Modal/CloseButtonOnModalOverlay.tsx
  • src/components/Notifications/Notification.tsx
  • src/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.tsx
  • src/components/Poll/PollCreationDialog/OptionFieldSet.tsx
  • src/components/Poll/PollCreationDialog/PollCreationDialogControls.tsx
  • src/components/Poll/PollCreationDialog/PollOptionReorderHandle.tsx
  • src/components/Reactions/MessageReactionsDetail.tsx
  • src/components/Reactions/ReactionSelector.tsx
  • src/components/Reactions/ReactionSelectorWithButton.tsx
  • src/components/SummarizedMessagePreview/SummarizedMessagePreview.tsx
  • src/components/TextareaComposer/SuggestionList/MentionItem/BroadcastMentionItem.tsx
  • src/components/TextareaComposer/SuggestionList/MentionItem/RoleItem.tsx
  • src/components/TextareaComposer/SuggestionList/MentionItem/UserGroupItem.tsx
  • src/components/TextareaComposer/__tests__/CommandItem.test.tsx
  • src/components/Thread/ThreadHeader.tsx
  • src/components/Threads/ThreadList/ThreadListEmptyPlaceholder.tsx
  • src/components/Threads/ThreadList/ThreadListUnseenThreadsBanner.tsx
  • src/components/VideoPlayer/VideoThumbnail.tsx
  • src/context/ComponentContext.tsx
  • src/context/WithComponents.tsx
  • src/context/index.ts
  • src/context/useComponentContextIcons.ts
  • src/plugins/ChannelDetail/ChannelDetail.tsx
  • src/plugins/ChannelDetail/ChannelDetailEmptyList.tsx
  • src/plugins/ChannelDetail/ChannelDetailSearchInput.tsx
  • src/plugins/ChannelDetail/SectionNavigator/SectionNavigatorHeader.tsx
  • src/plugins/ChannelDetail/Views/ChannelFilesView/ChannelFilesEmptyList.tsx
  • src/plugins/ChannelDetail/Views/ChannelFilesView/__tests__/ChannelFilesView.test.tsx
  • src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementActions.defaults.tsx
  • src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementView.tsx
  • src/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaEmptyList.tsx
  • src/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaView.tsx
  • src/plugins/ChannelDetail/Views/ChannelMediaView/__tests__/ChannelMediaView.test.tsx
  • src/plugins/ChannelDetail/Views/ChannelMemberDetailView/ChannelMemberActions.defaults.tsx
  • src/plugins/ChannelDetail/Views/ChannelMemberDetailView/__tests__/ChannelMemberDetail.test.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersAddView.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersBrowseView.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersHeaderActions.defaults.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/__tests__/ChannelMembersAddView.test.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/__tests__/ChannelMembersBrowseView.test.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/__tests__/ChannelMembersView.test.tsx
  • src/plugins/ChannelDetail/Views/PinnedMessagesView/PinnedMessagesEmptyList.tsx
  • src/plugins/ChannelDetail/Views/PinnedMessagesView/__tests__/PinnedMessagesView.test.tsx
  • src/plugins/ChannelDetail/__tests__/ChannelManagementActions.defaults.test.tsx
  • src/plugins/ChannelDetail/__tests__/ChannelManagementView.test.tsx
  • src/plugins/Emojis/EmojiPicker.tsx
🚧 Files skipped from review as they are similar to previous changes (93)
  • src/components/Threads/ThreadList/ThreadListEmptyPlaceholder.tsx
  • src/components/MessageComposer/AttachmentPreviewList/UnsupportedAttachmentPreview.tsx
  • src/components/MessageActions/DownloadSubmenu.tsx
  • src/components/MessageComposer/AttachmentPreviewList/AudioAttachmentPreview.tsx
  • src/components/SummarizedMessagePreview/SummarizedMessagePreview.tsx
  • src/components/Modal/CloseButtonOnModalOverlay.tsx
  • src/components/MessageComposer/RemoveAttachmentPreviewButton.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecorderRecordingControls.tsx
  • src/components/MessageComposer/SendToChannelCheckbox.tsx
  • src/components/MediaRecorder/AudioRecorder/tests/AudioRecordingPreview.test.tsx
  • src/components/MessageComposer/AttachmentSelector/tests/CommandsMenu.test.tsx
  • src/plugins/ChannelDetail/SectionNavigator/SectionNavigatorHeader.tsx
  • src/components/Loading/LoadingIndicator.tsx
  • src/components/Threads/ThreadList/ThreadListUnseenThreadsBanner.tsx
  • src/components/MessageComposer/CommandChip.tsx
  • src/components/MessageComposer/SendButton.tsx
  • src/components/Message/MessageAlsoSentInChannelIndicator.tsx
  • src/components/TextareaComposer/SuggestionList/MentionItem/UserGroupItem.tsx
  • src/plugins/ChannelDetail/Views/PinnedMessagesView/PinnedMessagesEmptyList.tsx
  • src/components/Message/PinIndicator.tsx
  • src/plugins/ChannelDetail/tests/ChannelManagementActions.defaults.test.tsx
  • src/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaEmptyList.tsx
  • src/components/BaseImage/ImagePlaceholder.tsx
  • src/components/Thread/ThreadHeader.tsx
  • src/components/Attachment/LinkPreview/CardAudio.tsx
  • src/components/ChannelListItem/ChannelListItemUI.tsx
  • src/components/MessageComposer/MessageComposerActions.tsx
  • src/components/MessageComposer/QuotedMessagePreview.tsx
  • src/components/Attachment/ModalGallery.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecordingPreview.tsx
  • src/components/Reactions/ReactionSelectorWithButton.tsx
  • src/components/VideoPlayer/VideoThumbnail.tsx
  • src/components/MessageComposer/AttachmentPreviewList/MediaAttachmentPreview.tsx
  • src/components/MediaRecorder/AudioRecorder/AudioRecordingButtonWithNotification.tsx
  • src/context/ComponentContext.tsx
  • src/components/TextareaComposer/SuggestionList/MentionItem/RoleItem.tsx
  • src/components/Poll/PollCreationDialog/PollOptionReorderHandle.tsx
  • src/components/Attachment/components/DownloadButton.tsx
  • src/components/Message/MessageStatus.tsx
  • src/components/ChannelListItem/ChannelListItemActionButtons.defaults.tsx
  • src/components/Attachment/tests/Giphy.test.tsx
  • src/components/TextareaComposer/SuggestionList/MentionItem/BroadcastMentionItem.tsx
  • src/plugins/ChannelDetail/ChannelDetailSearchInput.tsx
  • src/components/Message/MessageDeletedBubble.tsx
  • src/components/Attachment/Giphy.tsx
  • src/components/Icons/slots.ts
  • src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersBrowseView.tsx
  • src/components/Attachment/LinkPreview/Card.tsx
  • src/components/Button/PlayButton.tsx
  • src/components/Notifications/Notification.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersAddView.tsx
  • src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementView.tsx
  • src/components/MessageComposer/tests/CommandChip.test.tsx
  • src/components/Poll/PollCreationDialog/PollCreationDialogControls.tsx
  • src/components/Reactions/MessageReactionsDetail.tsx
  • src/components/MessageComposer/AttachmentSelector/AttachmentSelector.tsx
  • src/components/TextareaComposer/tests/CommandItem.test.tsx
  • src/plugins/ChannelDetail/Views/ChannelMemberDetailView/ChannelMemberActions.defaults.tsx
  • src/plugins/ChannelDetail/Views/ChannelMediaView/tests/ChannelMediaView.test.tsx
  • src/plugins/Emojis/EmojiPicker.tsx
  • src/components/Avatar/Avatar.tsx
  • src/components/Dialog/components/Callout.tsx
  • src/components/MessageComposer/LinkPreviewList.tsx
  • src/components/MessageComposer/WithDragAndDropUpload.tsx
  • src/components/Form/NumericInput.tsx
  • src/components/Location/ShareLocationDialog.tsx
  • src/components/Gallery/GalleryHeader.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/tests/ChannelMembersView.test.tsx
  • src/plugins/ChannelDetail/Views/ChannelFilesView/tests/ChannelFilesView.test.tsx
  • src/components/Badge/Badge.tsx
  • src/components/MessageBounce/MessageBouncePrompt.tsx
  • src/components/MessageComposer/AttachmentPreviewList/GeolocationPreview.tsx
  • src/plugins/ChannelDetail/Views/PinnedMessagesView/tests/PinnedMessagesView.test.tsx
  • src/components/MessageComposer/AttachmentPreviewList/FileAttachmentPreview.tsx
  • src/components/Reactions/ReactionSelector.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersHeaderActions.defaults.tsx
  • src/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementActions.defaults.tsx
  • src/components/Attachment/VisibilityDisclaimer.tsx
  • src/components/Badge/MediaBadge.tsx
  • src/components/Form/TextInput.tsx
  • src/components/Icons/index.ts
  • src/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.tsx
  • src/plugins/ChannelDetail/Views/ChannelMembersView/tests/ChannelMembersAddView.test.tsx
  • src/components/Attachment/UnsupportedAttachment.tsx
  • src/components/MessageActions/MessageActions.defaults.tsx
  • src/components/ChatView/ChatView.tsx
  • src/components/Message/ReminderNotification.tsx
  • src/plugins/ChannelDetail/Views/ChannelMemberDetailView/tests/ChannelMemberDetail.test.tsx
  • src/plugins/ChannelDetail/tests/ChannelManagementView.test.tsx
  • src/components/Dialog/components/Viewer.tsx
  • src/components/Dialog/components/ContextMenu.tsx
  • src/components/EmptyStateIndicator/EmptyStateIndicator.tsx
  • src/components/MessageComposer/AttachmentSelector/CommandsMenu.tsx

Comment on lines +23 to +32
return useMemo(() => {
const definedOverrides = Object.fromEntries(
Object.entries(icons ?? {}).filter(([, Icon]) => typeof Icon === 'function'),
);

return { ...DEFAULT_ICONS, ...definedOverrides };

// Component should be stable.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚑ Quick win

Recompute icons when the context override changes.

icons is read from context but omitted from the useMemo dependency array, so mounted consumers retain the initial icon map when WithComponents receives new overrides. Remove the suppression and depend on icons.

Proposed fix
-  }, []);
-
-    // Component should be stable.
-    // eslint-disable-next-line react-hooks/exhaustive-deps
+  }, [icons]);
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return useMemo(() => {
const definedOverrides = Object.fromEntries(
Object.entries(icons ?? {}).filter(([, Icon]) => typeof Icon === 'function'),
);
return { ...DEFAULT_ICONS, ...definedOverrides };
// Component should be stable.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return useMemo(() => {
const definedOverrides = Object.fromEntries(
Object.entries(icons ?? {}).filter(([, Icon]) => typeof Icon === 'function'),
);
return { ...DEFAULT_ICONS, ...definedOverrides };
}, [icons]);
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/context/useComponentContextIcons.ts` around lines 23 - 32, Update the
useMemo in useComponentContextIcons to include the context icons value in its
dependency array, so definedOverrides and the merged DEFAULT_ICONS result
recompute when overrides change. Remove the exhaustive-deps suppression comment
while preserving the existing filtering and merge behavior.

@arnautov-anton
arnautov-anton merged commit 972b68c into master Jul 29, 2026
14 checks passed
@arnautov-anton
arnautov-anton deleted the add-icons-to-component-context branch July 29, 2026 14:25
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