fix(app): tell the user when a search query has nothing to search (#1901)

This commit is contained in:
Hampus authored and GitHub committed 2026-08-24 12:42:20 +02:00
1 parent bb34c73069
commit b71ced9b2e
8 files changed
+303 -136

No files matched your search

@@ -24,6 +24,7 @@ class ChannelSearchContext {
activeSearchQuery: string = '';
activeSearchSegments: Array<SearchSegment> = [];
isSearchActive = false;
unsearchableQuery = '';
isInputFocused = false;
searchRefreshKey = 0;
machineSnapshot: SearchMachineSnapshot = createSearchMachineSnapshot();
@@ -74,10 +75,28 @@ class ChannelSearch {
const context = this.getContext(contextId);
context.activeSearchQuery = query;
context.activeSearchSegments = [...segments];
context.unsearchableQuery = '';
context.isSearchActive = true;
context.searchRefreshKey += 1;
}
setUnsearchableSearch(contextId: string, query: string): void {
const context = this.getContext(contextId);
context.activeSearchQuery = '';
context.activeSearchSegments = [];
context.unsearchableQuery = query;
context.isSearchActive = true;
context.searchRefreshKey += 1;
context.lastSearchQuery = '';
context.lastSearchSegments = [];
context.lastSearchRefreshKey = null;
context.lastSearchScope = null;
context.lastSearchSortMode = null;
context.machineSnapshot = transitionSearchMachineSnapshot(context.machineSnapshot, {
type: 'channelSearch.reset',
});
}
setIsSearchActive(contextId: string, value: boolean): void {
const context = this.getContext(contextId);
context.isSearchActive = value;
@@ -94,6 +113,7 @@ class ChannelSearch {
context.searchSegments = [];
context.activeSearchQuery = '';
context.activeSearchSegments = [];
context.unsearchableQuery = '';
context.isSearchActive = false;
context.searchRefreshKey = 0;
context.lastSearchRefreshKey = null;