-
Notifications
You must be signed in to change notification settings - Fork 280
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 general purpose search components #2588
base: master
Are you sure you want to change the base?
Conversation
… components and types
…earchSourceResultListEnd
…ext' into feat/search-channel-by-message-text
…cusedMessage value
Size Change: +149 kB (+12.42%) Total Size: 1.35 MB
ℹ️ View Unchanged
|
examples/vite/src/App.tsx
Outdated
const isMessageAIGenerated = useCallback( | ||
(message: StreamMessage<StreamChatGenerics>) => !!message?.ai_generated, | ||
[], | ||
); |
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 we can move this out of the App
component completely.
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.
Moved out: fc2a860
fc2a860
to
ed3f7da
Compare
@@ -380,18 +398,29 @@ const UnMemoizedChannelList = < | |||
}, | |||
); | |||
|
|||
const showChannelList = !searchActive || additionalChannelSearchProps?.popupResults; | |||
const showChannelList = | |||
(!searchActive && !searchIsActive) || additionalChannelSearchProps?.popupResults; |
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.
Not sure what the difference between searchActive
and searchIsActive
is at first glance.
🎯 Goal
Provide general purpose search components and controller. Allow for absolute search customization.
Fixes React-24
Closes #1412
Depends on
🛠 Implementation details
Search controller
Coordinates search execution among individual search sources. Allows to combine unknown search sources defined by the integrator. Implements the search state machine.
Base search source
Takes care of common search source task like:
Search source
Class that takes advantage of inheriting from BaseSearchSource. Each search source should defined integrators or the default one is responsible for:
React components
The new components live in
experimental/Search
folder. This allows for component name duplication compared toChannelSearch
components.An important change is the ability to jump from a message search result to that message in the parent channel. Currently the information about the jumped-to-message is stored in the SearchController state, but this should be moved to a future message list controller state.
The searchController instance has been added to the
ChatContext
.ChannelList
allows to override theChannelSearch
component with the experimentalSearch
component asAlso
ChannelAvatar
has been added to the component context value as a separate key and is prioritized inChannelHeader
andChannelPreview
,Out of scope
🎨 UI Changes
VO0L.webm