Bug 41283 - Use a better diff viewer library
Summary: Use a better diff viewer library
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-21 20:16 UTC by Phil Ringnalda
Modified: 2025-11-21 20:16 UTC (History)
0 users

See Also:
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:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.