feat(message): implement message search functionality
Some checks failed
Frontend CI / ota-android (push) Successful in 1m19s
Frontend CI / ota-ios (push) Successful in 1m50s
Frontend CI / build-and-push-web (push) Successful in 3m28s
Frontend CI / build-android-apk (push) Failing after 8m56s

Add ability to search messages within a specific conversation. This includes:
- New `MessageSearchScreen` for displaying search results.
- `MessageRepository.searchByConversation` to query messages by keyword and conversation ID.
- Integration of search entry points in `GroupInfoScreen` and `PrivateChatInfoScreen`.
- Support for scrolling to a specific message sequence (`scrollToSeq`) when navigating from search results.
- Enhanced `HighlightText` component to support custom highlight styles.

feat(message): implement message search functionality
This commit is contained in:
2026-05-14 02:26:32 +08:00
parent ea2cf7bcff
commit d8d2b03f94
10 changed files with 462 additions and 10 deletions

View File

@@ -5,9 +5,10 @@ interface HighlightTextProps {
text: string;
keyword: string;
style?: StyleProp<TextStyle>;
highlightStyle?: StyleProp<TextStyle>;
}
const HighlightText: React.FC<HighlightTextProps> = ({ text, keyword, style }) => {
const HighlightText: React.FC<HighlightTextProps> = ({ text, keyword, style, highlightStyle }) => {
const parts = useMemo(() => {
if (!text || !keyword) return [{ text, highlight: false }];
@@ -37,12 +38,10 @@ const HighlightText: React.FC<HighlightTextProps> = ({ text, keyword, style }) =
}, [text, keyword]);
return (
<Text>
<Text style={style}>
{parts.map((part, i) =>
part.highlight ? (
<Text key={i} style={style}>
{part.text}
</Text>
<Text key={i} style={highlightStyle}>{part.text}</Text>
) : (
<Text key={i}>{part.text}</Text>
)