feat(search): support from:username with no body text
Typing "from:jared" with no additional text now shows all cached messages from that user across all rooms. - SearchInput: call onSearch() even when only from: tokens were extracted (no remaining body text), passing an empty string term - useLocalMessageSearch: introduce senderOnlyMode (empty term + senders set) which searches ALL rooms instead of encrypted-only, and skips text matching — just filters by sender - MessageSearch: define hasActiveSearch / senderOnlyMode flags; use them to enable local search and fix placeholder/loading/results conditions; adapt local results section header and description Server-side search is skipped in sender-only mode (Matrix search API requires a search_term); results come from the local event cache. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -158,7 +158,10 @@ export function SearchInput({
|
||||
searchInputRef.current.value = searchTerm ?? '';
|
||||
}
|
||||
|
||||
if (searchTerm) onSearch(searchTerm);
|
||||
// Always trigger search when senders were extracted, even with no body text
|
||||
if (fromMatches.length > 0 || searchTerm) {
|
||||
onSearch(searchTerm ?? '');
|
||||
}
|
||||
closeAutocomplete();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user