← Back to PRs

#20211: feat(webchat): add search UI for chat history

by aleiby open 2026-02-18 17:18 View on GitHub →
app: web-ui gateway size: L
## Summary Closes #19725 Add a search bar to the web chat UI for searching through chat message history. Builds on the `chat.search` gateway method from PR #19722. - **Search toggle** — magnifying glass icon in chat controls toolbar toggles the search panel - **Search bar** — text input with Enter-to-search, Escape-to-close - **Results panel** — displays matches with role and snippet, match count - **Backend included** — cherry-picks the `chat.search` backend from #19722 (with review fixes) ## Changes ### UI - `views/chat.ts` — search bar component with input, results list, empty state - `app-render.helpers.ts` — search toggle button in chat controls toolbar - `app-render.ts` — wire search props and `searchChatHistory()` calls - `app.ts` / `app-view-state.ts` — `chatSearchOpen`, `chatSearchQuery`, `chatSearchResults`, `chatSearchLoading` state - `styles/chat/layout.css` — search bar and results panel styling ### Backend (cherry-picked from #19722) - `chat.search` gateway method with `searchSessionTranscript()` helper - `searchContent` param for `sessions.list` cross-session content search - Compaction index alignment fix and sessionFile/agentId passthrough fix ## Test plan - [x] `pnpm test -- --run src/gateway/session-utils.fs.test.ts` — 52 tests pass - [x] `pnpm test -- --run src/gateway/session-utils.test.ts` — 39 tests pass - [x] `npx tsc --noEmit` — clean type check - [ ] CI checks on upstream ## Note on pagination interaction `chat.search` reads the full JSONL transcript server-side, finding matches across the entire session regardless of what the client has loaded. A future improvement could add "jump to result" by coordinating with cursor-based pagination (#19754). ## AI-assisted This PR was developed with AI assistance (Opus 4.6). All changes have been reviewed and tested. --- 🤖 [Tackled](https://github.com/aleiby/claude-skills/tree/main/tackle) with [Claude Code](https://claude.com/claude-code)

Most Similar PRs