-
Notifications
You must be signed in to change notification settings - Fork 228
tui(edit_file): skip diff rendering on tool failure #1422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tui(edit_file): skip diff rendering on tool failure #1422
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 <[email protected]>
2ae905d to
d2f5f4e
Compare
New changesI performed the rebase and made the requested change based on reference #1432.
|
Signed-off-by: pnkcaht <[email protected]>
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 <[email protected]>
|
@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 <[email protected]>
|
We now display |
Signed-off-by: pnkcaht <[email protected]>
|
@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: