{label}
@@ -151,23 +69,16 @@ export function NativeChatNewRowsMarker({
}
/** Keep the live region mounted before inserting text so screen readers announce it. */
-export function NativeChatNewRowsAnnouncement({
- arrival
-}: {
- /** Counts the returns that found rows missed; a new count is announced again. */
- arrival: number | undefined
-}): React.JSX.Element {
+export function NativeChatNewRowsAnnouncement({ marked }: { marked: boolean }): React.JSX.Element {
const t = useTranslate()
return (
- {arrival === undefined ? null : (
-
- {t(
+ {marked
+ ? t(
'components.native-chat.newRowsAnnouncement',
'New messages arrived while you were away'
- )}
-
- )}
+ )
+ : null}
)
}
diff --git a/src/renderer/src/components/native-chat/viewport/new-rows/native-chat-missed-row-positions.ts b/src/renderer/src/components/native-chat/viewport/new-rows/native-chat-missed-row-positions.ts
deleted file mode 100644
index a74a1ef84f8..00000000000
--- a/src/renderer/src/components/native-chat/viewport/new-rows/native-chat-missed-row-positions.ts
+++ /dev/null
@@ -1,60 +0,0 @@
-// Where rows sit in the journal, and which of them a reader can have missed.
-
-import { compareAgentJournalPositions } from '../../../../../../shared/agent-session/journal/agent-session-journal-position'
-import type { AgentJournalPosition } from '../../../../../../shared/agent-session/journal/agent-session-journal-types'
-import type { NativeChatTranscriptSlot } from '../../conversation/slots/native-chat-transcript-slots'
-
-/** Use journal positions for conversation rows, including folded-turn bars; terminal-backed rows have none and remain unmarked. */
-export function rowPosition(slot: NativeChatTranscriptSlot): AgentJournalPosition | undefined {
- return slot.kind === 'message' && slot.depth === 0 && (slot.drawsMessage || slot.statusAbove)
- ? slot.message.journalPosition
- : undefined
-}
-
-/** Before every row the journal places: what the reader has read to when no row precedes. */
-const BEFORE_EVERY_ROW: AgentJournalPosition = { sequence: -1, index: 0 }
-
-/** A prompt the reader sent from this chat, as opposed to a message another agent sent through Orca. */
-export function isReaderPrompt(
- slot: NativeChatTranscriptSlot
-): slot is Extract
{
- return (
- slot.kind === 'message' &&
- slot.depth === 0 &&
- slot.message.role === 'user' &&
- slot.message.from === undefined
- )
-}
-
-export function newestRowPosition(
- slots: readonly NativeChatTranscriptSlot[],
- limit?: AgentJournalPosition
-): AgentJournalPosition {
- let newest = BEFORE_EVERY_ROW
- for (const slot of slots) {
- const at = rowPosition(slot)
- if (
- at &&
- (!limit || compareAgentJournalPositions(at, limit) < 0) &&
- compareAgentJournalPositions(at, newest) > 0
- ) {
- newest = at
- }
- }
- return newest
-}
-
-/** Placed in the stretch the reader was away for, and not their own prompt. */
-export function isMissedRow(
- slot: NativeChatTranscriptSlot,
- after: AgentJournalPosition,
- through: AgentJournalPosition
-): boolean {
- const at = rowPosition(slot)
- return (
- at !== undefined &&
- compareAgentJournalPositions(at, after) > 0 &&
- compareAgentJournalPositions(at, through) <= 0 &&
- (slot.kind !== 'message' || slot.message.role !== 'user' || slot.message.from !== undefined)
- )
-}
diff --git a/src/renderer/src/components/native-chat/viewport/new-rows/native-chat-new-rows-marker.journal.test.tsx b/src/renderer/src/components/native-chat/viewport/new-rows/native-chat-new-rows-marker.journal.test.tsx
deleted file mode 100644
index 095f5bd53a6..00000000000
--- a/src/renderer/src/components/native-chat/viewport/new-rows/native-chat-new-rows-marker.journal.test.tsx
+++ /dev/null
@@ -1,166 +0,0 @@
-// @vitest-environment happy-dom
-
-// The queued-run rule, driven from journal items through the desktop projection, turn membership,
-// slots and the waiting split, the way NativeChatMessageList feeds the marker.
-
-import { renderHook } from '@testing-library/react'
-import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
-import type {
- AgentJournalRenderItem,
- AgentJournalSubmission,
- AgentJournalTurnItem
-} from '../../../../../../shared/agent-session/journal/agent-session-journal-types'
-import type { AgentJournalTurnScope } from '../../../../../../shared/agent-session/journal/agent-session-journal-turn-scope'
-import { agentJournalSubmissionKey } from '../../../../../../shared/agent-session/journal/agent-session-journal-item-key'
-import { owesStructuredAgentSessionWork } from '../../../../../../shared/agent-session/view/structured-agent-session-owed-work'
-import { withNativeChatCutTurnNotices } from '../../../../../../shared/native-chat/transcript/native-chat-cut-turn-notice'
-import { nativeChatTurnMembership } from '../../../../../../shared/native-chat/transcript/native-chat-turn-membership'
-import { nativeChatRowsInDrawOrder } from '../../../../../../shared/native-chat/transcript/native-chat-turn-grouping'
-import { projectStructuredAgentSessionMessages } from '../../conversation/projection/structured-agent-session-message-projection'
-import { buildNativeChatTranscriptSlots } from '../../conversation/slots/native-chat-transcript-slots'
-import { splitNativeChatSlotsWaitingBehindLiveTurn } from '../../conversation/slots/native-chat-transcript-slot-selection'
-import { useNativeChatNewRowsMarker } from './native-chat-new-rows-marker'
-
-const THREAD: AgentJournalTurnScope = { kind: 'thread' }
-const inTurn = (turnItemId: string): AgentJournalTurnScope => ({ kind: 'turn', turnItemId })
-
-function item(
- itemId: string,
- sequence: number,
- body: AgentJournalRenderItem['body'],
- turnScope?: AgentJournalTurnScope
-): AgentJournalRenderItem {
- const row: AgentJournalRenderItem = { itemId, sequence, revision: 1, observedAt: sequence, body }
- return turnScope ? { ...row, turnScope } : row
-}
-
-const message = (
- id: string,
- sequence: number,
- role: 'user' | 'assistant',
- scope: AgentJournalTurnScope
-): AgentJournalRenderItem =>
- item(id, sequence, { kind: 'message', role, blocks: [{ type: 'text', text: id }] }, scope)
-
-/** A turn record; one that names itself as its opener was opened by the provider, not a send. */
-function turn(
- id: string,
- sequence: number,
- state: 'running' | 'completed',
- opener = id
-): AgentJournalRenderItem {
- const body: AgentJournalTurnItem = {
- kind: 'turn',
- turnId: id,
- state,
- userItemId: opener,
- startedAt: sequence
- }
- return item(id, sequence, state === 'completed' ? { ...body, outcome: 'success' } : body, THREAD)
-}
-
-const HELD = agentJournalSubmissionKey('held')
-/** Accepted by the host and recorded, but not yet handed to the agent. */
-const held: AgentJournalSubmission = {
- clientMessageId: 'held',
- fence: 1,
- payloadFingerprint: 'held',
- dispatchState: 'pending',
- providerItemId: null,
- reason: null,
- submittedAt: 4,
- resolvedAt: null,
- handoverRecorded: true
-}
-const handedOver = (at: number): AgentJournalSubmission => ({
- ...held,
- dispatchState: 'accepted',
- providerItemId: HELD,
- resolvedAt: at,
- handedOverAt: at
-})
-
-/** What NativeChatMessageList hands the marker for these journal items. */
-function pane(items: AgentJournalRenderItem[], submissions: AgentJournalSubmission[]) {
- const working = owesStructuredAgentSessionWork(items, submissions)
- const messages = projectStructuredAgentSessionMessages(
- withNativeChatCutTurnNotices(items),
- [],
- submissions
- )
- const membership = nativeChatTurnMembership(messages, { items, submissions })
- const slots = buildNativeChatTranscriptSlots({
- messages: nativeChatRowsInDrawOrder(messages, membership.drawOrder),
- turnKeys: nativeChatRowsInDrawOrder(membership.turnKeys, membership.drawOrder),
- liveTurnKey: membership.liveTurnKey,
- unresolvedRowIds: membership.unresolvedRowIds,
- receipts: new Map(),
- turnStatuses: { active: null, completedByTurn: {} },
- turnDiffs: new Map(),
- expandedTurnKeys: new Set(),
- isWorking: working,
- lifecycleWorking: working
- })
- return {
- ...splitNativeChatSlotsWaitingBehindLiveTurn(slots, items, false, submissions, { working }),
- host: { items }
- }
-}
-
-type Pane = ReturnType
-
-function leaveAndReturn(left: Pane, back: Pane) {
- const view = renderHook(
- ({ at, showing }: { at: Pane; showing: boolean }) =>
- useNativeChatNewRowsMarker(at.slots, at.waitingSlots, showing, at.host),
- { initialProps: { at: left, showing: true } }
- )
- view.rerender({ at: left, showing: false })
- view.rerender({ at: back, showing: true })
- return view
-}
-
-describe('the New line for a send that ran while the reader was away, from the journal', () => {
- let hasFocus: ReturnType
- beforeEach(() => {
- hasFocus = vi.spyOn(document, 'hasFocus').mockReturnValue(true)
- })
- afterEach(() => hasFocus.mockRestore())
-
- const EARLIER = [
- message('old-prompt', 1, 'user', inTurn('old-turn')),
- turn('old-turn', 2, 'completed', 'old-prompt'),
- message('old-answer', 3, 'assistant', inTurn('old-turn'))
- ]
-
- it('draws when a held send ran behind a turn the provider opened and drew nothing in', () => {
- const left = pane(
- [...EARLIER, turn('resumed', 4, 'running'), message(HELD, 5, 'user', THREAD)],
- [held]
- )
- const back = pane(
- [
- ...EARLIER,
- turn('resumed', 4, 'completed'),
- message(HELD, 6, 'user', inTurn('next')),
- turn('next', 7, 'completed', HELD),
- message('short-answer', 8, 'assistant', inTurn('next'))
- ],
- [handedOver(6)]
- )
- expect(leaveAndReturn(left, back).result.current.marker).toMatchObject({ look: 'line' })
- })
-
- it("weighs a new chat's first answer by height, its send held before any turn opened", () => {
- const left = pane([message(HELD, 1, 'user', THREAD)], [held])
- const back = pane(
- [
- message(HELD, 2, 'user', inTurn('first')),
- turn('first', 3, 'completed', HELD),
- message('first-answer', 4, 'assistant', inTurn('first'))
- ],
- [handedOver(2)]
- )
- expect(leaveAndReturn(left, back).result.current.marker).toMatchObject({ look: 'measure' })
- })
-})
diff --git a/src/renderer/src/components/native-chat/viewport/new-rows/native-chat-new-rows-marker.ts b/src/renderer/src/components/native-chat/viewport/new-rows/native-chat-new-rows-marker.ts
index 7e910ee5ab2..e31d5e1d225 100644
--- a/src/renderer/src/components/native-chat/viewport/new-rows/native-chat-new-rows-marker.ts
+++ b/src/renderer/src/components/native-chat/viewport/new-rows/native-chat-new-rows-marker.ts
@@ -3,12 +3,7 @@
import { useCallback, useMemo, useState } from 'react'
import { useOrcaWindowForegroundFocused } from '@/hooks/use-orca-window-foreground-focused'
import { compareAgentJournalPositions } from '../../../../../../shared/agent-session/journal/agent-session-journal-position'
-import type {
- AgentJournalPosition,
- AgentJournalRenderItem
-} from '../../../../../../shared/agent-session/journal/agent-session-journal-types'
-import type { AgentSessionLatestTurn } from '../../../../../../shared/agent-session/agent-session-wire'
-import { runningStructuredAgentSessionTurnId } from '../../../../../../shared/agent-session/view/structured-agent-session-live-turn'
+import type { AgentJournalPosition } from '../../../../../../shared/agent-session/journal/agent-session-journal-types'
import { useAppStore } from '@/store'
import { nativeChatMarksNewMessages } from '../../../../../../shared/native-chat/native-chat-appearance-settings'
import {
@@ -16,12 +11,16 @@ import {
nativeChatSlotKey
} from '../../conversation/slots/native-chat-transcript-slot-selection'
import type { NativeChatTranscriptSlot } from '../../conversation/slots/native-chat-transcript-slots'
-import {
- isMissedRow,
- isReaderPrompt,
- newestRowPosition,
- rowPosition
-} from './native-chat-missed-row-positions'
+
+/** Use journal positions for conversation rows, including folded-turn bars; terminal-backed rows have none and remain unmarked. */
+function rowPosition(slot: NativeChatTranscriptSlot): AgentJournalPosition | undefined {
+ return slot.kind === 'message' && slot.depth === 0 && (slot.drawsMessage || slot.statusAbove)
+ ? slot.message.journalPosition
+ : undefined
+}
+
+/** Before every row the journal places: what the reader has read to when no row precedes. */
+const BEFORE_EVERY_ROW: AgentJournalPosition = { sequence: -1, index: 0 }
/** Where a reader who looks away now has read to, and the reply the agent is still writing. */
type NativeChatLeftAt = {
@@ -29,12 +28,6 @@ type NativeChatLeftAt = {
position: AgentJournalPosition
/** A growing reply counts as missed from the position immediately before it. */
writing: { key: string; size: number; before: AgentJournalPosition } | null
- /** The host had a turn running, whether or not it had drawn a row yet. */
- running: boolean
- /** The reader's prompts there were, by row key: a key stays the same from send to journal. */
- prompts: ReadonlySet
- /** Those the host held in its queue, to hand to the agent later. */
- queuedPrompts: ReadonlySet
}
function rowSize(slot: NativeChatTranscriptSlot): number {
@@ -43,10 +36,27 @@ function rowSize(slot: NativeChatTranscriptSlot): number {
: 0
}
+function newestRowPosition(
+ slots: readonly NativeChatTranscriptSlot[],
+ limit?: AgentJournalPosition
+): AgentJournalPosition {
+ let newest = BEFORE_EVERY_ROW
+ for (const slot of slots) {
+ const at = rowPosition(slot)
+ if (
+ at &&
+ (!limit || compareAgentJournalPositions(at, limit) < 0) &&
+ compareAgentJournalPositions(at, newest) > 0
+ ) {
+ newest = at
+ }
+ }
+ return newest
+}
+
function nativeChatLeftAt(
slots: readonly NativeChatTranscriptSlot[],
- waitingSlots: readonly NativeChatTranscriptSlot[],
- running: boolean
+ waitingSlots: readonly NativeChatTranscriptSlot[]
): NativeChatLeftAt {
const all = [...slots, ...waitingSlots]
// Later user prompts or held sends do not stop the turn’s latest assistant row from growing.
@@ -61,18 +71,7 @@ function nativeChatLeftAt(
const writing = at
? { key: nativeChatSlotKey(writer), size: rowSize(writer), before: newestRowPosition(all, at) }
: null
- const prompts = new Set()
- const queuedPrompts = new Set()
- for (const slot of all) {
- if (isReaderPrompt(slot)) {
- prompts.add(slot.message.id)
- // Held by the host, not merely drawn after a turn that is still opening.
- if (slot.message.queued) {
- queuedPrompts.add(slot.message.id)
- }
- }
- }
- return { position: newestRowPosition(all), writing, prompts, queuedPrompts, running }
+ return { position: newestRowPosition(all), writing }
}
/** The first row that came while the reader was away, and the journal stretch it came in. */
@@ -84,9 +83,23 @@ export type NativeChatMissedRows = {
through: AgentJournalPosition
}
+function isMissedRow(
+ slot: NativeChatTranscriptSlot,
+ after: AgentJournalPosition,
+ through: AgentJournalPosition
+): boolean {
+ const at = rowPosition(slot)
+ return (
+ at !== undefined &&
+ compareAgentJournalPositions(at, after) > 0 &&
+ compareAgentJournalPositions(at, through) <= 0 &&
+ (slot.kind !== 'message' || slot.message.role !== 'user' || slot.message.from !== undefined)
+ )
+}
+
function nativeChatMissedRows(
slots: readonly NativeChatTranscriptSlot[],
- { position, writing }: Pick
+ { position, writing }: NativeChatLeftAt
): NativeChatMissedRows | null {
const row = writing && slots.find((slot) => nativeChatSlotKey(slot) === writing.key)
const after = writing && !(row && rowSize(row) === writing.size) ? writing.before : position
@@ -95,63 +108,6 @@ function nativeChatMissedRows(
return first ? { key: nativeChatSlotKey(first), after, through } : null
}
-/** How the marker shows: a line only where it helps, measured by height when nothing else calls for it. */
-export type NativeChatNewRowsMarkerLook =
- /** Laid out but not seen, so the marker can measure what was missed below it. */
- | 'measure'
- | 'line'
- /** Rows were missed, but too few to need a line: only the announcement tells of them. */
- | 'none'
- /** The line was seen and has faded; it keeps its space so nothing below it moves. */
- | 'faded'
-
-/** Another agent posted, or a prompt the reader did not just send ran while they were away. */
-function nativeChatMissedNeedsLine(
- slots: readonly NativeChatTranscriptSlot[],
- left: NativeChatLeftAt,
- { after, through }: NativeChatMissedRows
-): boolean {
- const first = slots.find((slot) => isMissedRow(slot, after, through))
- const firstAt = first && rowPosition(first)
- return slots.some(
- (slot) =>
- // The only user rows a missed stretch admits are ones another agent sent through Orca.
- (slot.kind === 'message' &&
- slot.message.role === 'user' &&
- isMissedRow(slot, after, through)) ||
- (isReaderPrompt(slot) && nativeChatPromptRanWhileAway(slot, left, firstAt))
- )
-}
-
-/** A queued send handed over, or a prompt this pane never sent (an auto-continue, a connector delivery). */
-function nativeChatPromptRanWhileAway(
- slot: Extract,
- left: NativeChatLeftAt,
- /** Where the first missed row is. */
- firstMissedAt: AgentJournalPosition | undefined
-): boolean {
- const at = rowPosition(slot)
- const key = slot.message.id
- if (
- at === undefined ||
- slot.message.queued === true ||
- compareAgentJournalPositions(at, left.position) <= 0
- ) {
- return false
- }
- if (!left.prompts.has(key)) {
- return true
- }
- // A queued send ran behind a turn the host had running (drawn or not), or behind work the reader
- // missed. The host also holds a chat's first send while the chat opens; no turn runs then, so that
- // one runs first, its reply the answer awaited.
- return (
- left.queuedPrompts.has(key) &&
- (left.running ||
- (firstMissedAt !== undefined && compareAgentJournalPositions(at, firstMissedAt) > 0))
- )
-}
-
export type NativeChatNewRowsMarkerPlacement = {
/** Key of the row the marker draws in. */
key: string
@@ -159,17 +115,10 @@ export type NativeChatNewRowsMarkerPlacement = {
}
export type NativeChatNewRowsMarkerState = NativeChatNewRowsMarkerPlacement & {
- look: Exclude
/** The reader has just come back: bring the marker into view, once. */
arriving: boolean
- /** The window is in front and this pane is showing: a seen line's clock may run. */
- watching: boolean
onArrived: () => void
onDismiss: () => void
- /** With `look: 'measure'`: whether what came below the marker is tall enough to need a line. */
- onMeasured: (tall: boolean) => void
- /** With `look: 'line'`: the reader has seen it for long enough, so it fades out. */
- onFaded: () => void
}
/** Place above the first missed row, or its turn bar when the two lines would otherwise touch. */
@@ -204,15 +153,9 @@ export function useNativeChatNewRowsMarker(
/** Rows held behind the running turn: seen and missed like any other, drawn outside `slots`. */
waitingSlots: readonly NativeChatTranscriptSlot[],
/** The pane is the one showing, and shows what the host holds now. */
- isShowingLatest: boolean,
- /** The host's journal: its turn record, not row liveness, says whether a turn is running. A held
- * first send has no turn yet, and a turn the provider opened may have drawn no row. */
- host: { items: readonly AgentJournalRenderItem[]; latestTurn?: AgentSessionLatestTurn | null }
+ isShowingLatest: boolean
): {
- /** The marker to draw, when rows were missed and a line helps. */
marker: NativeChatNewRowsMarkerState | undefined
- /** Rows came while the reader was away, line or not; it counts returns, so each is announced. */
- announcement: number | undefined
/** The slot drawing the marker, or -1. */
index: number
/** The reader answered the conversation, so nothing in it is news to them. */
@@ -229,118 +172,40 @@ export function useNativeChatNewRowsMarker(
/** Stands until the reader answers. */
missed: NativeChatMissedRows | null
arriving: boolean
- look: NativeChatNewRowsMarkerLook
- /** While measuring: the faded line from before, kept in place if this return needs no line. */
- faded: NativeChatMissedRows | null
- /** Returns that found rows missed. */
- returns: number
- }>({
- watching,
- left: null,
- missed: null,
- arriving: false,
- look: 'measure',
- faded: null,
- returns: 0
- })
+ }>({ watching, left: null, missed: null, arriving: false })
if (!enabled) {
if (!seen.watching || seen.left !== null || seen.missed !== null) {
- setSeen({ ...seen, watching, left: null, missed: null, arriving: false, faded: null })
+ setSeen({ watching, left: null, missed: null, arriving: false })
}
} else if (seen.watching !== watching) {
const all = [...slots, ...waitingSlots]
if (watching) {
- const missed = seen.left && nativeChatMissedRows(all, seen.left)
- // Weighed over the transcript only: a row still held behind the turn is marked once it joins it.
- const needsLine =
- seen.left !== null && missed !== null && nativeChatMissedNeedsLine(slots, seen.left, missed)
- // Removing a faded line for no new one would move the rows below it with nothing to show why.
- const faded =
- seen.look === 'faded' && nativeChatNewRowsMarkerPlacement(all, seen.missed) !== undefined
- ? seen.missed
- : null
- setSeen(
- seen.left && missed
- ? {
- watching,
- left: null,
- missed,
- arriving: true,
- look: needsLine ? 'line' : 'measure',
- faded: needsLine ? null : faded,
- returns: seen.returns + 1
- }
- : // Nothing new: a marker from before, faded or not drawn, stays as it was.
- { ...seen, watching, left: null, arriving: false }
- )
+ const missed = seen.left ? nativeChatMissedRows(all, seen.left) : seen.missed
+ setSeen({ watching, left: null, missed, arriving: seen.left !== null && missed !== null })
} else {
- // An unanswered line whose row still stands is kept: the reader may be midway through it.
- // Once faded or never drawn, the next return is weighed afresh.
- const marked =
- (seen.look === 'line' || seen.look === 'measure') &&
- nativeChatNewRowsMarkerPlacement(all, seen.missed) !== undefined
- setSeen({
- ...seen,
- watching,
- left: marked
- ? null
- : nativeChatLeftAt(
- slots,
- waitingSlots,
- runningStructuredAgentSessionTurnId(host) !== null
- )
- })
+ // An unanswered marker whose row still stands is kept: the reader may be midway through it.
+ const marked = nativeChatNewRowsMarkerPlacement(all, seen.missed) !== undefined
+ setSeen({ ...seen, watching, left: marked ? null : nativeChatLeftAt(slots, waitingSlots) })
}
}
- const { missed, look } = seen
+ const { missed } = seen
const placement = useMemo(() => nativeChatNewRowsMarkerPlacement(slots, missed), [slots, missed])
const dismiss = useCallback(() => {
// Where they left as well: an answer sent before the chat has caught up settles that too.
setSeen((held) =>
- held.missed === null && held.left === null
- ? held
- : { ...held, missed: null, left: null, faded: null }
+ held.missed === null && held.left === null ? held : { ...held, missed: null, left: null }
)
}, [])
const onArrived = useCallback(() => {
setSeen((held) => (held.arriving ? { ...held, arriving: false } : held))
}, [])
- const onMeasured = useCallback((tall: boolean) => {
- setSeen((held) =>
- held.look !== 'measure'
- ? held
- : tall
- ? { ...held, look: 'line', faded: null }
- : held.faded
- ? { ...held, missed: held.faded, look: 'faded', arriving: false, faded: null }
- : { ...held, look: 'none', arriving: false }
- )
- }, [])
- const onFaded = useCallback(() => {
- setSeen((held) => (held.look === 'line' ? { ...held, look: 'faded' } : held))
- }, [])
const { key, place } = placement ?? {}
const marker = useMemo(
() =>
- key && place && look !== 'none'
- ? {
- key,
- place,
- look,
- arriving: seen.arriving,
- watching: focused,
- onArrived,
- onDismiss: dismiss,
- onMeasured,
- onFaded
- }
+ key && place
+ ? { key, place, arriving: seen.arriving, onArrived, onDismiss: dismiss }
: undefined,
- [key, place, look, seen.arriving, focused, onArrived, dismiss, onMeasured, onFaded]
+ [key, place, seen.arriving, onArrived, dismiss]
)
- return {
- marker,
- announcement: key ? seen.returns : undefined,
- index: marker ? nativeChatSlotIndexOf(slots, key) : -1,
- dismiss
- }
+ return { marker, index: nativeChatSlotIndexOf(slots, key), dismiss }
}
diff --git a/src/renderer/src/components/settings/chat/chat-behavior-search.ts b/src/renderer/src/components/settings/chat/chat-behavior-search.ts
index b990c69d389..57178866f34 100644
--- a/src/renderer/src/components/settings/chat/chat-behavior-search.ts
+++ b/src/renderer/src/components/settings/chat/chat-behavior-search.ts
@@ -86,7 +86,7 @@ export const getChatBehaviorEntriesByKey = createLocalizedCatalog(() => ({
),
description: translate(
'components.settings.nativeChat.markNewMessagesCopy',
- "When you come back to a chat, a New line marks what you missed if it's long or someone else wrote, and scrolls there. It fades once you've seen it."
+ 'Coming back to a chat draws a New line above what arrived while you were away, and scrolls to it if you were reading the latest.'
),
keywords: [translate('components.settings.nativeChat.markNewMessagesSearchUnread', 'unread')]
},
diff --git a/src/renderer/src/i18n/locales/de.json b/src/renderer/src/i18n/locales/de.json
index 0c83b1a6630..062bab6b7c7 100644
--- a/src/renderer/src/i18n/locales/de.json
+++ b/src/renderer/src/i18n/locales/de.json
@@ -20681,7 +20681,7 @@
"scrollToLatestOnSendCopy": "Senden im hochgescrollten Zustand springt zur neuesten Nachricht und folgt der Antwort. Deaktiviere dies, um deine Position zu behalten.",
"scrollToLatestOnSendSearchPosition": "Position",
"markNewMessagesTitle": "Neue Nachrichten bei der Rückkehr in einen Chat markieren",
- "markNewMessagesCopy": "Wenn du zu einem Chat zurückkehrst, markiert eine Neu-Linie, was du verpasst hast, wenn es lang ist oder jemand anderes geschrieben hat, und scrollt dorthin. Sie verblasst, sobald du sie gesehen hast.",
+ "markNewMessagesCopy": "Bei der Rückkehr in einen Chat erscheint eine Neu-Linie über dem, was in deiner Abwesenheit eingegangen ist. Warst du bei der neuesten Nachricht, scrollt der Chat dorthin.",
"markNewMessagesSearchUnread": "ungelesen",
"inlineVisualsTitle": "Eingebettete Grafiken",
"inlineVisualsCopy": "Dem Agenten erlauben, Diagramme, Schaubilder und Mockups in seinen Antworten anzuzeigen. Gilt für neu gestartete Chats.",
diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json
index dc1abe90ef6..a5efbd1c672 100644
--- a/src/renderer/src/i18n/locales/en.json
+++ b/src/renderer/src/i18n/locales/en.json
@@ -21960,7 +21960,7 @@
"scrollToLatestOnSendCopy": "Sending while scrolled up jumps to the latest message and follows the reply. Turn off to keep your place.",
"scrollToLatestOnSendSearchPosition": "position",
"markNewMessagesTitle": "Mark new messages when returning to a chat",
- "markNewMessagesCopy": "When you come back to a chat, a New line marks what you missed if it's long or someone else wrote, and scrolls there. It fades once you've seen it.",
+ "markNewMessagesCopy": "Coming back to a chat draws a New line above what arrived while you were away, and scrolls to it if you were reading the latest.",
"markNewMessagesSearchUnread": "unread",
"inlineVisualsTitle": "Inline visuals",
"inlineVisualsCopy": "Let the agent show charts, diagrams and mockups inside its replies. Applies to newly started chats.",
diff --git a/src/renderer/src/i18n/locales/es.json b/src/renderer/src/i18n/locales/es.json
index ee0c7657740..c85e0fedcdd 100644
--- a/src/renderer/src/i18n/locales/es.json
+++ b/src/renderer/src/i18n/locales/es.json
@@ -20448,7 +20448,7 @@
"scrollToLatestOnSendCopy": "Enviar con el chat desplazado hacia arriba salta al último mensaje y sigue la respuesta. Desactívalo para mantener tu posición.",
"scrollToLatestOnSendSearchPosition": "posición",
"markNewMessagesTitle": "Marcar los mensajes nuevos al volver a un chat",
- "markNewMessagesCopy": "Cuando vuelves a un chat, una línea Nuevo marca lo que te perdiste si es largo o si otra persona escribió, y se desplaza hasta allí. Se desvanece en cuanto la ves.",
+ "markNewMessagesCopy": "Al volver a un chat aparece una línea Nuevo encima de lo que llegó mientras no estabas, y el chat se desplaza hasta ella si estabas leyendo lo más reciente.",
"markNewMessagesSearchUnread": "no leído",
"followUpBehaviorCopy": "Los mensajes enviados mientras el agente trabaja esperan como tarjetas hasta que termina el turno, en lugar de entrar en el turno en curso. Cmd/Ctrl+Intro hace lo contrario para un mensaje y, si no hay texto escrito, dirige la primera tarjeta en espera al turno en curso. Los mensajes con imágenes también esperan como tarjetas.",
"inlineVisualsTitle": "Elementos visuales inline",
diff --git a/src/renderer/src/i18n/locales/fr.json b/src/renderer/src/i18n/locales/fr.json
index f399f11898a..91e2377e60a 100644
--- a/src/renderer/src/i18n/locales/fr.json
+++ b/src/renderer/src/i18n/locales/fr.json
@@ -20827,7 +20827,7 @@
"scrollToLatestOnSendCopy": "Envoyer après avoir remonté le fil fait défiler jusqu’au dernier message et suit la réponse. Désactivez cette option pour garder votre position.",
"scrollToLatestOnSendSearchPosition": "position",
"markNewMessagesTitle": "Signaler les nouveaux messages au retour dans un chat",
- "markNewMessagesCopy": "Quand vous revenez dans un chat, une ligne Nouveau marque ce que vous avez manqué si c'est long ou si quelqu'un d'autre a écrit, et y fait défiler la vue. Elle s'estompe une fois vue.",
+ "markNewMessagesCopy": "En revenant dans un chat, une ligne Nouveau s'affiche au-dessus de ce qui est arrivé pendant votre absence, et le chat y défile si vous lisiez les derniers messages.",
"markNewMessagesSearchUnread": "non lu",
"followUpBehaviorCopy": "Les messages envoyés pendant que l’agent travaille attendent sous forme de cartes jusqu’à la fin du tour, au lieu d’entrer dans le tour en cours. Cmd/Ctrl+Entrée fait l’inverse pour un message et, si rien n’est saisi, dirige la première carte en attente vers le tour en cours. Les messages contenant des images attendent aussi sous forme de cartes.",
"inlineVisualsTitle": "Visuels intégrés",
diff --git a/src/renderer/src/i18n/locales/ja.json b/src/renderer/src/i18n/locales/ja.json
index 7f5f01a0252..511abc5dd2d 100644
--- a/src/renderer/src/i18n/locales/ja.json
+++ b/src/renderer/src/i18n/locales/ja.json
@@ -19971,7 +19971,7 @@
"scrollToLatestOnSendCopy": "上にスクロールした状態で送信すると、最新のメッセージに移動して返信を追従します。オフにすると現在の位置を維持します。",
"scrollToLatestOnSendSearchPosition": "位置",
"markNewMessagesTitle": "チャットに戻ったときに新着メッセージを示す",
- "markNewMessagesCopy": "チャットに戻ったとき、見逃した内容が長い場合や他の人が書き込んだ場合は、「新着」の線でその位置を示し、そこまでスクロールします。線は一度見るとフェードアウトします。",
+ "markNewMessagesCopy": "チャットに戻ると、離れている間に届いたメッセージの上に「新着」の線を表示します。最新のメッセージを読んでいた場合は、そこまでスクロールします。",
"markNewMessagesSearchUnread": "未読",
"followUpBehaviorCopy": "Agent の作業中に送信したメッセージは、実行中のターンに送られず、ターンが終わるまでカードとして待機します。Cmd/Ctrl+Enter では 1 件だけその逆になり、何も入力されていない場合は最初の待機カードを実行中のターンに送ります。画像付きメッセージもカードとして待機します。",
"inlineVisualsTitle": "インライン表示",
diff --git a/src/renderer/src/i18n/locales/ko.json b/src/renderer/src/i18n/locales/ko.json
index d6b619537b2..e15a1ef2e38 100644
--- a/src/renderer/src/i18n/locales/ko.json
+++ b/src/renderer/src/i18n/locales/ko.json
@@ -19968,7 +19968,7 @@
"scrollToLatestOnSendCopy": "위로 스크롤한 상태에서 보내면 최신 메시지로 이동하고 답장을 따라갑니다. 끄면 현재 위치가 유지됩니다.",
"scrollToLatestOnSendSearchPosition": "위치",
"markNewMessagesTitle": "채팅으로 돌아올 때 새 메시지 표시",
- "markNewMessagesCopy": "채팅으로 돌아왔을 때 놓친 내용이 길거나 다른 사람이 글을 썼다면 '새 메시지' 선으로 그 위치를 표시하고 그곳으로 스크롤합니다. 한 번 보고 나면 서서히 흐려집니다.",
+ "markNewMessagesCopy": "채팅으로 돌아오면 자리를 비운 동안 도착한 내용 위에 '새 메시지' 선을 표시합니다. 최신 메시지를 보고 있었다면 그 위치로 스크롤합니다.",
"markNewMessagesSearchUnread": "읽지 않음",
"followUpBehaviorCopy": "Agent가 작업하는 동안 보낸 메시지는 진행 중인 턴에 들어가지 않고 턴이 끝날 때까지 카드로 대기합니다. Cmd/Ctrl+Enter를 누르면 메시지 하나에 대해 반대로 동작하며, 입력한 내용이 없으면 첫 대기 카드를 진행 중인 턴으로 보냅니다. 이미지가 포함된 메시지도 카드로 대기합니다.",
"inlineVisualsTitle": "인라인 시각 자료",
diff --git a/src/renderer/src/i18n/locales/pt.json b/src/renderer/src/i18n/locales/pt.json
index e59c8c9b986..e6a95271fa6 100644
--- a/src/renderer/src/i18n/locales/pt.json
+++ b/src/renderer/src/i18n/locales/pt.json
@@ -22217,7 +22217,7 @@
"scrollToLatestOnSendCopy": "Enviar com o chat rolado para cima leva à mensagem mais recente e acompanha a resposta. Desative para manter sua posição.",
"scrollToLatestOnSendSearchPosition": "posição",
"markNewMessagesTitle": "Marcar mensagens novas ao voltar para um chat",
- "markNewMessagesCopy": "Quando você volta para um chat, uma linha Novas marca o que você perdeu se for longo ou se outra pessoa escreveu, e rola até lá. Ela esmaece depois que você a vê.",
+ "markNewMessagesCopy": "Ao voltar para um chat, uma linha Novas aparece acima do que chegou enquanto você estava fora, e o chat rola até ela se você estava lendo as mais recentes.",
"markNewMessagesSearchUnread": "não lida",
"inlineVisualsTitle": "Visualizações nas respostas",
"inlineVisualsCopy": "Permitir que o agente mostre gráficos, diagramas e mockups nas respostas. Aplica-se a novos chats.",
diff --git a/src/renderer/src/i18n/locales/ru.json b/src/renderer/src/i18n/locales/ru.json
index 3645581871e..2a19b39d005 100644
--- a/src/renderer/src/i18n/locales/ru.json
+++ b/src/renderer/src/i18n/locales/ru.json
@@ -21361,7 +21361,7 @@
"scrollToLatestOnSendCopy": "Отправка при прокрутке вверх переносит к последнему сообщению и следит за ответом. Отключите, чтобы остаться на месте.",
"scrollToLatestOnSendSearchPosition": "позиция",
"markNewMessagesTitle": "Отмечать новые сообщения при возвращении в чат",
- "markNewMessagesCopy": "Когда вы возвращаетесь в чат, линия «Новое» отмечает то, что вы пропустили, если пропущено много или написал кто-то другой, и прокручивает туда. Она плавно гаснет, как только вы её увидите.",
+ "markNewMessagesCopy": "При возвращении в чат над тем, что пришло в ваше отсутствие, появляется линия «Новое». Если вы читали последние сообщения, чат прокручивается к ней.",
"markNewMessagesSearchUnread": "непрочитанные",
"inlineVisualsTitle": "Визуализации в чате",
"inlineVisualsCopy": "Агент сможет показывать графики, схемы и макеты прямо в ответах. Применяется к новым чатам.",
diff --git a/src/renderer/src/i18n/locales/tr.json b/src/renderer/src/i18n/locales/tr.json
index 2442c221309..84d6397c7f8 100644
--- a/src/renderer/src/i18n/locales/tr.json
+++ b/src/renderer/src/i18n/locales/tr.json
@@ -20656,7 +20656,7 @@
"scrollToLatestOnSendCopy": "Yukarı kaydırılmışken göndermek en son mesaja atlar ve yanıtı takip eder. Konumunuzu korumak için kapatın.",
"scrollToLatestOnSendSearchPosition": "konum",
"markNewMessagesTitle": "Bir sohbete dönünce yeni mesajları işaretle",
- "markNewMessagesCopy": "Bir sohbete döndüğünüzde, kaçırdıklarınız uzunsa ya da başka biri yazdıysa bir Yeni çizgisi bunları işaretler ve oraya kaydırır. Gördükten sonra yavaşça solar.",
+ "markNewMessagesCopy": "Bir sohbete döndüğünüzde, siz yokken gelenlerin üstünde bir Yeni çizgisi gösterilir. En son mesajları okuyorduysanız sohbet oraya kaydırılır.",
"markNewMessagesSearchUnread": "okunmamış",
"inlineVisualsTitle": "Yanıtlarda görseller",
"inlineVisualsCopy": "Ajanın yanıtlarında grafikler, diyagramlar ve taslaklar göstermesine izin verin. Yeni başlatılan sohbetlere uygulanır.",
diff --git a/src/renderer/src/i18n/locales/zh-Hant.json b/src/renderer/src/i18n/locales/zh-Hant.json
index fceccf2497b..9a250e4ea66 100644
--- a/src/renderer/src/i18n/locales/zh-Hant.json
+++ b/src/renderer/src/i18n/locales/zh-Hant.json
@@ -20364,7 +20364,7 @@
"scrollToLatestOnSendCopy": "向上捲動時傳送訊息會跳到最新訊息並跟隨回覆。關閉後會保留目前位置。",
"scrollToLatestOnSendSearchPosition": "位置",
"markNewMessagesTitle": "返回聊天時標記新訊息",
- "markNewMessagesCopy": "返回聊天時,如果錯過的內容很長或有其他人發了訊息,會用「新訊息」分隔線標出你錯過的內容並捲動到那裡。看過之後它會淡出。",
+ "markNewMessagesCopy": "返回聊天時,在你離開期間收到的內容上方顯示「新訊息」分隔線;如果你之前在看最新訊息,會捲動到該處。",
"markNewMessagesSearchUnread": "未讀",
"inlineVisualsTitle": "內嵌視覺化",
"inlineVisualsCopy": "允許代理程式在其回覆中顯示圖表、示意圖和原型圖。適用於新啟動的聊天。",
diff --git a/src/renderer/src/i18n/locales/zh.json b/src/renderer/src/i18n/locales/zh.json
index d8a00d1e5ad..2d291616a23 100644
--- a/src/renderer/src/i18n/locales/zh.json
+++ b/src/renderer/src/i18n/locales/zh.json
@@ -20315,7 +20315,7 @@
"turnDiffsSearchChangedFiles": "已更改文件",
"turnDiffsSearchEdits": "编辑",
"markNewMessagesTitle": "返回聊天时标记新消息",
- "markNewMessagesCopy": "返回聊天时,如果错过的内容很长或有其他人发了消息,会用“新消息”分隔线标出你错过的内容并滚动到那里。看过之后它会淡出。",
+ "markNewMessagesCopy": "返回聊天时,在你离开期间收到的内容上方显示“新消息”分隔线;如果你之前在看最新消息,会滚动到该处。",
"markNewMessagesSearchUnread": "未读"
},
"voice": {