Extend search to match tool input content, not just message body

The search index (app.tsx) and the per-message match check
(SessionViewer.tsx) now also search msg.toolInput when present.
This means searching for a file path, command, or argument that
appears in a tool call's input will correctly highlight and
navigate to that message, rather than dimming it as a non-match.

Both locations use the same compound condition so the match index
and the visual dimming/focus logic stay in sync.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-30 09:34:20 -05:00
parent bba678568a
commit 4c5d6dd4c8
2 changed files with 9 additions and 2 deletions

View File

@@ -30,7 +30,12 @@ export function App() {
if (!filters.searchQuery) return []; if (!filters.searchQuery) return [];
const lq = filters.searchQuery.toLowerCase(); const lq = filters.searchQuery.toLowerCase();
return filteredMessages.reduce<number[]>((acc, msg, i) => { return filteredMessages.reduce<number[]>((acc, msg, i) => {
if (msg.content.toLowerCase().includes(lq)) acc.push(i); if (
msg.content.toLowerCase().includes(lq) ||
(msg.toolInput && msg.toolInput.toLowerCase().includes(lq))
) {
acc.push(i);
}
return acc; return acc;
}, []); }, []);
}, [filteredMessages, filters.searchQuery]); }, [filteredMessages, filters.searchQuery]);

View File

@@ -197,9 +197,11 @@ export function SessionViewer({
); );
} }
const msg = item.message; const msg = item.message;
const lq = searchQuery ? searchQuery.toLowerCase() : "";
const isMatch = const isMatch =
searchQuery && searchQuery &&
msg.content.toLowerCase().includes(searchQuery.toLowerCase()); (msg.content.toLowerCase().includes(lq) ||
(msg.toolInput && msg.toolInput.toLowerCase().includes(lq)));
const isDimmed = searchQuery && !isMatch; const isDimmed = searchQuery && !isMatch;
const isFocused = item.messageIndex === focusedIndex; const isFocused = item.messageIndex === focusedIndex;
return ( return (