yyqdbngt opened a new pull request, #4083:
URL: https://github.com/apache/rocketmq-dashboard/pull/4083

   # Export the active AI conversation as Markdown
   
   ## Summary
   Adds an "Export Markdown" (`ai.exportMarkdown`, zh/en via 
`web/src/i18n/translations.ts`) button to the AI chat page's bottom tool bar. 
Clicking it renders the currently active conversation's messages in order — 
user messages under `## User` and AI responses under `## Assistant` — and 
downloads them as a Markdown file named 
`rocketmq-ai-conversation-<timestamp>.md` (ISO timestamp with `:`/`.` replaced 
by `-`). The button is disabled when the active conversation has no messages. 
The download reuses `downloadBlob` from `web/src/utils/download.ts`.
   
   ## Why
   AI answers currently live only inside the in-app conversation history. Being 
able to export the active conversation as a portable Markdown document lets 
operators share conclusions, attach them to incidents/runbooks, and keep an 
offline record without copying text by hand.
   
   ## Testing
   - Local typecheck: `cd web && ./node_modules/.bin/tsc -b tsconfig.app.json` 
→ exit 0.
   - Server (Node 20): `./node_modules/.bin/vitest run 
src/pages/ai/__tests__/AiPage.test.tsx` → **19 passed** (17 existing + 2 new).
     - `exports the active conversation as Markdown in message order` — asserts 
the downloaded blob is `text/markdown;charset=utf-8`, contains `## User` / `## 
Assistant` sections in message order, and the anchor uses the 
`rocketmq-ai-conversation-*.md` filename.
     - `disables the Markdown export button for an empty conversation`.
   


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