From 05d48f291815f43e0eb8a018475dcfbb66248a1c Mon Sep 17 00:00:00 2001 From: Chinesezjc Date: Thu, 30 Jul 2026 22:40:39 +0800 Subject: [PATCH] fix(web-read-card): carry the base's required read offset in fixtures and specs The base's ReadResultView now requires `offset` (persisted so an empty window still knows its start). The connection fixture's read sample and read-card.spec's resultRead helper supply it (the window's first line, 41). --- packages/client/connection/src/client/fixture.ts | 2 +- packages/client/ui-conversation/tests/read-card.spec.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/connection/src/client/fixture.ts b/packages/client/connection/src/client/fixture.ts index 0a2379c70e..3cc7bffa78 100644 --- a/packages/client/connection/src/client/fixture.ts +++ b/packages/client/connection/src/client/fixture.ts @@ -397,7 +397,7 @@ function presentResult(name: string, argsRaw: string, resultText: string): ToolR // so `call.card` alone does not distinguish it from edit/write. if (name === 'read') { return { - card: 'read', path: READ_SAMPLE_PATH, lines: READ_SAMPLE_LINES, + card: 'read', path: READ_SAMPLE_PATH, offset: READ_SAMPLE_FIRST_LINE, lines: READ_SAMPLE_LINES, totalLines: READ_SAMPLE_TOTAL, lang: 'ts', content: text(resultText), } } diff --git a/packages/client/ui-conversation/tests/read-card.spec.tsx b/packages/client/ui-conversation/tests/read-card.spec.tsx index d5804b505b..79c7ab1392 100644 --- a/packages/client/ui-conversation/tests/read-card.spec.tsx +++ b/packages/client/ui-conversation/tests/read-card.spec.tsx @@ -46,7 +46,7 @@ const sampleLines = [ /** The read tool's own result view for a settled file read. */ const resultRead = (over?: Partial>): ToolResultView => ({ - card: 'read', path: 'src/a.ts', lines: sampleLines, totalLines: 180, lang: 'ts', ...over, + card: 'read', path: 'src/a.ts', offset: 41, lines: sampleLines, totalLines: 180, lang: 'ts', ...over, }) const running = (over?: Partial): RunningToolCall => ({