feat: add full-text search across conversations (#482)

* feat: add full-text search across conversations in sidebar

Add a search mode toggle (Projects/Conversations) to the sidebar search bar.
In Conversations mode, search text content across all JSONL session files
with debounced API calls, highlighted snippets, and click-to-navigate results.

* fix: address PR review feedback - session summary tracking, search sequence invalidation, fallback navigation, SSE streaming

- Track session summaries per-session in a Map instead of file-scoped variable
- Increment searchSeqRef when clearing conversation search to invalidate in-flight requests
- Add fallback session navigation when session not loaded in sidebar paging
- Stream search results via SSE for progressive display with progress indicator

* feat(search): add Codex/Gemini search and scroll-to-message navigation

- Search now includes Codex sessions (JSONL from ~/.codex/sessions/) and
  Gemini sessions (in-memory via sessionManager) in addition to Claude
- Search results include provider info and display a provider badge
- Click handler resolves the correct provider instead of hardcoding claude
- Clicking a search result loads all messages and scrolls to the matched
  message with a highlight flash animation

* fix(search): Codex search path matching and scroll reliability

- Fix Codex search scanning all sessions for every project by checking
  session_meta cwd match BEFORE scanning messages (was inflating match
  count and hitting limit before reaching later projects)
- Fix Codex search missing user messages in response_item entries
  (role=user with input_text content parts)
- Fix scroll-to-message being overridden by initial scrollToBottom
  using searchScrollActiveRef to inhibit competing scroll effects
- Fix snippet matching using contiguous substring instead of
  filtered words (which created non-existent phrases)

* feat(search): add Gemini CLI session support for search and history viewing

Gemini CLI sessions stored in ~/.gemini/tmp/<project>/chats/*.json are now
indexed for conversation search and can be loaded for viewing. Previously
only sessions created through the UI (sessionManager) were searchable.

* fix(search): full-word matching and longer highlight flash

- Search now uses word boundaries (\b) instead of substring matching,
  so "hi" no longer matches "this"
- Highlight flash extended to 4s with thicker outline and subtle
  background tint for better visibility
This commit is contained in:
Eric Blanquer
2026-03-06 14:59:23 +01:00
committed by GitHub
parent d299ab88a0
commit 3950c0e47f
14 changed files with 1383 additions and 46 deletions

View File

@@ -46,7 +46,8 @@
"editSessionName": "Manually edit session name",
"deleteSession": "Delete this session permanently",
"save": "Save",
"cancel": "Cancel"
"cancel": "Cancel",
"clearSearch": "Clear search"
},
"navigation": {
"chat": "Chat",
@@ -103,6 +104,18 @@
"version": {
"updateAvailable": "Update available"
},
"search": {
"modeProjects": "Projects",
"modeConversations": "Conversations",
"conversationsPlaceholder": "Search in conversations...",
"searching": "Searching...",
"noResults": "No results found",
"tryDifferentQuery": "Try a different search query",
"matches_one": "{{count}} match",
"matches_other": "{{count}} matches",
"projectsScanned_one": "{{count}} project scanned",
"projectsScanned_other": "{{count}} projects scanned"
},
"deleteConfirmation": {
"deleteProject": "Delete Project",
"deleteSession": "Delete Session",

View File

@@ -46,7 +46,8 @@
"editSessionName": "手动编辑会话名称",
"deleteSession": "永久删除此会话",
"save": "保存",
"cancel": "取消"
"cancel": "取消",
"clearSearch": "清除搜索"
},
"navigation": {
"chat": "聊天",
@@ -103,6 +104,18 @@
"version": {
"updateAvailable": "有可用更新"
},
"search": {
"modeProjects": "项目",
"modeConversations": "对话",
"conversationsPlaceholder": "搜索对话内容...",
"searching": "搜索中...",
"noResults": "未找到结果",
"tryDifferentQuery": "尝试不同的搜索词",
"matches_one": "{{count}} 个匹配",
"matches_other": "{{count}} 个匹配",
"projectsScanned_one": "{{count}} 个项目已扫描",
"projectsScanned_other": "{{count}} 个项目已扫描"
},
"deleteConfirmation": {
"deleteProject": "删除项目",
"deleteSession": "删除会话",