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

   ## Problem
   
   The timeline walk is **forward-only**: the initial load pages forward from 
seq 0 (up to `maxPages` × `limit`), so when `hasMore` is set, the rows NOT yet 
loaded are the conversation's **newest tail**. `loadMore` continues the forward 
cursor (`after: nextAfter`) and appends the fetched rows **at the end** of the 
transcript (`previous.concat`). The backend offers no backward paging.
   
   The affordance contradicted all of that:
   
   - it sat **above** the transcript (`ChatThread.tsx:187-193`), where a "load 
older history" control belongs;
   - it was labeled **`加载更早的内容 / Load earlier events`** 
(`ai.thread.loadEarlier`) — but older history cannot exist: the walk already 
started at seq 0;
   - the hook's docstring described the same affordance as "加载更早内容".
   
   A user seeing the button had **no way to know they were actually missing the 
latest turns** — the exact state where a conversation looks frozen/stale is 
presented as "nothing new above".
   
   ## Fix
   
   - Relabel to `加载剩余内容 / Load remaining events` (new `ai.thread.loadRemaining` 
key);
   - Move the button **below** the transcript, where the fetched rows actually 
land;
   - Update the hook docstring to describe the forward continuation.
   
   The `loadEarlier` key is kept for any other callers (none found in-tree).
   
   ## Verification
   
   - New hook test `loadMoreAppendsTheNewestTailAtTheEndTest` pins the 
contract: `loadMore` calls with `after: 2` (the previous page's cursor, NOT 0) 
and the newest row lands **after** the existing rows (`[1, 4]`).
   - New ChatThread test asserts the affordance renders as `加载剩余内容/Load 
remaining` and **not** `加载更早的内容/Load earlier`.
   - **Mutation** (revert the ChatThread + i18n changes): the ChatThread test 
**fails** — the old label is present — proving the test discriminates; restore: 
green.
   - Regression: `useConversationTimeline.test.ts` + `ChatThread.test.tsx` — 
**22/22**; `tsc -b` clean.
   
   ```bash
   cd web && npx vitest run src/pages/ai/hooks/useConversationTimeline.test.ts 
src/pages/ai/components/__tests__/ChatThread.test.tsx
   ```
   
   Note: complements #5520 (null cursor at the tail page) — different edge of 
the same walk.


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