From 0818505334e8aa9dbfdcc52bb40ec1c40e94ed70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Nejus?= Date: Fri, 11 Jul 2025 20:36:31 +0100 Subject: [PATCH] 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 --- beets/config_default.yaml | 2 +- beets/ui/__init__.py | 4 ++-- docs/changelog.rst | 4 ++++ docs/reference/config.rst | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/beets/config_default.yaml b/beets/config_default.yaml index 4367abb19..0a80f77f2 100644 --- a/beets/config_default.yaml +++ b/beets/config_default.yaml @@ -131,7 +131,7 @@ ui: import_path: ['bold', 'blue'] import_path_items: ['bold', 'blue'] changed: ['yellow'] - text_diff_added: ['bold', 'red'] + text_diff_added: ['bold', 'green'] text_diff_removed: ['bold', 'red'] action_description: ['white'] import: diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index 79e5f1b20..5735b0ba0 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -1103,8 +1103,8 @@ def _field_diff(field, old, old_fmt, new, new_fmt): if isinstance(oldval, str): oldstr, newstr = colordiff(oldval, newstr) else: - oldstr = colorize("text_error", oldstr) - newstr = colorize("text_error", newstr) + oldstr = colorize("text_diff_removed", oldstr) + newstr = colorize("text_diff_added", newstr) return f"{oldstr} -> {newstr}" diff --git a/docs/changelog.rst b/docs/changelog.rst index 794013806..b9ac55b01 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -135,6 +135,10 @@ Other changes: file. :bug:`5979` - :doc:`plugins/lastgenre`: Updated and streamlined the genre whitelist and 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) -------------------- diff --git a/docs/reference/config.rst b/docs/reference/config.rst index 4ed3bc9dd..37ff2f8fa 100644 --- a/docs/reference/config.rst +++ b/docs/reference/config.rst @@ -469,7 +469,7 @@ your configuration file that looks like this: import_path: ['bold', 'blue'] import_path_items: ['bold', 'blue'] changed: ['yellow'] - text_diff_added: ['bold', 'red'] + text_diff_added: ['bold', 'green'] text_diff_removed: ['bold', 'red'] action_description: ['white']