Fix diff coloring for added and removed text in field diffs

- Update default `text_diff_added` value: red -> green
- Use `text_diff_removed` and `text_diff_added` instead of `text_error`
  in UI
This commit is contained in:
Šarūnas Nejus 2025-07-11 20:36:31 +01:00
parent e7c12988bc
commit 0818505334
No known key found for this signature in database
GPG key ID: DD28F6704DBE3435
4 changed files with 8 additions and 4 deletions

View file

@ -131,7 +131,7 @@ ui:
import_path: ['bold', 'blue'] import_path: ['bold', 'blue']
import_path_items: ['bold', 'blue'] import_path_items: ['bold', 'blue']
changed: ['yellow'] changed: ['yellow']
text_diff_added: ['bold', 'red'] text_diff_added: ['bold', 'green']
text_diff_removed: ['bold', 'red'] text_diff_removed: ['bold', 'red']
action_description: ['white'] action_description: ['white']
import: import:

View file

@ -1103,8 +1103,8 @@ def _field_diff(field, old, old_fmt, new, new_fmt):
if isinstance(oldval, str): if isinstance(oldval, str):
oldstr, newstr = colordiff(oldval, newstr) oldstr, newstr = colordiff(oldval, newstr)
else: else:
oldstr = colorize("text_error", oldstr) oldstr = colorize("text_diff_removed", oldstr)
newstr = colorize("text_error", newstr) newstr = colorize("text_diff_added", newstr)
return f"{oldstr} -> {newstr}" return f"{oldstr} -> {newstr}"

View file

@ -135,6 +135,10 @@ Other changes:
file. :bug:`5979` file. :bug:`5979`
- :doc:`plugins/lastgenre`: Updated and streamlined the genre whitelist and - :doc:`plugins/lastgenre`: Updated and streamlined the genre whitelist and
canonicalization tree :bug:`5977` canonicalization tree :bug:`5977`
- UI: Update default ``text_diff_added`` color from **bold red** to **bold
green.**
- UI: Use ``text_diff_added`` and ``text_diff_removed`` colors in **all** diff
comparisons.
2.3.1 (May 14, 2025) 2.3.1 (May 14, 2025)
-------------------- --------------------

View file

@ -469,7 +469,7 @@ your configuration file that looks like this:
import_path: ['bold', 'blue'] import_path: ['bold', 'blue']
import_path_items: ['bold', 'blue'] import_path_items: ['bold', 'blue']
changed: ['yellow'] changed: ['yellow']
text_diff_added: ['bold', 'red'] text_diff_added: ['bold', 'green']
text_diff_removed: ['bold', 'red'] text_diff_removed: ['bold', 'red']
action_description: ['white'] action_description: ['white']