Skip to content

Add chat history search feature to navigation panel#8448

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

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

Conversation

@vincenzopalazzo
Copy link
Copy Markdown
Contributor

@vincenzopalazzo vincenzopalazzo commented Apr 9, 2026

Add chat history search to navigation panel

Implements a native search bar in the Goose navigation panel, allowing users to search through their chat history by keywords.

Resolves #8440

Features

  • Debounced search (250ms) via existing /sessions/search backend endpoint
  • Rich results dropdown with session name, message count, and relative time
  • Session status indicators — streaming, unread, and error states
  • Recipe/chat icon distinction — ChefHat icon for recipe sessions, MessageSquare for chats
  • Full keyboard navigation — ↑/↓ arrows, Enter to select, Escape to close
  • Global shortcutCmd/Ctrl+K to focus the search input
  • Animated dropdown — smooth open/close with framer-motion
  • Skeleton loading states — 3-row shimmer while results load
  • ARIA accessibility — combobox + listbox roles, aria-expanded, aria-selected
  • Responsive — works in both expanded grid and condensed navigation layouts
  • Hidden in icon-only mode — search bar collapses when navigation is minimized to icons

Changes

File Status
components/conversation/ChatHistorySearch.tsx New (348 lines)
components/Layout/ExpandedRenderer.tsx Modified (+11 lines)
components/Layout/CondensedRenderer.tsx Modified (+16 lines)

Implementation Details

  • Reuses shared UI components: ScrollArea, Skeleton, SessionIndicators
  • Reuses existing utilities: getSessionDisplayName, truncateMessage from useNavigationSessions
  • Uses defineMessages/useIntl i18n pattern consistent with codebase
  • Follows existing navigation component patterns and Tailwind theme tokens
  • No backend changes required — the /sessions/search endpoint already exists

Quality Checks

  • ✅ TypeScript compilation (no errors in changed files)
  • ✅ ESLint (clean)
  • ✅ Prettier formatted

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: bbb808d577

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

Comment thread ui/desktop/src/components/Layout/ExpandedRenderer.tsx Outdated
Comment thread ui/desktop/src/components/conversation/ChatHistorySearch.tsx Outdated
@vincenzopalazzo vincenzopalazzo force-pushed the feature/chat-history-search-clean branch from bbb808d to cedfeaf Compare April 9, 2026 18:08
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: cedfeaf879

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

Comment thread ui/desktop/src/components/Layout/CondensedRenderer.tsx Outdated
Comment thread ui/desktop/src/components/conversation/ChatHistorySearch.tsx
@vincenzopalazzo vincenzopalazzo force-pushed the feature/chat-history-search-clean branch 2 times, most recently from 6a11bf3 to 667af9c Compare April 9, 2026 18:35
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: 667af9c78e

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

Comment thread ui/desktop/src/components/conversation/ChatHistorySearch.tsx
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: c0d7d23aa0

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

Comment thread ui/desktop/src/components/conversation/ChatHistorySearch.tsx
Implement a search bar in the Goose navigation panel that allows users
to search through their chat history by keywords.

Features:
- Debounced search (250ms) via /sessions/search endpoint
- Results dropdown with session name, message count, relative time
- Session status indicators (streaming, unread, error)
- Recipe/chat icon distinction
- Full keyboard navigation (arrow keys, Enter, Escape)
- Cmd/Ctrl+K global shortcut to focus
- Animated dropdown with framer-motion
- Skeleton loading states
- Proper ARIA combobox/listbox accessibility
- Hidden in condensed icon-only mode
- Works in both expanded grid and condensed layouts
- i18n messages extracted and compiled

Resolves aaif-goose#8440

Signed-off-by: Vincenzo Palazzo <[email protected]>
@vincenzopalazzo vincenzopalazzo force-pushed the feature/chat-history-search-clean branch from c0d7d23 to 1f3b121 Compare April 14, 2026 19:34
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: 1f3b121278

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

Comment thread ui/desktop/src/components/conversation/ChatHistorySearch.tsx
Drop previous results and flip to the searching state as soon as the
query changes so that during the 250ms debounce window:
- items from the previous query can no longer be clicked (misnavigation)
- the empty-state ("No chats found") does not flicker before the new
  request actually runs

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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: 314dcdbaec

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


useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
if ((e.metaKey || e.ctrlKey) && e.key === 'k') {
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 Use platform-specific modifier for global search shortcut

The shortcut handler currently triggers on either Meta or Ctrl ((e.metaKey || e.ctrlKey) && e.key === 'k'), so on macOS pressing Ctrl+K is also intercepted and preventDefault() is applied. This conflicts with expected macOS text-editing behavior and can steal Ctrl+K from other focused inputs while the nav search is mounted. The shortcut should follow platform semantics (Cmd on macOS, Ctrl elsewhere) like other keyboard handlers in the codebase.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 310bc15. The handler now uses (isMac ? e.metaKey : e.ctrlKey) -- matching the pattern already used in SearchView.tsx, App.tsx, and ProgressiveMessageList.tsx -- and also guards against shiftKey/altKey so only a bare Cmd+K (macOS) or Ctrl+K (Linux/Windows) triggers the shortcut. The inline hint now renders ⌘K on macOS and Ctrl+K elsewhere via separate i18n messages.

The global Cmd/Ctrl+K handler previously fired on both `metaKey` and
`ctrlKey` across all platforms, so on macOS `Ctrl+K` was intercepted
(conflicting with native text-editing behaviour) and the inline hint
always displayed `⌘K` even on Linux/Windows. Match the platform
convention used elsewhere in the codebase: Cmd on macOS, Ctrl otherwise,
and render the hint accordingly.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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: 310bc157f1

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

Comment on lines +186 to +187
document.addEventListener('mousedown', handleClickOutside);
return () => document.removeEventListener('mousedown', handleClickOutside);
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 Close search dropdown when focus leaves via keyboard

isFocused is only cleared by a document mousedown outside handler, so keyboard-driven focus changes (for example, pressing Tab out of the search field) never reset focus state. In that path, showDropdown can remain true even though the combobox is no longer focused, leaving stale results/error UI open and causing inconsistent keyboard/accessibility behavior. Please also handle blur/focusout transitions (e.g., when relatedTarget is outside containerRef) so the dropdown reliably closes when focus leaves the search control.

Useful? React with 👍 / 👎.

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