apache / apache/rocketmq-dashboard

AI chat history cannot be searched

Open
#3,567 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.4k
Forks
683
Avg merge
2d 14h
Merged PRs (30d)
58

Description

## Problem

The AI history drawer shows only the most recent conversations and has no search control. Older conversations remain persisted but are effectively unreachable through the UI, because the drawer truncates the list to the recent-conversation limit.

## Current behavior and reproduction

1. Create more than 20 conversations in the AI assistant (the store's `MAX_AI_CHAT_CONVERSATIONS` window).
2. Open the history drawer.
3. Try to find a conversation outside the recent window by a keyword you remember: there is no search input, and the drawer only renders `getRecentAiChatConversations(history.conversations)`.

`web/src/pages/ai/index.tsx` (around line 777):

```ts
const recentConversations = getRecentAiChatConversations(history.conversations);
```

`getRecentAiChatConversations` returns at most the store's conversation limit (currently 20), so once more conversations exist, anything outside the recent window cannot be found again even though it is still persisted.

## Proposed behavior

- Add a search input at the top of the AI history drawer.
- Match the first user prompt plus message text, summaries, and thinking text using a case-insensitive "contains" query.
- Trim and normalize the search term so padded or mixed-case input behaves consistently.
- Preserve the most-recent ordering of results.
- Search all persisted conversations for the selected data mode rather than only the default recent window.
- Return the normal recent list when the search box is empty.
- Show the existing empty state when no conversation matches.

## Acceptance criteria

- [ ] The drawer has a search input; empty input shows the normal recent list.
- [ ] Search is case-insensitive and trims the input.
- [ ] Search matches prompt text, message text, summaries, and thinking text.
- [ ] Search covers all persisted conversations, not only the recent window.
- [ ] Result ordering stays most-recent first; no-match shows the existing empty state.
- [ ] Store tests cover matching by message content, by prompt, and empty-search behavior.

## Importance

Should-have. Finding a previous diagnostic conversation by a keyword ("deadlock", "offset reset", an instance name) is a normal expectation once more than a handful of conversations exist. Without search, the only workaround is scrolling a truncated list — and older conversations are unreachable at all.

## Duplicate check

Searched open and closed issues/PRs for `AI history search`, `chat history search`, `search conversations`, `AI conversation filter`. No existing issue or PR adds search to the AI history drawer.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in web/src/pages/ai/index.tsx around the recentConversations assignment and trace getRecentAiChatConversations plus the AI conversation store. Read the existing store tests first, then verify the drawer behavior and add coverage for prompt, message, and empty-search matching. Done means persisted conversations can be searched case-insensitively while empty search preserves the recent, most-recent-first list and the existing empty state.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.