journaly
journaly copied to clipboard
π Update Post / Update Highlight Algorithm Doesn't Expand The Highlight Fully
Description
Our algorithm for updating a highlight (or marking it as outdated) should expand the highlight to the full scope of the changed text that is still part of the comment, but when testing one use case just now it didn't fully capture this behavior.
See below, the original highlighted text was "δΈζ―ηζ³" and the comment suggested "ιηΆδΈζ―εΎηζ³" - just adding 2 chars at the front and one in the middle. The highlight was preserved but remained in the original position and didn't expand to cover the full new text.
![Screenshot 2023-03-28 at 6 38 11 AM](https://user-images.githubusercontent.com/34203886/228257583-b7ea3466-274c-40f8-994e-906ea8741dad.png)
Repro Steps
- Highlight and comment on some text in a post
- Leave a comment and suggest something similar, with something at the start and also in the middle of the highlighted text
- Click "Save" and observe the new highlight position/length