Skip to content

feat(native-chat): add a "New" line above unseen messages - #28333

Merged
AmoabaKelvin merged 1 commit into
stablyai:mainfrom
AmoabaKelvin:native-chat-new-messages-marker
Oct 15, 2026
Merged

AmoabaKelvin merged 1 commit into
stablyai:mainfrom
AmoabaKelvin:native-chat-new-messages-marker

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​702 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​701
Prod 28 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​457 $\color{#cf222e}{\Huge{\mathbf{−}}}$​48 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​409

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:

  • A "New" line is drawn above the first message that arrived while you were not watching the chat. Not watching means its tab was in the background, Orca was not the focused window, or the chat had lost contact with its host.
  • A reply that was already being written when you left, and kept growing, counts as new. The line goes above that reply.
  • Coming back scrolls the line to the top of the chat, so you read forward from where you stopped. If you had scrolled up to read something older before you left, your place is kept and the line is still drawn further down.
  • The line stays while you scroll, click or switch tabs again. It goes when you type in the chat's composer, send a message or answer a prompt. Typing in Find leaves it alone.
  • A screen reader is told "New messages arrived while you were away".
  • Chats that read from a terminal are unchanged.

How it works:

  • When you stop watching, the chat notes how far the conversation had got: the newest message, and the size of the reply still being written. Once you are back and the chat has caught up with the host, it finds the first message past that point and remembers which message it is. It remembers the message and not a position because a message queued behind a running turn is drawn last and gets a new position when it is handed to the agent.
  • Knowing the chat has caught up needed two additions. The chat's reader now says whether what it holds is the host's present. That is false while a hidden chat has stopped reading, and after a lost connection until the reconnect has delivered. The host also marks each catch-up page that has more pages behind it with an optional hasNewer field. A long reply is replayed in several pages, and without the mark the chat would count itself caught up after the first one.
  • The row that draws the line stays mounted when it is scrolled out of view, the same way the last row and a revealed diff do, so the chat can scroll to it.
  • The colour is a new chat token, 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:

  • Nothing is saved to disk. The line lives in the open chat pane, which stays mounted through tab and workspace switches. It does not survive closing the tab or restarting Orca. Saving a read position per chat is a bigger design, and the issue asks for a pointer when you come back.
  • Watching needs the Orca window to be focused, so a chat visible on a second monitor while you work in another app counts as away. This is the rule notifications already use to decide whether you saw something.
  • The line clears when you type or send, and not on scroll or after a delay. You may still be reading what it marks.
  • The scroll on return does not ask how much arrived. A reply is drawn short and filled in over the next few frames, so its height at that moment says nothing about its final size.
  • The host marks catch-up pages because the chat cannot tell the last page from one in the middle. The field is optional, so older clients ignore it. With an older host the line can be missing after a long catch-up.

Known limits:

  • After you come back to new messages the chat stops following the newest one until you scroll to the end, press "Jump to latest" or send.
  • A message from another agent that you saw waiting before you left gets the line above it if it was handed to the agent while you were away.

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.

Before After After, short reply
before, dark after, dark after a short reply, dark
before, light after, light after a short reply, light

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:

  1. Open a Claude chat and ask for something long, for example a numbered list of 70 tips.
  2. Switch to another tab while the reply is written, wait for it to finish, then switch back.
  3. The chat opens with your prompt at the top, the "New" line under it, and the reply below.
  4. Scroll around. The line stays. Type a character in the composer. The line goes.

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.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Wire: one optional field, 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.
  • SSH and remote: losing contact with the host counts as being away, so what arrived during the gap is marked after the reconnect.
  • Performance: nothing extra runs per render while no line is drawn. Leaving and returning each do one pass over the rows. A hidden pane does not listen for window focus.
  • Folder workspaces behave the same as git worktrees.
  • The two new strings are translated in all six locales.
  • NativeChatDockedTaskList is the docked task list moved out of the message list unchanged, to keep that file under its line limit.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@AmoabaKelvin
AmoabaKelvin marked this pull request as ready for review October 13, 2026 16:53
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7ebc677a-b729-44b5-916e-984eec3950a9
📥 Commits

Reviewing files that changed from the base of the PR and between 848ca23fe4c09c6e2c0f1737e9a10b6232205f22 and 659a832.

📒 Files selected for processing: 7
  • src/renderer/src/assets/main.css
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
🚧 Files skipped from review as they are similar to previous changes: 7
  • src/renderer/src/assets/main.css
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

📝 Walkthrough

The chat read path now reports catch-up completion and exposes whether the session read is current. The transcript tracks rows added while the reader was away, displays and announces a “New” marker, and accounts for it during scrolling and windowing. The change also adds unread-color styling, localized strings, tests, and a docked task-list component.

Priority: ➖ Normal

Merge Risk: 🔵 Low · up to 659a8

A newly arrived message held in waitingSlots may temporarily lack a divider or announcement. This is a bounded issue to address or explicitly accept before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 48.65% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 37 functions across 30 files. (7 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main user-facing change: adding a “New” line above unseen native-chat messages.
Description check Passed The description is complete and focused. It explains the user impact, implementation, rationale, linked issue, visual proof, testing, known limits, compatibility considerations, and checklist status.
Linked Issues check Passed Issue #26662 requests a way to identify messages received after the user leaves a native chat. The PR adds the “New” marker, tracks the first eligible new row, preserves the marker while scrolling, re…
Out of Scope Changes check Passed The changes stay within issue #26662. The hasNewer wire field, read-current state, focus tracking, transcript pinning, localization, styling, refactoring, and automated tests support reliable detect…
Full details: Docstring Coverage

Explanation

Docstring coverage is 48.65% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 37 functions across 30 files. (7 skipped: 7 unsupported.)

  • Fix all pre-merge checks with AI
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md
  • src/main/native-chat/agent-session-wire/agent-session-history-forward-read-budget.test.ts
  • src/main/native-chat/agent-session-wire/agent-session-subscriber-catch-up.ts
  • src/renderer/src/assets/main.css
  • src/renderer/src/components/native-chat/NativeChatDockedTaskList.tsx
  • src/renderer/src/components/native-chat/NativeChatMessageList.new-rows-marker.test.tsx
  • src/renderer/src/components/native-chat/NativeChatMessageList.tsx
  • src/renderer/src/components/native-chat/NativeChatNewRowsMarker.test.tsx
  • src/renderer/src/components/native-chat/NativeChatNewRowsMarker.tsx
  • src/renderer/src/components/native-chat/NativeChatStructuredSession.test-harness.tsx
  • src/renderer/src/components/native-chat/NativeChatStructuredSession.test.tsx
  • src/renderer/src/components/native-chat/NativeChatTranscriptItems.tsx
  • src/renderer/src/components/native-chat/NativeChatTranscriptRow.tsx
  • src/renderer/src/components/native-chat/native-chat-appearance-palette.test.ts
  • src/renderer/src/components/native-chat/native-chat-live-session-contract.ts
  • src/renderer/src/components/native-chat/native-chat-new-rows-marker.test.tsx
  • src/renderer/src/components/native-chat/native-chat-new-rows-marker.ts
  • src/renderer/src/components/native-chat/native-chat-pinned-rows.test.ts
  • src/renderer/src/components/native-chat/native-chat-pinned-rows.ts
  • src/renderer/src/components/native-chat/structured-agent-session-read-owner.ts
  • src/renderer/src/components/native-chat/structured-agent-session-read-transport.test.ts
  • src/renderer/src/components/native-chat/structured-agent-session-read-transport.ts
  • src/renderer/src/components/native-chat/use-native-chat-reveal-latest.ts
  • src/renderer/src/components/native-chat/use-native-chat-transcript-window.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session-read.test.tsx
  • src/renderer/src/components/native-chat/use-structured-agent-session-read.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session.ts
  • src/renderer/src/components/native-chat/use-structured-chat-live-session.ts
  • src/renderer/src/hooks/use-orca-window-foreground-focused.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/agent-session-wire.ts
  • src/shared/structured-agent-session-coalescer.test.ts
  • src/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.

@AmoabaKelvin
AmoabaKelvin force-pushed the native-chat-new-messages-marker branch from 848ca23 to 659a832 Compare October 14, 2026 20:47
@brennanb2025

Copy link
Copy Markdown
Contributor

Nice, looks good

@AmoabaKelvin
AmoabaKelvin merged commit c056cfc into stablyai:main Oct 15, 2026
32 checks passed
brennanb2025 added a commit that referenced this pull request Oct 15, 2026
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.
brennanb2025 added a commit that referenced this pull request Oct 15, 2026
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: 'New' UI denoting unseen messages in native chat

2 participants