-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(diffViewEditor): Add autofocus feature to preserve focus on edit… #5672
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
Conversation
…iling whitespace in user edit comparison
|
Hey @felixAnhalt Thank you for your work on this! I was wondering if we should open the edited files after a successful edit. The main concern is that if no files are opened, the user might have trouble knowing which files were created or changed. What do you think? |
|
Hey @daniel-lxs I personally feel like my workflow is more fluent if it doesn't open the file after each edit. If you still want to show all files that were created or changed, roo would have to collect the information of all files successfully edited at a higher level than currently. This has to happen because the I could do that as well. We could also add settings to control that behavior but I would like to hold that off for future endavours. |
|
This is how it would look like if we show all touched documents after the task is finished. Screen.Recording.2025-07-16.at.20.03.42.1.mov |
|
any uodate on preference @daniel-lxs ? |
|
Hey @felixAnhalt Sorry for the delay. One important point: VSCode only applies diagnostics to open files. This means Roo Code can’t access issues introduced in a file unless that file has been opened at least once. If a file remains closed, its diagnostics simply aren't available. |
…a diff was opened and before it gets closed
|
I dug a little bit deeper. Anyways, regarding my initial question.
|
…2-autofocus # Conflicts: # src/integrations/editor/DiffViewProvider.ts
|
Hey @felixAnhalt I managed to pull this off with Roomote's help #6214 It uses the |
|
Finally vscode did something to support that! So by look at what mrubens said I assume that your preffered option is A (don't show anything afterwards) @daniel-lxs ? What mrubens proposes is essentially #6010 after this current issue #2122 is solved with option A, correct? |
|
Yeah @felixAnhalt The main concern was the diagnostics, but that is solved. Are there any feature you want to add to what we have now from this PR? or should this be closed? |
|
@daniel-lxs This is everything I wanted to achieve with #2955 and this pull request here. I think your (or roomote's solution) solves all of these things and they might be closed if you don't see any gain for the product from these things. It might make sense to have a look at #6010 if the added settings is ready to go into production and out of "experimental". |
|
Gotcha, Closing this one for now |
This pull request aims to be a very simple implementation to fix the issue #2122.
Closes #2122 .
Diff Views now get opened in the
ViewColumnViewColumn.Besideand the edited file is not shown anymore after a successfull edit. Furthermore, only the diff view is being opened instead of the actual file and the diff view as well.A more sophisticated approach respecting customizations in regards to editor can be found here.
This is how an iteration with multiple file edits looks like.
Screen.Recording.2025-07-14.at.10.41.07.1.mov
Copilot Summary:
This pull request refines the
DiffViewProviderfunctionality in the VS Code extension by improving focus handling, normalizing content editing behavior, and updating test cases. The changes ensure better user experience during file editing and enhance code reliability.Focus Handling Improvements:
TextDocumentShowOptionswithViewColumn.Besideto preserve focus while executing the diff command.Content Normalization Enhancements:
trimEndto normalize edited and new content, ensuring consistent end-of-line handling without trailing whitespace.Test Case Updates:
schemeandfileNameproperties for accurate simulation of theDiffViewProviderbehavior. [1] [2] [3]Dependency Updates:
TextDocumentShowOptionsandViewColumnfromvscodeto support the new focus handling logic.Important
Improves focus handling and content normalization in
DiffViewProvider, updating tests accordingly.DiffViewProviderto avoid focus interference.TextDocumentShowOptionswithViewColumn.Besidefor diff command.trimEndto edited and new content inDiffViewProvider.DiffViewProvider.spec.tsto verify focus preservation and command execution order.schemeandfileNameproperties.This description was created by
for 1f6d6d8. You can customize this summary. It will automatically update as commits are pushed.