zjncs opened a new pull request, #5710:
URL: https://github.com/apache/rocketmq-dashboard/pull/5710
### What
`UserBubble` — the operator's own message in the transcript — had no test.
This adds `UserBubble.test.tsx` with 6 tests pinning the two contracts its own
documentation calls deliberate.
### Why
Both behaviors are silent-failure traps:
1. **plain text on purpose** — what was sent is what the run was admitted
with; re-interpreting a prompt as Markdown would let a prompt containing `#` or
`*` render as something the user never typed.
2. **the UTC timestamp helper** — `rmq_ai_event.gmt_create` is written from
`Clock.systemUTC()` as a `LocalDateTime` with **no offset**; parsing it as a
plain local `Date` would silently shift every history entry by the viewer's UTC
offset.
### What is pinned
- the prompt renders as plain text: `#`, `**`, and `-` stay literal, with no
`h1`/`strong`/`ul` in the DOM;
- the creation time goes through `formatUtcDateTime`, the same helper every
other timestamp in Studio uses;
- no `createdAt`, no timestamp line;
- the avatar shows the logged-in operator's **uppercase** initial with the
username as tooltip, falls back to `U` with no title when nobody is logged in,
and uppercases a lowercase username.
### Verification
- New tests on unmodified code: **6/6 green** (`npx vitest run`).
- Discriminating mutations on `UserBubble`, vitest result verified red each
time:
1. the prompt re-interpreted as a heading when it starts with `#` — red;
2. the timestamp parsed as a local `Date` instead of the shared UTC helper
— red;
3. the avatar initial hardcoded to `U` — red.
- Restored: 6/6 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]