From a612ea7bea2b6068c71baea40dbba44c902f1e54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Thu, 16 Apr 2026 21:36:37 -0400 Subject: [PATCH] fix(communication): set searchLoading=true in setSearchQuery setSearchQuery only incremented searchRequestId without flipping searchLoading, so the UI could not distinguish "searching" from "no results". Now loading flips true on non-empty query and clears (results + loading) on empty query. setSearchResults keeps the existing id-match logic to flip loading false on arrival. --- src/renderer/state/slices/communication.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/renderer/state/slices/communication.ts b/src/renderer/state/slices/communication.ts index e76df439..5aee53eb 100644 --- a/src/renderer/state/slices/communication.ts +++ b/src/renderer/state/slices/communication.ts @@ -33,6 +33,12 @@ export const createCommunicationSlice: StateCreator< set((state) => { state.searchQuery = query; state.searchRequestId += 1; + if (query === "") { + state.searchLoading = false; + state.searchResults = []; + } else { + state.searchLoading = true; + } }), setSearchScope: (scope) => set((state) => {