chore: adjust MessageReactionsDetail to match design spec#3065
chore: adjust MessageReactionsDetail to match design spec#3065arnautov-anton merged 1 commit intomasterfrom
Conversation
|
Size Change: +254 B (+0.03%) Total Size: 775 kB
ℹ️ View Unchanged
|
082cae5 to
c94036c
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3065 +/- ##
=======================================
Coverage 79.23% 79.23%
=======================================
Files 426 426
Lines 12221 12234 +13
Branches 3912 3918 +6
=======================================
+ Hits 9683 9694 +11
- Misses 2538 2540 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d46ae38 to
4a45a09
Compare
src/context/ChannelListContext.tsx
Outdated
| if (componentName && remainingWarningCount > 0) { | ||
| console.warn( | ||
| `The useChannelListContext hook was called outside of the ChannelListContext provider. Make sure this hook is called within the ChannelList component. The errored call is located in the ${componentName} component.`, | ||
| ); | ||
|
|
||
| remainingWarningCount -= 1; | ||
| } |
There was a problem hiding this comment.
I'm not sure if this is a good idea, as this shows bad integrations one by one instead of all at once.
What do you think?
There was a problem hiding this comment.
I'm more inclined to remove these altogether as you shouldn't get a warning if you decide to use this hook in a component that can comfortably live in multiple contexts:
const HybridComponent = () => {
const context1 = useChannelListContext();
const context2 = useChannelStateContext();
const channels: Channel[] = context1?.channels ?? [context2.channel] ?? [];
return ...
}There was a problem hiding this comment.
This is an example but now we do have hooks that do something similar and now these hooks produce irrelevant warnings.
There was a problem hiding this comment.
I am removing the warning in my PR for context menu animations
There was a problem hiding this comment.
ok, good to completely remove the warning too.
4a45a09 to
a9fd1ad
Compare
New Exports
MessageReactionsDetailLoadingIndicatorNew exported component from
stream-chat-react. Renders a skeleton loading state (3 placeholder items) for the reactions detail user list. Can be used standalone or as a replacement viaComponentContext.LoadingIndicator.Behavioral Changes
MessageReactionsDetail— reaction type filter is now toggleableClicking an already-selected reaction type in the detail view now deselects it (sets the filter to
null), showing all reactions. Previously, clicking the active type was a no-op.MessageReactionsDetail— reaction emoji shown per user rowWhen no reaction type filter is active (
selectedReactionType === null), each user row in the detail list now displays the emoji icon for the reaction type that user sent. This usesreactionOptionsfromComponentContext.MessageReactionsDetail— usesComponentContext.reactionOptionsThe component now reads
reactionOptionsfromComponentContextto resolve emoji components for individual reaction rows.useFetchReactions— fetches all reactions whenreactionTypeisnullPreviously, the hook short-circuited and skipped fetching when
reactionTypewasnull. It now proceeds with the fetch, passingundefinedto the handler, which retrieves all reaction types. This is what enables the "show all reactions" view.MessageReactions—aria-pressed/aria-expandedon clustered reaction buttonThe clustered reactions list button now includes an
aria-pressedandaria-expandedattribute reflecting whether the reactions detail dialog is open. Improves accessibility for screen readers.useChannelListContext— warning throttled to single emissionThe console warning emitted when
useChannelListContextis called outside its provider is now limited to one occurrence (module-level counter). Previously, every call without a provider triggered the warning, which could flood the console.Additionally, the warning is now suppressed entirely when
componentNameis not provided.