Bug 41283

Summary: Use a better diff viewer library
Product: Koha Reporter: Phil Ringnalda <phil>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40030
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Phil Ringnalda 2025-11-21 20:16:46 UTC
We use koha-tmpl/intranet-tmpl/lib/jsdiff/jsdiff.js from https://johnresig.com/projects/javascript-diff-algorithm/ for viewing diffs in the log viewer, patron merge, automatic updating of outdated reports, and MARC record diffs in batch imports.

Unfortunately, it's a very elegant implementation of a not very robust diff algorithm. The simplest failure to see is that if you move a line from one spot in the thing being diffed to another spot, it won't detect any difference. So if someone changes

if (wechecked) {
  dothething();
}

to

  dothething();
if (wechecked) {
}

in IntranetUserJS, it will show an empty diff.