Skip to content

fix(ui): preserve indentation in diff-backed tool rendering#152

Merged
srothgan merged 1 commit into
mainfrom
fix/ui-diff-indentation
Apr 20, 2026
Merged

fix(ui): preserve indentation in diff-backed tool rendering#152
srothgan merged 1 commit into
mainfrom
fix/ui-diff-indentation

Conversation

@srothgan
Copy link
Copy Markdown
Owner

@srothgan srothgan commented Apr 20, 2026

Summary

  • preserve leading source indentation in diff-backed tool rendering while keeping the 0.11.2 line-number and hanging-indent layout
  • keep nested diff indentation inside non-Execute tool cards and align capped Write omission markers with the rest of the diff block
  • add regression tests for raw diff indentation, wrapped diff continuations, and tool-card diff rendering

Why

The 0.11.2 diff renderer improved tool-call diffs with line numbers and hanging indents, but diff rows still dropped leading source whitespace during wrapping. That made indented code inside Edit and Write cards render flush-left in the TUI, which looked wrong and made nested code structure harder to read.

Closes #

Validation

  • Automated:
    • cargo fmt --all -- --check
    • cargo clippy --all-targets --all-features -- -D warnings
    • cargo test
    • cargo check --offline
  • Manual:
    • @srothgan confirmed the updated TUI rendering now looks correct for indented diff content

Notes

  • Breaking changes: N/A
  • Docs updated: N/A

- keep leading source indentation when wrapping numbered diff rows
- retain nested tool-card diff indent and aligned write omission markers
- add regression tests for raw diff indentation and tool-call wrapped diff rendering
@srothgan srothgan self-assigned this Apr 20, 2026
@srothgan srothgan added the type: bug Something is not working label Apr 20, 2026
@srothgan srothgan merged commit c883f8a into main Apr 20, 2026
9 checks passed
@srothgan srothgan deleted the fix/ui-diff-indentation branch April 20, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug Something is not working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant