-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add ThreadList and ThreadProvider (Threads 2.0) #2407
Conversation
eb1dfe5
to
386105c
Compare
d60dd9b
to
ffc1389
Compare
cb06b65
to
e5e0cd9
Compare
0b4c146
to
d897374
Compare
295c64b
to
cd5542d
Compare
a5173e8
to
b39a276
Compare
7be0df7
to
a624062
Compare
1456257
to
8f19a9e
Compare
d943262
to
56039ae
Compare
b3555bb
to
bd094cc
Compare
VirtualMessage: props.VirtualMessage, | ||
}), | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
[props.reactionOptions], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was by design, changing overrides "in runtime" is not a good idea.
Size Change: +18.8 kB (+1.82%) Total Size: 1.05 MB
ℹ️ View Unchanged
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2407 +/- ##
==========================================
- Coverage 85.52% 84.50% -1.03%
==========================================
Files 369 384 +15
Lines 7864 8105 +241
Branches 1908 1955 +47
==========================================
+ Hits 6726 6849 +123
- Misses 1046 1165 +119
+ Partials 92 91 -1 ☔ View full report in Codecov by Sentry. |
79e9b6e
to
ad615d4
Compare
🚂 GetStream/stream-chat-js#1330 This PR adds components for implementing a thread list view: ThreadList and ChatView. It also adds support for reactive state stores, like the ones that handle the thread list logic in the client. Implements a binding from the reactive state store in the client to React components. Implements a thread list. The component itself consists mostly of binding to the `ThreadManager` instance in the client. The Thread component was modified to optionally use a reactive `Thread` instance from the `ThreadContext`. The component checks if `ThreadContext` is provided, and if so uses the thread instance from that context. Otherwise, it falls back to the `ChannelContext` as usual. Currently, we use `ThreadContext` in the thread list view, where it is provided by the `ChatView.ThreadAdapter` component. Note that even when `ThreadContext` is used, `ChannelContext` also must be provided. Most our components, including the ones used in threads, still expect the channel context to be there. A set of components implementing a simple in-memory router to switch between channel view and thread list view. Using it is totally optional. Most integrations will probably use their own router instead. Still, nice to have something out-of-the-box. A new way to provide component overrides. Previously we allowed passing component overrides as props to `Channel` component, and then in some nested components as well, although not consistently. `WithComponents` is a new recommended way to provide component overrides, which requires far less prop drilling and nests nicely. --------- Co-authored-by: Matvei Andrienko <m.y.andrienko@outlook.com> BREAKING CHANGE: ComponentContext no longer provides any defaults
🚂 GetStream/stream-chat-js#1330 This PR adds components for implementing a thread list view: ThreadList and ChatView. It also adds support for reactive state stores, like the ones that handle the thread list logic in the client. Implements a binding from the reactive state store in the client to React components. Implements a thread list. The component itself consists mostly of binding to the `ThreadManager` instance in the client. The Thread component was modified to optionally use a reactive `Thread` instance from the `ThreadContext`. The component checks if `ThreadContext` is provided, and if so uses the thread instance from that context. Otherwise, it falls back to the `ChannelContext` as usual. Currently, we use `ThreadContext` in the thread list view, where it is provided by the `ChatView.ThreadAdapter` component. Note that even when `ThreadContext` is used, `ChannelContext` also must be provided. Most our components, including the ones used in threads, still expect the channel context to be there. A set of components implementing a simple in-memory router to switch between channel view and thread list view. Using it is totally optional. Most integrations will probably use their own router instead. Still, nice to have something out-of-the-box. A new way to provide component overrides. Previously we allowed passing component overrides as props to `Channel` component, and then in some nested components as well, although not consistently. `WithComponents` is a new recommended way to provide component overrides, which requires far less prop drilling and nests nicely. BREAKING CHANGE: ComponentContext no longer provides any defaults --------- Co-authored-by: Matvei Andrienko <m.y.andrienko@outlook.com>
## [12.0.0-rc.11](v12.0.0-rc.10...v12.0.0-rc.11) (2024-09-04) ### ⚠ BREAKING CHANGES * ComponentContext no longer provides any defaults ### Bug Fixes * MessageActions adjustments ([#2472](#2472)) ([fbd1b6f](fbd1b6f)) * quote replies in threads ([#2487](#2487)) ([0e4a6f1](0e4a6f1)) ### Features * add ThreadList and ThreadProvider (Threads 2.0) ([#2407](#2407)) ([941707d](941707d)) ### Chores * **deps:** bump version of stream-chat in peerDeps ([#2481](#2481)) ([466385d](466385d))
## [12.0.0](v11.23.9...v12.0.0) (2024-09-17) ### ⚠ BREAKING CHANGES * - own user will not anymore be filtered out of the selection list of users to mention if `mentionAllAppUsers` is enabled on MessageInput * - removes the following variables from `MessageContext`: isReactionEnabled, onReactionListClick, showDetailedReactions, reactionSelectorRef - removes prop `messageWrapperRef` from `MessageOptions` and `MessageActions` props. * ComponentContext no longer provides any defaults * removed Thread prop fullWidth, removed class str-chat__thread--full * removed Window prop hideOnThread, replaced class str-chat__main-panel--hideOnThread with str-chat__main-panel--thread-open * MP3 audio encoder has to be explicitly imported and used as a plugin for audio recordings. The default audio recording format is audio/wav. * @breezystack/lamejs became a peer dependency and has to be installed by the integrator so that the MP3 audio encoder can work properly. * Removed fileOrder, imageOrder, fileUploads, imageUploads, uploadFile, uploadImage, removeFile, removeImage from the MessageInputContext. Use attachments, uploadAttachment, uploadNewFiles, upsertAttachments, removeAttachments instead. * Removed default values for timestamp formatting props like calendar or format for DateSeparator, EventComponent, MessageTimestamp. The formatting configuration now entirely relies on i18n translations. * The VirtualizedMessageList does not provide default Footer component * The VirtualizedMessageList markup has changed as TypingIndicator is rendered as a child of MessageListMainPanel * stylesheet import path changed & v1 stylesheet has been dropped, see release guide for more information * theme v1 related markup and classNames have been removed * `themeVersion` property has been removed from `ChatContext` ### Bug Fixes * add theme to ChatView component ([#2494](#2494)) ([d477072](d477072)) * address the circular dependencies among TranslationContext and Streami18n ([#2483](#2483)) ([b91fd9a](b91fd9a)) * change platform for CJS bundle from node to browser ([#2454](#2454)) ([4bc2d35](4bc2d35)) * do not rerender on client options update ([#2465](#2465)) ([3899352](3899352)) * export typeVersions correctly for emojis and mp3-encoder ([#2449](#2449)) ([17218db](17218db)) * extract MP3 encoder plugin ([#2447](#2447)) ([625196f](625196f)) * provide both browser and node cjs bundles ([#2457](#2457)) ([273ea2a](273ea2a)) * quote replies in threads ([#2487](#2487)) ([0e4a6f1](0e4a6f1)) * remove the use of deprecated query operator $ne ([#2504](#2504)) ([09614f6](09614f6)) * render typing indicator outside the VirtualizedMessageList scroll container ([#2406](#2406)) ([d9442d2](d9442d2)) * reuse useChannelPreviewInfo for ThreadListItemUI ([#2508](#2508)) ([4bb5b7c](4bb5b7c)) * update ChannelHeader and ChannelPreview titles and images on channel.updated ([#2500](#2500)) ([f32fbb6](f32fbb6)) ### Features * add centralized dialog management ([#2489](#2489)) ([8235d45](8235d45)) * add ThreadList and ThreadProvider (Threads 2.0) ([#2407](#2407)) ([941707d](941707d)) * keep attachments array and remove file and image uploads in MessageInput state ([#2445](#2445)) ([238e801](238e801)) * remove default timestamp formatting props from DateSeparator, EventComponent, MessageTimestamp ([#2442](#2442)) ([6431954](6431954)) * remove fullWidth prop from Thread & hideOnThread prop from Window ([#2450](#2450)) ([32c8fc0](32c8fc0)) * remove legacy style components ([#2394](#2394)) ([7bf63ae](7bf63ae)) ### Chores * **deps:** bump @stream-io/stream-chat-css to version 5.0.0 ([9580a3f](9580a3f)) * **deps:** bump @stream-io/stream-chat-css to version 5.0.0-rc.1nvm ([e9cf42f](e9cf42f)) * **deps:** bump stream-chat to version 8.40.8 ([#2510](#2510)) ([5cc7a09](5cc7a09)) * **deps:** remove unused isomorphic-ws from dependencies ([853bd8b](853bd8b)) * **deps:** upgrade @stream-io/stream-chat-css to v5.0.0-rc.4 ([#2492](#2492)) ([6e30cb5](6e30cb5)) * **deps:** upgrade @stream-io/stream-chat-css to v5.0.0-rc.5 ([#2495](#2495)) ([2b8fa32](2b8fa32))
🚂 GetStream/stream-chat-js#1330
This PR adds components for implementing a thread list view: ThreadList and ChatView. It also adds support for reactive state stores, like the ones that handle the thread list logic in the client.
useStateStore
Implements a binding from the reactive state store in the client to React components.
ThreadList
Implements a thread list. The component itself consists mostly of binding to the
ThreadManager
instance in the client.Thread
The Thread component was modified to optionally use a reactive
Thread
instance from theThreadContext
. The component checks ifThreadContext
is provided, and if so uses the thread instance from that context. Otherwise, it falls back to theChannelContext
as usual.Currently, we use
ThreadContext
in the thread list view, where it is provided by theChatView.ThreadAdapter
component.Note that even when
ThreadContext
is used,ChannelContext
also must be provided. Most our components, including the ones used in threads, still expect the channel context to be there.ChatView
A set of components implementing a simple in-memory router to switch between channel view and thread list view. Using it is totally optional. Most integrations will probably use their own router instead. Still, nice to have something out-of-the-box.
WithComponents
A new way to provide component overrides. Previously we allowed passing component overrides as props to
Channel
component, and then in some nested components as well, although not consistently.WithComponents
is a new recommended way to provide component overrides, which requires far less prop drilling and nests nicely.BREAKING CHANGE: ComponentContext no longer provides any defaults