Skip to content

Add chat history search feature to navigation panel#8447

Closed
vincenzopalazzo wants to merge 3 commits intoaaif-goose:mainfrom
vincenzopalazzo:feature/chat-history-search
Closed

Add chat history search feature to navigation panel#8447
vincenzopalazzo wants to merge 3 commits intoaaif-goose:mainfrom
vincenzopalazzo:feature/chat-history-search

Conversation

@vincenzopalazzo
Copy link
Copy Markdown
Contributor

This PR implements a search bar in the Goose navigation panel that allows users to search through their chat history by keywords, resolving #8440.

Summary

Adds a native search bar to the Goose UI for searching chat history, similar to ChatGPT's search functionality. The search is integrated into the navigation panel and works across both expanded and condensed display modes.

Features

  • Search input with debounced API calls to the existing /sessions/search endpoint (300ms debounce)
  • Real-time search results displayed in a dropdown showing session names and message counts
  • Keyboard shortcuts: Cmd/Ctrl+K to focus, Escape to close
  • Session status indicators: Shows streaming status, unread messages, and errors
  • Click to navigate: Clicking a result opens that session
  • Responsive design: Works in both expanded and condensed navigation modes

Technical Implementation

New Files

  • ui/desktop/src/components/conversation/ChatHistorySearch.tsx - Main search component with debounced input, results dropdown, and keyboard shortcuts

Modified Files

  • ui/desktop/src/components/Layout/ExpandedRenderer.tsx - Added search bar at top of grid
  • ui/desktop/src/components/Layout/CondensedRenderer.tsx - Added search bar (hidden in icon-only mode)

Backend

  • Uses existing /sessions/search endpoint from the server
  • No backend changes required - the search functionality is already implemented

Testing

The feature has been:

  • Formatted with Prettier
  • Linted with ESLint (no errors)
  • Type-checked (all type errors are pre-existing in other files)
  • Follows existing component patterns and styling conventions

Usage

  1. Open the Goose app navigation panel
  2. Type a keyword or phrase in the search bar at the top
  3. Results appear automatically as you type
  4. Click any result to open that session
  5. Press Cmd/Ctrl+K anywhere to focus the search input
  6. Press Escape to close the dropdown

Resolves #8440

When connecting to OAuth-protected MCP servers, goose now checks for
stored credentials before attempting an unauthenticated connection.
If credentials exist, it silently refreshes the token and connects
directly, avoiding the unnecessary 401 → browser re-auth cycle that
previously happened on every new chat session.

Also extracts a connect_with_auth() helper to eliminate duplicated
HTTP client + transport construction between the proactive and
fallback OAuth paths, and adds diagnostic logging to surface
whether servers issue refresh tokens.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
…ate credential check

- Remove 6 info!/debug! log lines that narrate control flow; keep only
  the warn! on refresh failure (genuinely useful for production).
- Remove has_stored_credentials() which duplicated Config::global() logic;
  reuse GooseCredentialStore via the CredentialStore trait instead.

Addresses review feedback from @DOsinga on aaif-goose#8386.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Implement a search bar in the Goose navigation panel that allows users to
search through their chat history by keywords.

Features:
- Search input with debounced API calls to /sessions/search endpoint
- Displays search results in a dropdown with session names and message counts
- Keyboard shortcut support (Cmd/Ctrl+K to focus, Escape to close)
- Shows session status indicators (streaming, unread, error)
- Integrates with existing navigation panel in both expanded and condensed modes
- Click to navigate to any search result

Resolves aaif-goose#8440

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
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: 9d5a2491bf

ℹ️ 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".

}}
>
{/* Search bar - spans full width */}
<div className="col-span-full p-2">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Mark chat search tile as no-drag in top nav

In the non-overlay top navigation mode, this grid inherits WebkitAppRegion: 'drag' (see dragStyle in the same file), so interactive children must opt out with no-drag. The newly added search tile does not, which makes the search input and result buttons behave like window-drag regions in Electron instead of clickable controls. This effectively breaks chat-history search for users who place navigation at the top.

Useful? React with 👍 / 👎.

Comment on lines +64 to +66
if (response.data) {
setResults(response.data);
setShowResults(true);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Guard against stale async search responses

Search results are written as soon as any request resolves, but there is no request sequencing or query check before setResults. If a slower request for an older query returns after a newer one, it will overwrite the dropdown with stale sessions that do not match the current input, and users can navigate to the wrong conversation. Consider tracking a request id/current query and ignoring out-of-date responses.

Useful? React with 👍 / 👎.

@vincenzopalazzo
Copy link
Copy Markdown
Contributor Author

Closing in favor of #8448, which contains only the search feature changes without unrelated backend modifications.

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.

Add a search bar to search through chat history

1 participant