Polish diff for the edit_file tool (#29911)

I added some padding to the editor, and removed the border around each
hunk as it would overlap in weird ways with the card container.

## Before

<img width="1148" alt="image"
src="https://github.com/user-attachments/assets/2018feaa-c847-4609-bc82-522660714b9a"
/>

## After

One Light:

<img width="1148" alt="image"
src="https://github.com/user-attachments/assets/4da1a4b6-0af2-4479-afcc-02da50178fd6"
/>

One Dark:

<img width="1148" alt="image"
src="https://github.com/user-attachments/assets/0168631d-7b76-4582-8174-c6e9c1297dc8"
/>


Release Notes:

- Improved displaying of diffs when the agent edits files.
This commit is contained in:
Antonio Scandurra 2025-05-05 13:17:15 +02:00 committed by GitHub
parent 0048e67832
commit 1adb4ecc95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 61 additions and 23 deletions

View file

@ -517,6 +517,7 @@ pub enum SoftWrap {
#[derive(Clone)]
pub struct EditorStyle {
pub background: Hsla,
pub horizontal_padding: Pixels,
pub local_player: PlayerColor,
pub text: TextStyle,
pub scrollbar_width: Pixels,
@ -531,6 +532,7 @@ impl Default for EditorStyle {
fn default() -> Self {
Self {
background: Hsla::default(),
horizontal_padding: Pixels::default(),
local_player: PlayerColor::default(),
text: TextStyle::default(),
scrollbar_width: Pixels::default(),
@ -20352,6 +20354,7 @@ impl Render for Editor {
&cx.entity(),
EditorStyle {
background,
horizontal_padding: Pixels::default(),
local_player: cx.theme().players().local(),
text: text_style,
scrollbar_width: EditorElement::SCROLLBAR_WIDTH,