feat: migrate to components from ChannelActionContext and ChannelState context to dedicated StateStore instances and add layout control API #2909
Open
MartinCupela wants to merge 36 commits intomasterfrom
Open
Conversation
# Conflicts: # src/components/MessageList/MessageList.tsx # src/components/MessageList/renderMessages.tsx
…d Resolver Registry and Built-in Strategies
…rops) and Header Toggle Wiring for Entity List Pane
…reserving Hide/Unhide
…ependent of Channel contexts
… and Remove Entity Semantics from LayoutController (Slot-Only Controller)
…eSlotEntity and ChannelSlot
…read-on-mount, search-focused jump for Channel and rewrite Channel tests
…tton when irrelevant
…ges arrive in MessageList
…ad state snapshot
# Conflicts: # src/components/ChannelPreview/ChannelPreview.tsx # src/components/Message/MessageSimple.tsx # src/components/Threads/ThreadList/ThreadListItemUI.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on
GetStream/stream-chat-js#1674
Summary
This PR is a major architecture migration, not just message pagination.
It moves chat/thread runtime behavior from React-owned channel contexts to instance APIs in
stream-chat-js, introduces a slot-based ChatView layout controller, and rewires navigation/state to reactiveStateStore-driven sources (messagePaginator,configState,threads.state, etc.).Scope
ChannelActionContextandChannelStateContextruntime usage with instance APIs fromstream-chat-js.messagePaginatorand client instance APIs.configState.requestHandlers.What Changed
1) New ChatView Layout Control API
LayoutControllerstate model for slot topology, bindings, visibility, and per-slot history.ChatViewNavigationAPI:openView(view, { slot? })openChannel(channel, { slot? })closeChannel({ slot? })openThread(threadOrTarget, { slot? })closeThread({ slot? })hideChannelList({ slot? })unhideChannelList({ slot? })ChannelSlotThreadSlotChannelListSlotThreadListSlotuseSlotEntity,useSlotChannel,useSlotThreadserializeLayoutStaterestoreLayoutStatelayoutSlotResolversfor deterministic slot targeting.2) Channel/Thread Ownership Moved to stream-chat-js Instances
messagePaginatorand thread manager state.StateStore.useChatViewNavigation()(with legacy fallback deactivation inThread).3) Context Removal and Replacement
ChannelActionContextChannelStateContextTypingContextprovider path from Channel runtimeChannelInstanceContext+useChannel()as the channel resolution contract.useChannel()resolves from:ChannelInstanceContext4) Message Pagination + Unread/Focus Migration
useMessagePaginator()messagePaginator.jumpToMessage(...)messagePaginator.jumpToTheFirstUnreadMessage(...)messagePaginator.jumpToTheLatestMessage()messagePaginator.toHead()/toTail()messagePaginator.ingestItem(...)messagePaginator.removeItem(...)messagePaginator.unreadStateSnapshotclient.messageDeliveryReporterinstead of context actions.5) Request Handler Customization Moved to Instance Config
channel.configState.requestHandlersthread.configState.requestHandlersAPI Changes and Migration Guide
Navigation:
setActiveChannel/context actions -> ChatView navigationMessage jump/pagination: context methods -> paginator methods
Channel access: ChannelState/Action context -> useChannel()
Slot-based rendering (new recommended pattern)
Behavioral Notes
Testing
Breaking/Important for Integrators
🎨 UI Changes
No planned UI changes