continue icon indicating copy to clipboard operation
continue copied to clipboard

Con-991-a: Diff Manager Improvements

Open justinmilner1 opened this issue 1 year ago • 0 comments

Description

Note: Work was started in this MR. I started this new branch as the last one got messy.

This MR makes two improvements to vertical diff managers:

1) Open diffs are adjusted to user edits to the file

  • A listener becomes active when a diff is opened, and will update the open diffs to user edits in the file

2) Sequentially opened diffs will be handled properly

  • If a new diff is to be created while another one is open, the old diff will be properly closed, and the new diff properly initialized (fixes this bug)
  • If the previous diff was created by ctrl-I, and no new selection has been made, the new diff will re-use the old diff selection
  • If the previous diff was created by ctrl-I, and a new selection has been highlighted, the new diff will use the new selection

Test Evidence:

Accept all/Reject all

https://github.com/continuedev/continue/assets/42585006/00023aca-950a-4b3d-bbea-2d00ff89976f

Mixing individual accept/rejects and grouped accept/reject alls:

https://github.com/continuedev/continue/assets/42585006/be8c7db0-b55b-4430-8115-fd3d9cc60cfa

With red:

https://github.com/continuedev/continue/assets/42585006/f6864467-ded8-419b-b6f1-ec2a48aaaabe

With user edits before and between blocks

https://github.com/continuedev/continue/assets/42585006/289d051c-9c7b-499c-a541-287bf6c6bd79

Attempt to open multiple diffs and only one is allowed at a time (and diff is created at correct (new) position) Block above:

https://github.com/continuedev/continue/assets/42585006/2be69671-48ea-43d5-a820-813aa570a56a

Block below:

https://github.com/continuedev/continue/assets/42585006/45be1ac3-211d-457c-8d15-f31da5a39854

Ctrl I (No new selection)

https://github.com/continuedev/continue/assets/42585006/c5b175fa-4138-47a2-b8a5-89bd30e97e35

Ctrl I (New selection)

https://github.com/continuedev/continue/assets/42585006/cac2a67a-c402-407f-9711-39c291b54fcd

justinmilner1 avatar Apr 28 '24 02:04 justinmilner1