[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
Description
Problem: When you 1) accept/reject a subset of changes and then 2) accept remaining changes, the file tree is updated to only display the subset of remaining files from 2 that were just accepted. (The files from 1 disappear.) This change is caused due to filtering on an insertCode call's inputs which was introduced with file-level accept. The filtering was attempting to avoid overwriting already-inserted changes (e.g. if the user edited an file after accepting it, and then accepted remaining changes), but actually is not necessary because insertCode filters internally.
The problem is confused by a misuse of insertCode to insert a single file (where it is passed one file), as well as all remaining files (where it must be passed all files -- not just remaining files).
Solution: There is already a kludge to re-render the file tree after inserting a single file. This change removes the incorrect filter when inserting remaining changes. As a follow up, we need to clean up the use of insertCode and separate this responsibility.
Checklist
[x] My code follows the code style of this project
[ ] I have added tests to cover my changes
[ ] A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
[ ] I have added metrics for my changes (if required)
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.
Types of changes
Description
Problem: When you 1) accept/reject a subset of changes and then 2) accept remaining changes, the file tree is updated to only display the subset of remaining files from 2 that were just accepted. (The files from 1 disappear.) This change is caused due to filtering on an
insertCode
call's inputs which was introduced with file-level accept. The filtering was attempting to avoid overwriting already-inserted changes (e.g. if the user edited an file after accepting it, and then accepted remaining changes), but actually is not necessary becauseinsertCode
filters internally.The problem is confused by a misuse of
insertCode
to insert a single file (where it is passed one file), as well as all remaining files (where it must be passed all files -- not just remaining files).Solution: There is already a kludge to re-render the file tree after inserting a single file. This change removes the incorrect filter when inserting remaining changes. As a follow up, we need to clean up the use of
insertCode
and separate this responsibility.Checklist
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.