From 27f89d25a3b74a71b9bfcf84edf649506c67c9a1 Mon Sep 17 00:00:00 2001 From: wyyd-yxc <2868299717@qq.com> Date: Sat, 12 Sep 2026 12:12:30 +0800 Subject: [PATCH] Fix global search "view all results" omitting notes matches (#12482) (#12832) The search drawer searches notes when the notes-search setting is enabled, but the "view all results" link only carried the plain search term - so results that matched only via their notes were missing from the full results table. Pass the search_notes flag through to the overview table URL when notes search is active; the table forwards URL query parameters to the API, where InvenTreeSearchFilter already supports search_notes. --- src/frontend/src/components/nav/SearchDrawer.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/components/nav/SearchDrawer.tsx b/src/frontend/src/components/nav/SearchDrawer.tsx index 1b514ef3a9..a06b774a3c 100644 --- a/src/frontend/src/components/nav/SearchDrawer.tsx +++ b/src/frontend/src/components/nav/SearchDrawer.tsx @@ -78,7 +78,8 @@ function QueryResultGroup({ navigate, onClose, onRemove, - onResultClick + onResultClick, + searchNotes }: Readonly<{ searchText: string; query: SearchQuery; @@ -86,6 +87,7 @@ function QueryResultGroup({ onClose: () => void; onRemove: (query: ModelType) => void; onResultClick: (query: ModelType, pk: number, event: any) => void; + searchNotes: boolean; }>) { const modelInfo = useMemo(() => getModelInfo(query.model), [query.model]); @@ -104,7 +106,11 @@ function QueryResultGroup({ cancelEvent(event); if (overviewUrl) { - const url = `${overviewUrl}?search=${searchText}`; + // Keep the notes-search context so results found via their notes + // are also present in the full results table view + const url = `${overviewUrl}?search=${searchText}${ + searchNotes ? '&search_notes=true' : '' + }`; // Close drawer if opening in the same tab if (!eventModified(event)) { @@ -121,7 +127,7 @@ function QueryResultGroup({ }); } }, - [overviewUrl, searchText] + [overviewUrl, searchText, searchNotes] ); if (query.results.count == 0) { @@ -592,6 +598,7 @@ export function SearchDrawer({ query={query} navigate={navigate} onClose={closeDrawer} + searchNotes={searchNotes} onRemove={(query) => removeResults(query)} onResultClick={(query, pk, event) => onResultClick(query, pk, event)