refactor(navigator): remove search ownership from useNavigatorStore

P2 core surgery: search result + NavigatorSearchEvent listener +
sendSearch + reloadCurrentSearch all leave useNavigatorStore. The new
useNavigatorSearch query hook owns the cache. useNavigatorActions is
deleted entirely — the only two actions it exposed are gone, and no
consumer outside Navigator depended on it.

NavigatorMetadataEvent handler now seeds the UI store's currentTabCode
on first arrival, activating the query the moment top-level contexts
land.

useNavigatorData: searchResult removed from closure and return.
useNavigatorUiState: currentTabCode + currentFilter added.
index.ts: useNavigatorActions removed, useNavigatorSearch added.

NavigatorView.tsx is intentionally broken at this commit and gets
fixed in the next.
This commit is contained in:
simoleo89
2026-05-27 19:20:27 +02:00
parent 7435326dad
commit ee3736474d
6 changed files with 18 additions and 90 deletions
+4 -1
View File
@@ -11,8 +11,11 @@ export const useNavigatorUiState = () =>
const isLoading = useNavigatorUiStore(s => s.isLoading);
const needsInit = useNavigatorUiStore(s => s.needsInit);
const needsSearch = useNavigatorUiStore(s => s.needsSearch);
const currentTabCode = useNavigatorUiStore(s => s.currentTabCode);
const currentFilter = useNavigatorUiStore(s => s.currentFilter);
return {
isVisible, isReady, isCreatorOpen, isRoomInfoOpen, isRoomLinkOpen,
isOpenSavesSearches, isLoading, needsInit, needsSearch
isOpenSavesSearches, isLoading, needsInit, needsSearch,
currentTabCode, currentFilter
};
};