From 4dc485fe8c299ae410be9a148b6726ad4985567d Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sun, 7 Dec 2025 11:22:07 +0000 Subject: [PATCH 1/3] fix dim --- src/textual/filter.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/textual/filter.py b/src/textual/filter.py index 0d08292fde..8f8e1086dd 100644 --- a/src/textual/filter.py +++ b/src/textual/filter.py @@ -248,10 +248,6 @@ def truecolor_style(self, style: Style, background: RichColor) -> Style: color.get_truecolor(terminal_theme, foreground=True) ) changed = True - if style.dim: - color = dim_color(background, color) - style += NO_DIM - changed = True if (bgcolor := style.bgcolor) is not None and bgcolor.triplet is None: bgcolor = RichColor.from_triplet( @@ -259,6 +255,11 @@ def truecolor_style(self, style: Style, background: RichColor) -> Style: ) changed = True + if style.dim and color is not None: + color = dim_color(background if bgcolor is None else bgcolor, color) + style += NO_DIM + changed = True + return style + Style.from_color(color, bgcolor) if changed else style def apply(self, segments: list[Segment], background: Color) -> list[Segment]: From f474a403742417515e69c8d2866bd0aac683bdd9 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sun, 7 Dec 2025 11:22:55 +0000 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 004a4e8ed4..a567f61e21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Fixed alt modifier on systems without extended Key Protocol https://github.com/Textualize/textual/pull/6267 - Fixed an issue where alpha keys with modifiers weren't lower cased. If you have bound to something like `ctrl+A`, then change to `ctrl+shift+a` https://github.com/Textualize/textual/pull/6267 - Fixed exception when setting `loading` attribute before mount https://github.com/Textualize/textual/pull/6268 +- Fixed issue with dim filter and ansi colors ## [6.7.1] - 2025-12-1 From 521880631d01f883c7808bfa210bb9cfa4a0dfcc Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sun, 7 Dec 2025 11:25:39 +0000 Subject: [PATCH 3/3] snapshits --- CHANGELOG.md | 2 +- .../__snapshots__/test_snapshots/test_select_expanded.svg | 2 +- .../test_snapshots/test_select_from_values_expanded.svg | 2 +- .../__snapshots__/test_snapshots/test_select_rebuild.svg | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a567f61e21..c0ff572198 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Fixed alt modifier on systems without extended Key Protocol https://github.com/Textualize/textual/pull/6267 - Fixed an issue where alpha keys with modifiers weren't lower cased. If you have bound to something like `ctrl+A`, then change to `ctrl+shift+a` https://github.com/Textualize/textual/pull/6267 - Fixed exception when setting `loading` attribute before mount https://github.com/Textualize/textual/pull/6268 -- Fixed issue with dim filter and ansi colors +- Fixed issue with dim filter not using background (may cause snapshot failures) https://github.com/Textualize/textual/pull/6269 ## [6.7.1] - 2025-12-1 diff --git a/tests/snapshot_tests/__snapshots__/test_snapshots/test_select_expanded.svg b/tests/snapshot_tests/__snapshots__/test_snapshots/test_select_expanded.svg index 2e020ed9b4..2d17b66959 100644 --- a/tests/snapshot_tests/__snapshots__/test_snapshots/test_select_expanded.svg +++ b/tests/snapshot_tests/__snapshots__/test_snapshots/test_select_expanded.svg @@ -39,7 +39,7 @@ .terminal-r5 { fill: #7f7f7f } .terminal-r6 { fill: #0178d4 } .terminal-r7 { fill: #ddedf9;font-weight: bold } -.terminal-r8 { fill: #9fa9b1;font-weight: bold } +.terminal-r8 { fill: #92c5ec;font-weight: bold } diff --git a/tests/snapshot_tests/__snapshots__/test_snapshots/test_select_from_values_expanded.svg b/tests/snapshot_tests/__snapshots__/test_snapshots/test_select_from_values_expanded.svg index 2e020ed9b4..2d17b66959 100644 --- a/tests/snapshot_tests/__snapshots__/test_snapshots/test_select_from_values_expanded.svg +++ b/tests/snapshot_tests/__snapshots__/test_snapshots/test_select_from_values_expanded.svg @@ -39,7 +39,7 @@ .terminal-r5 { fill: #7f7f7f } .terminal-r6 { fill: #0178d4 } .terminal-r7 { fill: #ddedf9;font-weight: bold } -.terminal-r8 { fill: #9fa9b1;font-weight: bold } +.terminal-r8 { fill: #92c5ec;font-weight: bold } diff --git a/tests/snapshot_tests/__snapshots__/test_snapshots/test_select_rebuild.svg b/tests/snapshot_tests/__snapshots__/test_snapshots/test_select_rebuild.svg index e83c532b41..24e932d05d 100644 --- a/tests/snapshot_tests/__snapshots__/test_snapshots/test_select_rebuild.svg +++ b/tests/snapshot_tests/__snapshots__/test_snapshots/test_select_rebuild.svg @@ -38,7 +38,7 @@ .terminal-r4 { fill: #7f7f7f } .terminal-r5 { fill: #0178d4 } .terminal-r6 { fill: #ddedf9;font-weight: bold } -.terminal-r7 { fill: #9fa9b1;font-weight: bold } +.terminal-r7 { fill: #92c5ec;font-weight: bold } .terminal-r8 { fill: #e0e0e0 }