Repository navigation
feat(native-chat): add a "New" line above unseen messages - #28333
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
4f5ee1d3-a573-4b82-ba09-cf3cd99c53ea
📥 Commits
Reviewing files that changed from the base of the PR and between 5e9489c and d125712e8eec8bc11d0a32c7bd5ae2086c8b0152.
📒 Files selected for processing (38)
docs/STYLEGUIDE.mdsrc/main/native-chat/agent-session-wire/agent-session-history-forward-read-budget.test.tssrc/main/native-chat/agent-session-wire/agent-session-subscriber-catch-up.tssrc/renderer/src/assets/main.csssrc/renderer/src/components/native-chat/NativeChatDockedTaskList.tsxsrc/renderer/src/components/native-chat/NativeChatMessageList.new-rows-marker.test.tsxsrc/renderer/src/components/native-chat/NativeChatMessageList.tsxsrc/renderer/src/components/native-chat/NativeChatNewRowsMarker.test.tsxsrc/renderer/src/components/native-chat/NativeChatNewRowsMarker.tsxsrc/renderer/src/components/native-chat/NativeChatStructuredSession.test-harness.tsxsrc/renderer/src/components/native-chat/NativeChatStructuredSession.test.tsxsrc/renderer/src/components/native-chat/NativeChatTranscriptItems.tsxsrc/renderer/src/components/native-chat/NativeChatTranscriptRow.tsxsrc/renderer/src/components/native-chat/native-chat-appearance-palette.test.tssrc/renderer/src/components/native-chat/native-chat-live-session-contract.tssrc/renderer/src/components/native-chat/native-chat-new-rows-marker.test.tsxsrc/renderer/src/components/native-chat/native-chat-new-rows-marker.tssrc/renderer/src/components/native-chat/native-chat-pinned-rows.test.tssrc/renderer/src/components/native-chat/native-chat-pinned-rows.tssrc/renderer/src/components/native-chat/structured-agent-session-read-owner.tssrc/renderer/src/components/native-chat/structured-agent-session-read-transport.test.tssrc/renderer/src/components/native-chat/structured-agent-session-read-transport.tssrc/renderer/src/components/native-chat/use-native-chat-reveal-latest.tssrc/renderer/src/components/native-chat/use-native-chat-transcript-window.tssrc/renderer/src/components/native-chat/use-structured-agent-session-read.test.tsxsrc/renderer/src/components/native-chat/use-structured-agent-session-read.tssrc/renderer/src/components/native-chat/use-structured-agent-session.tssrc/renderer/src/components/native-chat/use-structured-chat-live-session.tssrc/renderer/src/hooks/use-orca-window-foreground-focused.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/shared/agent-session-wire.tssrc/shared/structured-agent-session-coalescer.test.tssrc/shared/structured-agent-session-coalescer.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
848ca23 to
659a832
Compare
|
Nice, looks good |
Main's #28333 (a "New" line above unseen messages) marks a catch-up page that has more pages behind it with an optional `hasNewer` on the batch event. It crossed this part's current-work fields on the same event: the batch type keeps both `hasNewer` and `AgentSessionCurrentWorkFields`, and the subscriber catch-up page sends `actionablePromptIds`, `working` and `hasNewer` together.
Part 2 landed on main as 3bfb114, so files this part never changed take main's text. Where both sides changed a file, the result is this part's change laid onto main, checked against Part 2's final head 674dbed: - the client coalescer keeps this part's merged `actionablePromptIds` and `working` beside main's `hasNewer` (#28333, the "New" line above unseen messages); - the transcript row keeps this part's actionable-prompt import beside main's new-rows marker imports (#28333).
ELI5
When an agent replies while you are in another tab or another app, the chat used to reopen at the latest message, and you had to scroll back to find where you stopped reading. Now a blue "New" line sits above the first message you have not seen, and coming back takes you to it.
What Changed
Before, returning to a chat that had new messages put you at the end of the conversation. Nothing showed where the new part began.
Now:
How it works:
hasNewerfield. A long reply is replayed in several pages, and without the mark the chat would count itself caught up after the first one.text-chat-unread, mixed toward the chat's own text colour like the warning colour. It is listed in the style guide.Why
The issue asks for a "New" bar on unseen messages. With long replies it is easy to lose your place, and the only workaround was scrolling back and guessing.
Choices worth explaining:
Known limits:
Linked Issue
Fixes #26662
Visual Proof
Coming back to a chat after a long reply arrived in the background. Before, you land at the latest message. After, you land on the line.
Recording to follow.
Testing
Run in a hidden dev build on macOS with a real Claude chat. Not run on Linux or Windows, and not against an SSH or remote host: the lost-connection path is covered by tests only.
To try it:
Also checked in that run: a short reply leaves you at the end with the line in view, and coming back when nothing arrived draws no line.
Tests cover where the line goes: the first unseen message, never your own prompt, a growing reply, and a queued message before and after it is handed over. They also cover what clears it, the scroll on return on the real list (including a reply that grows after it arrives, and a reader who had scrolled up), the caught-up signal across a stop, a lost connection and a catch-up of several pages, and the host flag on every page but the last.
Review
Agent skill upstream boundary
Notes
hasNewer, on catch-up frames. Older clients and mobile ignore it; mobile's own tests were not run here. An older host does not send it, which only affects the line after a catch-up longer than one page.NativeChatDockedTaskListis the docked task list moved out of the message list unchanged, to keep that file under its line limit.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)