tui(edit_file): skip diff rendering on tool failure#1422
tui(edit_file): skip diff rendering on tool failure#1422krissetto merged 5 commits intodocker:mainfrom
Conversation
8e90357 to
de6c5e8
Compare
New changesI adjusted the code to fix the Lint and Test errors on GitHub. A "Resolve conflict" message also appeared in the editfile.go file, which I've already accepted and committed. |
Signed-off-by: pnkcaht <samzoovsk19@gmail.com>
2ae905d to
d2f5f4e
Compare
New changesI performed the rebase and made the requested change based on reference #1432.
|
Signed-off-by: pnkcaht <samzoovsk19@gmail.com>
What was changed@krissetto Error handling & rendering
Why
|
|
@Pnkcaht Look at the diff edit error at the top on the terminal, we should style it to be consistent with the other tool errors you can see towards the bottom
|
Okay, I'll just finish a pull request for an issue I was working on and resolve this, thank you :) |
Signed-off-by: pnkcaht <samzoovsk19@gmail.com>
|
@krissetto I updated the rendering of the file editing failure to use ToolErrorMessageStyle, matching the error style used by other tools |
…yling Signed-off-by: pnkcaht <samzoovsk19@gmail.com>
|
We now display |
Signed-off-by: pnkcaht <samzoovsk19@gmail.com>
|
@krissetto I fixed the X 👍🏻 |




What I did
Adjusted the
edit_fileTUI rendering logic to skip diff rendering when the tool execution fails.When an edit fails (e.g. old text not found), the tool does not produce a valid file state. Attempting to render a diff in this scenario led to inconsistent layout calculations and caused the editor scrollbar to go out of bounds.
This change ensures that, on failure, the TUI renders only the formatted error message and avoids invalid diff rendering.
Related issue
Fixes #1366
Notes
edit_filetool returns an errorTests
Before
When an
edit_fileoperation failed (e.g. old text not found):After
When an
edit_fileoperation fails: