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

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