From 187849a6a91bfc9aaac5253a0cc180c81827b08c Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Wed, 22 Jul 2026 17:36:20 +0100 Subject: [PATCH] Fix palette fallback wrongly treating shadow palettes as missing The is[missing] operator returns true for shadow tiddlers, so the fallback introduced for missing palettes made every plugin palette compile as Vanilla --- core/wiki/macros/CSS.tid | 2 +- .../data/palettes/ShadowPaletteCompile.tid | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 editions/test/tiddlers/tests/data/palettes/ShadowPaletteCompile.tid diff --git a/core/wiki/macros/CSS.tid b/core/wiki/macros/CSS.tid index 3a029c877..a031e5112 100644 --- a/core/wiki/macros/CSS.tid +++ b/core/wiki/macros/CSS.tid @@ -81,7 +81,7 @@ tags: $:/tags/Macro \procedure actions-recompile-current-palette() \procedure tv-action-refresh-policy() always -<$transclude $variable="actions-compile-palette" inputPalette={{{ [{$:/palette}!is[missing]] :else[[$:/palettes/Vanilla]] }}} outputPalette="$:/temp/palette-colours"/> +<$transclude $variable="actions-compile-palette" inputPalette={{{ [{$:/palette}is[tiddler]] [{$:/palette}is[shadow]] :else[[$:/palettes/Vanilla]] }}} outputPalette="$:/temp/palette-colours"/> \end actions-recompile-current-palette \procedure tv-palette-name() $:/temp/palette-colours diff --git a/editions/test/tiddlers/tests/data/palettes/ShadowPaletteCompile.tid b/editions/test/tiddlers/tests/data/palettes/ShadowPaletteCompile.tid new file mode 100644 index 000000000..7c3568011 --- /dev/null +++ b/editions/test/tiddlers/tests/data/palettes/ShadowPaletteCompile.tid @@ -0,0 +1,22 @@ +title: Operators/Palettes/ShadowPaletteCompile +description: A shadow palette from a plugin compiles as itself, not the Vanilla fallback +type: text/vnd.tiddlywiki-multiple +tags: [[$:/tags/wiki-test-spec]] + +title: Output + +\import [subfilter{$:/core/config/GlobalImportFilter}] +(<>) ++ +title: Actions + +\import [subfilter{$:/core/config/GlobalImportFilter}] +<> ++ +title: $:/palette + +$:/palettes/TwentyTwenties ++ +title: ExpectedResult + +

(#FFFCF0)

\ No newline at end of file