Skip to content

Render apply_patch tool calls as structured diffs - #44

Open
zcmx wants to merge 2 commits into
theblazehen:mainfrom
zcmx:improve/apply-patch-widget
Open

Render apply_patch tool calls as structured diffs#44
zcmx wants to merge 2 commits into
theblazehen:mainfrom
zcmx:improve/apply-patch-widget

Conversation

@zcmx

@zcmx zcmx commented Aug 12, 2026

Copy link
Copy Markdown

Problem

apply_patch tool calls currently fall back to the generic tool renderer, which makes multi-file patches difficult to scan in chat.

Changes

  • Add a dedicated expanded widget for apply_patch calls.
  • Parse add, update, move, and delete file sections from patch text.
  • Show per-file operation labels and addition/deletion counts.
  • Render added, removed, and context lines with distinct colors.
  • Provide a concise compact description with affected-file and line counts.
  • Fall back to the generic tool view when the patch payload cannot be parsed safely.

This PR contains only the apply-patch presentation change. Todo/reasoning UI, model persistence, SSE recovery, and hardened-build changes are not included.

Verification

  • ApplyPatchToolWidgetTest
  • :app:detekt
  • git diff --check

Local Android unit-test execution is blocked on this machine by the existing Java/Kotlin target mismatch in main (compileDebugJavaWithJavac targets 17 while compileDebugKotlin targets 21). The same widget tests passed in the downstream integrated branch where the toolchain is aligned.

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.

1 participant