apache / apache/rocketmq-dashboard
AI chat history cannot delete individual conversations
- Dominant language
- Java
- Stars
- 1.4k
- Forks
- 683
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 58
Description
## Problem
The AI chat history drawer can list and select conversations, but cannot remove a specific conversation. The only destructive action clears **all** histories, which is disproportionate when an operator wants to remove one temporary diagnostic conversation.
## Current behavior and reproduction
1. Open the AI assistant page and start several conversations, including temporary diagnostics.
2. Open the history drawer.
3. Try to remove just one conversation: each row only selects it; the only destructive action is "clear all histories", which wipes both Mock and Real histories.
`web/src/stores/aiChatHistoryStore.ts` supports `startConversation`, `selectConversation`, `setMessages`, and `clearHistories()` — no per-conversation delete action. The history drawer in `web/src/pages/ai/index.tsx` renders one select-only row per conversation.
The store also keeps a single `activeConversationId` per data mode, so deleting the active conversation must deterministically select another conversation (or clear the selection when none remain) for the next message to land in a sane place.
## Proposed behavior
- Add a store action that removes exactly one conversation by ID in the selected Mock/Real data mode, without touching the other mode.
- If the deleted conversation is active, select the most recent remaining conversation; if none remain, clear the active selection.
- Keep existing persistence, conversation/message limits, and history-size shrinking behavior unchanged.
- Keep the active conversation ref used by the chat page in sync so the next sent message continues in the newly selected conversation.
- Add a confirmed delete action beside each history item while keeping the row-level select action separate (so opening the delete confirm must not select the conversation).
## Acceptance criteria
- [ ] Deleting a non-active conversation leaves the current selection unchanged.
- [ ] Deleting the active conversation moves the selection to the most recent remaining conversation.
- [ ] Deleting the last conversation clears the active selection.
- [ ] Deleting in one data mode does not affect the other mode.
- [ ] Persistence and history-size limits behave exactly as before.
- [ ] The drawer has a confirmed per-row delete action that does not trigger row selection.
- [ ] Store tests cover all three selection outcomes; page tests cover the drawer interaction.
## Importance
Should-have. Operators often paste temporary diagnostics into AI chat. The current workaround — clearing all histories — destroys useful history to remove one conversation.
## Duplicate check
Searched open and closed issues/PRs for `delete conversation`, `AI chat history delete`, `remove conversation`, `chat history management`. No existing issue or PR adds per-conversation deletion to the AI history drawer.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with web/src/stores/aiChatHistoryStore.ts and web/src/pages/ai/index.tsx, then inspect the existing store and page tests. Add coverage for non-active, active, and last-conversation deletion plus the drawer interaction; done when selection, persistence, mode isolation, and confirmed per-row deletion match the acceptance criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100