diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index 001565ba..ff1a8edc 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Added + +- **HTML export line numbers**: Read tool calls in HTML exports now display line number ranges (e.g., `file.txt:10-20`) when offset/limit parameters are used, matching the TUI display format. Line numbers appear in yellow color for better visibility. ([#166](https://github.com/badlogic/pi-mono/issues/166)) + ## [0.18.1] - 2025-12-10 ### Added diff --git a/packages/coding-agent/src/core/export-html.ts b/packages/coding-agent/src/core/export-html.ts index bc628faf..15078536 100644 --- a/packages/coding-agent/src/core/export-html.ts +++ b/packages/coding-agent/src/core/export-html.ts @@ -350,7 +350,18 @@ function formatToolExecution( case "read": { const path = shortenPath((args?.file_path as string) || (args?.path as string) || ""); - html = `
read ${escapeHtml(path || "...")}
`; + const offset = args?.offset as number | undefined; + const limit = args?.limit as number | undefined; + + // Build path display with offset/limit suffix (in yellow color if offset/limit used) + let pathHtml = escapeHtml(path || "..."); + if (offset !== undefined || limit !== undefined) { + const startLine = offset ?? 1; + const endLine = limit !== undefined ? startLine + limit - 1 : ""; + pathHtml += `:${startLine}${endLine ? `-${endLine}` : ""}`; + } + + html = `
read ${pathHtml}
`; if (result) { const output = getTextOutput(); if (output) {