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

   ### What
   
   `BubbleList` — the transcript renderer — had no test. This adds 
`BubbleList.test.tsx` with 10 tests pinning the contract its own documentation 
calls load-bearing. `UserBubble` and `AssistantBubble` are mocked as recording 
stand-ins, since BubbleList is deliberately dumb (no fetching, no reducing, no 
scroll handling — forwarding is its whole job).
   
   ### Why
   
   The component doc describes the invisible end-of-run handover: appending the 
live bubble **after** the persisted ones means the answer exists in both lists 
for one commit and the duplicate never paints. It also explains why the 
optimistic question carries no timestamp and why the last run's speed must not 
leak onto persisted bubbles while a newer run streams. None of it was guarded.
   
   ### What is pinned
   
   - an empty transcript with no live run and no pending question renders the 
empty state (or nothing when none is given);
   - **order**: persisted bubbles, then the optimistic pending question, then 
the live answer;
   - a persisted user bubble joins **only its text blocks** (thinking is not 
prompt text) and forwards its persisted timestamp;
   - the optimistic question is drawn **without a timestamp** — the persisted 
row replaces it at the refetch, and a client-side clock would only pretend to 
be it; a blank pending text is ignored;
   - a streaming run shows the live bubble **even before its first block** (the 
pending dots need a home); a finished run with nothing live shows none;
   - the last run's speed belongs to the **newest** persisted assistant bubble 
**only while no newer run streams**, and a speed the bubble itself reported 
always wins over the last-run estimate.
   
   ### Verification
   
   - New tests on unmodified code: **10/10 green** (`npx vitest run`).
   - Discriminating mutations on `BubbleList`, vitest result verified red each 
time:
     1. the streaming clause dropped from `hasLive` so an empty live stream 
shows no bubble — red;
     2. the text-block filter dropped from `bubbleText` so thinking leaks into 
the prompt — red;
     3. the streaming guard dropped from the last-run speed — red.
   - Restored: 10/10 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