feat(navigator): useNavigatorSearch query hook (P2 core)

useNitroQuery keyed on [currentTabCode, currentFilter] from
navigatorUiStore. Fires NavigatorSearchComposer; subscribes to
NavigatorSearchEvent with an accept-filter that rejects results whose
code does not match the current tab. Invalidates on FlatCreatedEvent
and RoomSettingsUpdatedEvent for server-driven refresh.

nitro-renderer.mock.ts: add connection.send stub to GetCommunication
so SendMessageComposer (which calls GetCommunication().connection.send)
does not throw in tests that exercise useNitroQuery.

TDD: 7 cases incl. enabled-gating, accept-filter rejection on
mismatched tab, invalidator round-trip.
This commit is contained in:
simoleo89
2026-05-27 19:18:24 +02:00
parent 8f1b664b2f
commit 7435326dad
3 changed files with 350 additions and 1 deletions
+3 -1
View File
@@ -533,7 +533,9 @@ export const GetCommunication = vi.fn(() => ({
{
const wrapper = _msgEventWrappers.get(event);
if(wrapper) msgListeners.get(event.type)?.delete(wrapper);
}
},
// Stub for SendMessageComposer which calls GetCommunication().connection.send(...)
connection: { send: vi.fn() }
}));
export const GetConfiguration = vi.fn(stubManager);
export const GetLocalizationManager = vi.fn(stubManager);