unbridled-41 opened a new pull request, #3984:
URL: https://github.com/apache/rocketmq-dashboard/pull/3984
Fixes #3567.
## Problem / Evidence
The AI history drawer renders
`getRecentAiChatConversations(history.conversations)` (the 8 most recent
prompt-bearing conversations) with no filter input, exactly as `#3567`
describes: older conversations remain stored (up to the store's 20-conversation
bound) but are effectively unreachable through the UI.
## What was added
- `searchAiChatConversations(conversations, query)` in the chat history
store: a pure helper that filters all stored conversations of a data mode by a
case-insensitive contains query matched against message texts (which includes
the first user prompt), preserving the store's most-recent-first ordering, and
returning no results for blank queries.
- A search input at the top of the history drawer. With an empty query the
drawer keeps its existing recent-list behavior unchanged; with a query it
renders the filtered results over the full stored history, so older
conversations become reachable. Rows keep their select behavior, active
highlight, and relative timestamps.
- An explicit empty state (`没有匹配的对话记录` / "No conversations match your
search") when nothing matches, distinct from the existing no-history empty
state.
## Priority & scoring
FEATURE_PRIORITY = 85 (project need 35: explicit maintainer-evaluated issue
#3567; external maturity 24: history search is standard in mature chat UIs and
the repo already ships search inputs on comparable list surfaces; fit 17:
extends the existing store/drawer design without new dependencies; testability
9: pure helper plus drawer interaction tests). IMPLEMENTATION_CONFIDENCE = 84:
small diff over existing store and drawer code with established test patterns.
## Tests
- New regressions first failed (`TypeError: searchAiChatConversations is not
a function` ×2; the two drawer tests could not find the search input), then
passed:
- `npx vitest run src/stores/aiChatHistoryStore.test.ts
src/pages/ai/__tests__/AiPage.test.tsx` → 32 passed (32): case-insensitive
matching with surrounding whitespace, ordering preserved, blank queries return
nothing, matches beyond the first prompt (AI message text), drawer reaches a
9th (oldest) conversation invisible in the default recent list, and the
explicit no-match empty state replaces the regular empty message.
- Full web suite `npx vitest run --testTimeout=60000`: 926 tests (922
pristine + 4 new), 2 failures — both in `AclPage.test.tsx` /
`ConsumerPage.test.tsx`, the known load-flaky files untouched by this PR; both
files pass 50/50 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 pure store helper, one input, two i18n
keys. The default (no query) drawer behavior is byte-identical to before; no
API changes, no persistence changes.
--
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]