unbridled-41 opened a new pull request, #3983:
URL: https://github.com/apache/rocketmq-dashboard/pull/3983

   Fixes #3566.
   
   ## Problem / Evidence
   
   The AI history drawer can list and select conversations, but the only 
destructive action is wiping every history (`clearHistories`, wired to the 
layout logout/reset path). The `aiChatHistoryStore` supports starting, 
selecting, updating, and clearing conversations but has no per-conversation 
delete, as described in `#3566`. Operators who paste temporary diagnostics into 
AI chat currently have to wipe the whole history to remove one conversation.
   
   ## What was added
   
   - `deleteConversation(mode, conversationId)` store action: removes exactly 
one conversation within the requested data mode. When the deleted conversation 
was the active one, it deterministically selects the most recent remaining 
conversation, or clears the active selection when nothing remains. The existing 
page effect already syncs the current-conversation ref from the store, so the 
chat view follows the new selection without extra wiring.
   - A per-row delete control in the history drawer behind a `Popconfirm`, with 
localized confirm/cancel labels and a danger-styled icon button; rows keep 
their select behavior and accessible names.
   - Persistence and history-size limits are untouched: deletion flows through 
the same zustand persist middleware (throttled writes, byte/entry bounds), 
which is covered by a regression asserting the removed conversation no longer 
reaches session storage.
   
   ## Priority & scoring
   
   FEATURE_PRIORITY = 85 (project need 35: explicit maintainer-evaluated issue 
#3566; external maturity 24: per-conversation deletion is standard in mature 
chat UIs and this repo's own Message Query History drawer manages records 
individually; fit 17: matches the existing store/drawer design without new 
dependencies; testability 9: store unit tests and drawer interaction tests). 
IMPLEMENTATION_CONFIDENCE = 85: small, well-bounded diff over an existing store 
with comprehensive existing test infrastructure.
   
   ## Tests
   
   - New regressions first failed (`TypeError: 
store.getState(...).deleteConversation is not a function` ×3; the two drawer 
tests could not find a delete control), then passed:
     - `npx vitest run src/stores/aiChatHistoryStore.test.ts 
src/pages/ai/__tests__/AiPage.test.tsx` → 33 passed (33): single delete keeps 
the other mode untouched and purges the record from session storage; active 
selection moves to the next remaining conversation and clears when the last one 
is deleted; non-active deletes keep the selection; drawer delete requires 
confirmation; deleting a previous row leaves the active conversation intact; 
deleting the active row renders the next conversation.
   - Full web suite `npx vitest run --testTimeout=60000`: 927 tests (922 
pristine + 5 new), 1 failure — `ConsumerPage.test.tsx`, the known load-flaky 
file untouched by this PR (passes 29/29 in isolation). Zero new failures. 
Backend code paths are not touched by this change.
   - `npm run build`, `tsc -b`, and `eslint` on touched files: clean.
   
   ## Risk
   
   Low. Additive client-side change: one store action, one confirmed per-row 
control, two i18n keys. No API changes, no persistence-format changes (deleted 
ids simply disappear), and the mock/real data modes stay isolated because 
deletion is scoped per mode.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to