Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a6804c6
fix(mobile): resolve terminal chat agents in desktop's order
AmoabaKelvin Oct 26, 2026
ad22a1c
fix(mobile): hide Codex foreground commands from the background-task …
AmoabaKelvin Oct 26, 2026
7d68511
refactor(native-chat): share diff-card gutter, basename and task count
AmoabaKelvin Oct 26, 2026
4b00890
fix(mobile): show clipped tool output sizes in KB/MB like desktop
AmoabaKelvin Oct 26, 2026
2c3e399
refactor(native-chat): share the tool-run header rules with mobile
AmoabaKelvin Oct 26, 2026
9c3a524
fix(native-chat): share tool-line detail rules; skip unsafe-only sear…
AmoabaKelvin Oct 26, 2026
5c77bb9
fix(mobile): copy message text with desktop's rule
AmoabaKelvin Oct 26, 2026
91e5c5b
refactor(native-chat): memoize shared tool-line view and output sizes…
AmoabaKelvin Oct 26, 2026
1ef57a9
fix(native-chat): read a lone result's preview from its narrowed body
AmoabaKelvin Oct 26, 2026
a7eaef8
chore(i18n): ship chat tool and stop copy in the runtime English catalog
AmoabaKelvin Oct 27, 2026
6248017
refactor(native-chat): move the pending-send echo rule to shared
AmoabaKelvin Oct 26, 2026
c5eaf29
fix(mobile): match chat echoes after their send boundary, sink unmatc…
AmoabaKelvin Oct 26, 2026
38d07cf
fix(mobile): keep glued photo captions and folded boundaries in echo …
AmoabaKelvin Oct 26, 2026
5681daf
fix(mobile): give image preview echoes the send time the occurrence r…
AmoabaKelvin Oct 26, 2026
8d833b6
fix(mobile): match echoes on image-normalized rows and cap open sends…
AmoabaKelvin Oct 26, 2026
69d3e26
test(mobile): drop a pending-order case the tail test already covers
AmoabaKelvin Oct 26, 2026
81df972
refactor(mobile): read the send boundary once and skip echo normaliza…
AmoabaKelvin Oct 26, 2026
d12dc9f
test(native-chat): type the occurrence case's pending send
AmoabaKelvin Oct 26, 2026
04224b7
test(mobile): drop the pending-echo wall-clock entry from the flaky-t…
AmoabaKelvin Oct 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion config/flaky-test-pattern-baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,6 @@
1 test-no-wall-clock:mobile/src/components/MobileHostCard-truthful-status.test.tsx
1 test-no-wall-clock:mobile/src/components/MobileHostCard.test.ts
1 test-no-wall-clock:mobile/src/components/pr-sidebar/pr-comment-card-web-avatar.test.tsx
1 test-no-wall-clock:mobile/src/session/native-chat/mobile-native-chat-pending-echo.test.ts
1 test-no-wall-clock:mobile/src/session/mobile-structured-send-new-action.test.ts
2 test-no-wall-clock:mobile/src/session/native-chat/composer/use-mobile-native-chat-message-send-draft-lifetime.test.ts
1 test-no-wall-clock:mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-send.test.ts
Expand Down
16 changes: 5 additions & 11 deletions mobile/src/session/MobileNativeChatDiffCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {
nativeChatEditFilePatchText
} from '../../../src/shared/native-chat/tools/native-chat-edit-cards'
import {
nativeChatEditFileBaseName,
nativeChatEditGutterChars,
unifiedLineNumber,
type NativeChatEditFile,
type NativeChatEditLine
Expand All @@ -21,10 +23,6 @@ import {
toolType
} from './native-chat/transcript/mobile-native-chat-tool-styles'

function baseName(path: string): string {
return path.split(/[\\/]/).at(-1) || path
}

function VerbIcon({ kind, size }: { kind: NativeChatEditFile['changeKind']; size: number }) {
const Icon = kind === 'added' ? FilePlus2 : kind === 'deleted' ? FileMinus2 : FilePen
return <Icon size={size} color={colors.textMuted} strokeWidth={2} />
Expand Down Expand Up @@ -98,11 +96,7 @@ function DiffCardRows({
}) {
const onLayout = useMobileNativeChatOpenedDetail()
const type = toolType(fontScale).code
// Leave unresolved gutters blank; snippet-relative numbers would imply real file positions.
const widest = file.lineNumbersKnown
? file.lines.reduce((max, line) => Math.max(max, unifiedLineNumber(line) ?? 0), 0)
: 0
const gutterChars = file.lineNumbersKnown ? Math.max(3, String(widest).length + 1) : 0
const gutterChars = nativeChatEditGutterChars(file)
const seen = new Map<string, number>()
return (
<MobileNativeChatOwnedScrollView
Expand Down Expand Up @@ -172,7 +166,7 @@ export function MobileNativeChatDiffCard({
numberOfLines={1}
accessibilityLabel={file.oldPath}
>
{baseName(file.oldPath)}
{nativeChatEditFileBaseName(file.oldPath)}
</Text>
<Text style={[styles.lineWord, type.row]}>→</Text>
</>
Expand All @@ -184,7 +178,7 @@ export function MobileNativeChatDiffCard({
suppressHighlighting={!openFile}
accessibilityRole={openFile ? 'link' : undefined}
>
{baseName(file.path)}
{nativeChatEditFileBaseName(file.path)}
</Text>
<Text style={[styles.lineMeta, type.meta]}>
{file.added > 0 ? <Text style={styles.countAdded}>{`+${file.added}`}</Text> : null}
Expand Down
40 changes: 19 additions & 21 deletions mobile/src/session/MobileNativeChatFullContent.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { useContext, useEffect, useState } from 'react'
import { useContext, useEffect, useMemo, useState } from 'react'
import { Pressable, Text, View, type TextStyle } from 'react-native'
import { truncateToolDetail } from '../../../src/shared/native-chat/tools/native-chat-tool-summary'
import {
truncateToolDetail,
MAX_TOOL_DETAIL_LENGTH
} from '../../../src/shared/native-chat/tools/native-chat-tool-summary'
isNativeChatToolOutputClipped,
NATIVE_CHAT_TOOL_OUTPUT_COPY,
nativeChatToolFullPayload,
nativeChatToolOutputPartialSizes
} from '../../../src/shared/native-chat/tools/native-chat-tool-output'
import type {
NativeChatMessage,
NativeChatToolResultBlock
} from '../../../src/shared/native-chat-types'
import type {
AgentJournalBoundedPayload,
AgentJournalItemBody
} from '../../../src/shared/agent-session-journal-types'
import type { AgentJournalBoundedPayload } from '../../../src/shared/agent-session-journal-types'
import { INLINE_TEXT_SELECTION } from '../components/inline-text-selection'
import { styles } from './native-chat/transcript/mobile-native-chat-message-styles'
import { toolStyles } from './native-chat/transcript/mobile-native-chat-tool-styles'
Expand Down Expand Up @@ -49,13 +49,6 @@ function ShowFull({
)
}

function outputOf(body: AgentJournalItemBody | null): AgentJournalBoundedPayload | null {
if (body?.kind === 'tool-call') {
return body.output ?? null
}
return body?.kind === 'diff' ? body.patch : null
}

export function MobileNativeChatToolOutput({
body,
type,
Expand Down Expand Up @@ -91,9 +84,8 @@ export function MobileNativeChatToolOutput({
? detail
: null
const full = current?.full
const clipped =
!full &&
(fullOutputItemId !== undefined || (!expanded && output.length > MAX_TOOL_DETAIL_LENGTH))
const clipped = isNativeChatToolOutputClipped(body, { expanded, fullLoaded: Boolean(full) })
const partial = useMemo(() => (full ? nativeChatToolOutputPartialSizes(full) : null), [full])
const showFull = (): void => {
if (fullOutputItemId === undefined || source === null) {
setExpanded(true)
Expand All @@ -109,7 +101,11 @@ export function MobileNativeChatToolOutput({
}
readMobileNativeChatItem(source, fullOutputItemId)
.then((item) =>
finish(item?.itemId === fullOutputItemId ? (outputOf(item.body) ?? undefined) : undefined)
finish(
item?.itemId === fullOutputItemId
? (nativeChatToolFullPayload(item.body) ?? undefined)
: undefined
)
)
.catch(() => finish())
}
Expand All @@ -129,9 +125,11 @@ export function MobileNativeChatToolOutput({
{full ? full.head : expanded ? output : truncateToolDetail(output)}
</Text>
</MobileNativeChatOwnedScrollView>
{full?.truncated ? (
{partial ? (
<Text style={styles.showFullText}>
Showing {new TextEncoder().encode(full.head).length} of {full.byteLength} bytes.
{NATIVE_CHAT_TOOL_OUTPUT_COPY.partial
.replace('{{shown}}', partial.shown)
.replace('{{total}}', partial.total)}
</Text>
) : null}
{clipped ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ const stable = {
{
id: 'pending',
text: 'follow up',
sentAt: 10,
baselineTailMessageId: 'live-user'
sentAt: 10
}
],
imagePreviewsByMessageId: { 'user-0': ['local:preview'] }
Expand Down
3 changes: 1 addition & 2 deletions mobile/src/session/MobileNativeChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,12 @@ export function MobileNativeChatView({
const { data } = useMemo(
() =>
buildMobileNativeChatTransientData({
messages,
folded,
streaming,
pending,
imagePreviewsByMessageId
}),
[messages, folded, streaming, pending, imagePreviewsByMessageId]
[folded, streaming, pending, imagePreviewsByMessageId]
)
const tail = useMobileNativeChatTailFollow({ hasItems: data.length > 0, scopeKey: sendSurfaceId })
const { jumpToTail, recordScrollMetrics, scrollMayLoadEarlier } = tail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ function drawn(state: StructuredAgentSessionState): Drawn {
const { items, messages } = phoneTranscript(state)
const folded = foldMobileNativeChatMessages(messages, 'claude')
const { data } = buildMobileNativeChatTransientData({
messages,
folded,
streaming: null,
pending: []
Expand Down Expand Up @@ -86,7 +85,6 @@ function listed(state: StructuredAgentSessionState): string[] {
const { items, messages } = phoneTranscript(state)
const folded = foldMobileNativeChatMessages(messages, 'claude')
const { data } = buildMobileNativeChatTransientData({
messages,
folded,
streaming: null,
pending: []
Expand Down
138 changes: 0 additions & 138 deletions mobile/src/session/mobile-native-chat-pending-baseline.test.ts

This file was deleted.

25 changes: 0 additions & 25 deletions mobile/src/session/mobile-native-chat-pending-baseline.ts

This file was deleted.

Loading
Loading