Skip to content

fix: bound long-line tool diff previews - #60

Merged
johnnyhuy merged 3 commits into
mainfrom
agent/issue-59-tool-diff-preview
Nov 13, 2026
Merged

johnnyhuy merged 3 commits into
mainfrom
agent/issue-59-tool-diff-preview

Conversation

@johnnyhuy

@johnnyhuy johnnyhuy commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Edit and write cards now bound their input diff previews to 2,000 characters, including when a single line is longer than the limit. A notice explains the shortened preview; Show more reveals the complete diff and Copy input retains the full original text.

Part of #2
Closes #59

Verification

  • mise exec -- bun install --frozen-lockfile passed.
  • mise exec -- bun run lint passed.
  • mise exec -- bun run typecheck passed.
  • mise exec -- bun run test:unit passed, 90 tests.
  • mise exec -- bun run test:integration passed, 77 tests.
  • mise run build passed, including the checks and production bundle.
  • mise exec -- bun run test:e2e passed, 53 tests across seven real Electron suites.
  • git diff --check passed.

Proof

$ mise exec -- bun run test:unit
 Test Files  10 passed (10)
      Tests  90 passed (90)

$ mise exec -- bun run test:integration
 Test Files  13 passed (13)
      Tests  77 passed (77)

$ mise exec -- bun run test:e2e
 Test Files  7 passed (7)
      Tests  53 passed (53)

New component regressions cover the following behaviour.

  • bounds a single long edit line and preserves full inspection and copying
  • bounds a single long write line and preserves full inspection and copying
  • bounds multiple diff rows including the final partial row
  • does not shorten a 1999-character diff because of input path or labels
  • does not shorten a 2000-character diff because of input path or labels

The new Electron suite tests bounds a long write line, copies the full input and expands on request and its edit equivalent. It loads actual temporary Pi archives, checks the rendered preview length, verifies the native clipboard, expands by keyboard, shortens again and checks narrow-window horizontal overflow. It waits for the virtual row measurement to place the history footer below the resized card, then captures the changed surface to .tmp/proof/ and test-results/tool-preview/ for the existing CI artefact upload. Desktop proof shows the full card; minimum-window proof shows the reachable inspection controls after scrolling.

Playwright Electron capture succeeded. Direct inline image upload is blocked because browser discovery returned The browser access host is unavailable. Download the hosted Electron screenshot artefact. It includes the four PNGs under test-results/tool-preview/; CI retains the artefact until 20 November 2026. The uploaded PNGs were downloaded and visually checked. Scratch captures and logs are excluded from the commit.

The bound applies to the displayed diff, including line markers. Input path and label text no longer cause an otherwise short diff to offer Show more. This slice does not change saved archives or tool execution. Full expansion still renders the entire diff; broader tool-card work remains under #2.

The hosted desktop captures still draw the history footer across the tool card even though its DOM bounds pass the layout check. Local captures place it correctly. The bounded preview, truncation notice and inspection controls are visible in both. This discrepancy is recorded in #61 for investigation of capture timing versus virtual transcript layout. It is not claimed as fixed by this slice.

johnnyhuy and others added 3 commits November 13, 2026 14:35
Co-authored-by: OpenAI Codex <noreply@openai.com>
Co-authored-by: OpenAI Codex <noreply@openai.com>
Co-authored-by: OpenAI Codex <noreply@openai.com>
@johnnyhuy
johnnyhuy merged commit a25471a into main Nov 13, 2026
15 checks passed
@johnnyhuy
johnnyhuy deleted the agent/issue-59-tool-diff-preview branch November 13, 2026 07:49
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.

Bound long-line previews in edit and write tool cards

1 participant