Page MenuHomePhabricator

Apply edit smoothing to prose diffs
ClosedPublic

Authored by epriestley on Jun 7 2016, 3:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 23, 3:43 PM
Unknown Object (File)
Thu, Mar 21, 11:50 AM
Unknown Object (File)
Wed, Mar 13, 3:58 AM
Unknown Object (File)
Tue, Mar 5, 1:16 AM
Unknown Object (File)
Feb 18 2024, 1:55 PM
Unknown Object (File)
Feb 11 2024, 9:10 PM
Unknown Object (File)
Feb 3 2024, 10:38 AM
Unknown Object (File)
Jan 23 2024, 6:01 AM
Subscribers
None

Details

Summary

Ref T7643. Currently, when you edit one word into another word which shares some letters, we produce a very choppy diff. The edit from "says" into "remarks" on T7643 is one example.

These are technically correct (they minimize edit distance), but not how a human would diff them. A human can more easily parse an entire word change than the technically-more-accurate character-by-character diff.

Apply "smoothing" on these word-level and character-level diffs to avoid producing runs of changes when some characters are shared in a word edit.

We already do this in arc for normal intraline diffs (and have for years) and it seems to work well. I'll update that code to use this same method.

Test Plan

Add unit tests, ran unit tests.

Got a better diff in the UI for this class of edit:

Screen Shot 2016-06-07 at 8.14.52 AM.png (326×642 px, 58 KB)

Diff Detail

Repository
rPHU libphutil
Branch
prose7
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 12532
Build 15895: Run Core Tests
Build 15894: arc lint + arc unit

Event Timeline

epriestley retitled this revision from to Apply edit smoothing to prose diffs.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
chad edited edge metadata.
This revision is now accepted and ready to land.Jun 7 2016, 3:53 PM
This revision was automatically updated to reflect the committed changes.