Skip to content

search session message content#152

Merged
tulsi-builder merged 4 commits intomainfrom
codex/tulsi/session-search-pr
Apr 10, 2026
Merged

search session message content#152
tulsi-builder merged 4 commits intomainfrom
codex/tulsi/session-search-pr

Conversation

@tulsi-builder
Copy link
Copy Markdown
Collaborator

@tulsi-builder tulsi-builder commented Apr 10, 2026

Category: new-feature
User Impact: Users can search chat sessions by message content from Session History and the sidebar, then jump directly to the matching message.
Problem: Goose2 only searched session metadata, so people could not reliably recover a past conversation when the remembered detail lived inside the chat body. Search results also needed to keep Goose2-local titles, persona/project metadata, and archive filtering instead of trusting exported session metadata.
Solution: This adds a backend-assisted message search path that scans exported session content while leaving display metadata in the frontend session store. Session History and the sidebar each manage their own submit-on-Enter search state, merge message matches with existing metadata matches, and open sessions at the matched message with a fallback scroll target when replayed message IDs differ.

File changes

src-tauri/src/commands/acp.rs
Adds the new Tauri command for session search and wires it to the ACP manager so the frontend can request message-content matches.

src-tauri/src/lib.rs
Registers the new search command with the Tauri invoke handler.

src-tauri/src/services/acp/mod.rs
Exports the new ACP search module and its result type from the service layer.

src-tauri/src/services/acp/search.rs
Implements exported-session parsing, searchable block filtering, snippet generation, match counting, and Rust tests for message search behavior.

src/app/AppShell.tsx
Adds a shared search-result selection handler that stores scroll targets before opening the chosen session.

src/app/ui/AppShellContent.tsx
Passes the new search-result selection callback into Session History.

src/features/chat/stores/tests/chatStore.test.ts
Adds coverage for storing and clearing per-session scroll targets.

src/features/chat/stores/chatStore.ts
Introduces per-session scroll-target state so search results can reopen a session and focus the matched message.

src/features/chat/ui/ChatView.tsx
Threads scroll-target data into the message timeline and keeps the chat view under the repo file-size limit.

src/features/chat/ui/MessageTimeline.tsx
Handles search-result scrolling and the fallback match lookup when replayed message IDs do not line up exactly.

src/features/sessions/hooks/useSessionSearch.ts
Creates the shared search hook that combines metadata matches with backend message-content matches on submit.

src/features/sessions/lib/buildSessionSearchResults.test.ts
Adds unit coverage for result merging, ranking, and metadata preservation.

src/features/sessions/lib/buildSessionSearchResults.ts
Builds display-ready search results by joining backend matches with frontend session metadata and snippets.

src/features/sessions/ui/SessionCard.tsx
Extends session cards to display message snippets and match counts in search results.

src/features/sessions/ui/SessionHistoryView.tsx
Reworks Session History search to use submitted queries, show loading and empty states, and route message matches through the new selection flow.

src/features/sidebar/ui/Sidebar.tsx
Replaces metadata-only sidebar filtering with scoped session search, submit-on-Enter behavior, loading and empty states, and the search-input chrome cleanup.

src/features/sidebar/ui/SidebarSearchResults.tsx
Adds a dedicated sidebar results list that renders message snippets and match counts in the compact navigation surface.

src/shared/api/acp.ts
Adds the frontend ACP search API contract and invoke helper.

src/shared/i18n/locales/en/sessions.json
Adds Session History copy for message search placeholders, loading states, errors, and match counts.

src/shared/i18n/locales/en/sidebar.json
Adds sidebar search copy for message-search loading and fallback-error states.

src/shared/i18n/locales/es/sessions.json
Adds the Spanish equivalents for the new Session History search strings.

src/shared/i18n/locales/es/sidebar.json
Adds the Spanish equivalents for the new sidebar search strings.

src/shared/ui/SearchBar.tsx
Adds optional keydown handling so Session History can trigger search on Enter without changing the shared component shape elsewhere.

Screen.Recording.2026-04-10.at.3.26.23.PM.mov
  1. Open Session History and search for a phrase that appears only in a past message, then press Enter.
  2. Confirm the results show snippets and message match counts, and clicking one opens the session and scrolls to the matched message.
  3. Open the sidebar, run a different search, and confirm its query and results stay scoped to the sidebar.
  4. Search for a term with no matches and confirm both surfaces show explicit empty states instead of the normal session list.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6bd529b9b6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@tulsi-builder tulsi-builder merged commit 914e2b4 into main Apr 10, 2026
8 checks passed
@tulsi-builder tulsi-builder deleted the codex/tulsi/session-search-pr branch April 10, 2026 22:40
lifeizhou-ap added a commit to lifeizhou-ap/goose2 that referenced this pull request Apr 13, 2026
* main:
  show per-message assistant identity from metadata instead of props (block#156)
  add file-aware widgets to context panel, simplify session search (block#154)
  Add i18n and cross-boundary dead data checks to code review skill (block#153)
  search session message content (block#152)
  add workspace widget with git branch and worktree management (block#151)
  fix: strip XML wrapper from replayed user messages (block#150)
  feat: add file @-mention autocomplete with project file scanning (block#147)
  improve sidebar contrast and constrain model picker (block#149)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant