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

   ### What
   
   `TextBlock` — the assistant prose of the AI transcript — had no test. This 
adds `TextBlock.test.tsx` with 4 tests pinning the render contract its own 
documentation calls out.
   
   ### Why
   
   The component doc names the single most expensive thing a transcript frame 
does (the full ReactMarkdown re-parse) and the repair step that makes model 
output render at all. Nothing guarded either.
   
   ### What is pinned
   
   - assistant prose renders as markdown;
   - **the model-markdown repair is applied before rendering**: CommonMark 
requires a space after an ATX heading marker and after a list bullet, and 
models — especially when answering in Chinese — skip both, which without the 
repair means **no** render, not a slightly-worse one: `##结论` stays a literal 
paragraph and `-第一项` stays a literal line. The repaired render produces the 
`h2` and the two list items;
   - GitHub-flavoured markdown tables render (`remark-gfm`);
   - the block opts into the `.ai-markdown` typographic contract, which carries 
the whole styling and is themed through the `--ai-*` custom properties.
   
   ### Verification
   
   - New tests on unmodified code: **4/4 green** (`npx vitest run`).
   - Discriminating mutations on `TextBlock`, vitest result verified red each 
time:
     1. the `normalizeAiMarkdown` repair skipped — the repair test reddens;
     2. the `remark-gfm` plugin dropped — the table test reddens;
     3. the `ai-markdown` class dropped — the typography test reddens.
   - Restored: 4/4 green. Test-only change; no product code touched.
   


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