Minimal corrections mark the whole line as changes in Overleaf's track changes feature
In LaTeX, a single line may contain a whole paragraph. A correction will mark the whole paragraph as replaced in the track changes feature, even though only a word has been updated. This makes those changes hard to assess for a third person i.e., to accept or reject a change.
Unfortunately, this is not something that can be easily fixed. Right now, I am using Googles diff_match_patch (myers algorithm, https://neil.fraser.name/writing/diff/myers.pdf) to detect changes in the textarea. These changes are merged back original Latex content. This line is then replaced in Overleaf, resulting in the behaviour you describe.
A solution would be to merge the changes directly to Overleaf. I do not know the algorithm work and how to do this,
https://stackoverflow.com/questions/25083183/how-can-i-get-and-patch-diffs-in-ace-editor could be usefull
It indeed works at line level. The plugin uses some diff_match_patch library from Google which is an implementation of Myers algorithm. I do not fully understand the algorithm and the library. As a result, I am not able to apply the changes created by the algorithm directly to Overleaf. For the time being, I found a workaround which is as follows:
1. Store the original line from the textarea. 2. Take the textarea line when a change has been made. This could be either a manual change or a change made by Grammarly. 3. Generate a changeset using the library comparing the line from steps one and two. 4. Take the same line from overleaf and let the library apply the changeset to it. 5. Replace the line in overleaf with the line created in step 5. So to apply minimalistic changes to overleaf, steps 4 and 5 should be replaced by directly applying the changeset to overleaf. In order to do so, I would need to have a better understanding of the algorithm, library and overleaf. Luckily I found a code simple that might just work, but it would still take some time.