feat(lists): selectable list/folder colors with accent-aware swatches and custom picker

This commit is contained in:
mika kuns
2026-10-01 10:29:53 +02:00
parent d316f3c6a5
commit a6926f53b5
26 changed files with 1529 additions and 45 deletions
@@ -0,0 +1,31 @@
using System.Text.RegularExpressions;
using Avalonia.Media;
using Xunit;
namespace ClaudeDo.Ui.Tests;
public class AccentPresetsTests
{
[Fact]
public void EveryPreset_DefinesEverySwatch_AsAValidHex()
{
foreach (var preset in AccentPresets.All)
{
Assert.Equal(AccentPresets.SwatchCount, preset.Swatches.Length);
foreach (var hex in preset.Swatches)
Assert.True(Color.TryParse(hex, out _), $"{preset.Name}: '{hex}'");
}
}
[Fact]
public void Tokens_DeclareEverySwatchBrush()
{
var dir = AppContext.BaseDirectory;
while (dir is not null && !File.Exists(Path.Combine(dir, "src", "ClaudeDo.Ui", "Design", "Tokens.axaml")))
dir = Path.GetDirectoryName(dir);
var tokens = File.ReadAllText(Path.Combine(dir!, "src", "ClaudeDo.Ui", "Design", "Tokens.axaml"));
foreach (var key in AccentPresets.SwatchKeys)
Assert.Matches(new Regex($"x:Key=\"{key}Brush\""), tokens);
}
}