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
@@ -80,6 +80,31 @@ public sealed class ListFolderTests : IDisposable
}
}
[Fact]
public async Task List_color_round_trips_and_defaults_to_null()
{
await using (var ctx = Open())
{
var repo = new ListRepository(ctx);
await repo.AddAsync(new ListEntity { Id = "l1", Name = "Plain", CreatedAt = DateTime.UtcNow });
await repo.AddAsync(new ListEntity { Id = "l2", Name = "Tinted", CreatedAt = DateTime.UtcNow, Color = "Swatch3" });
}
await using (var ctx = Open())
{
var repo = new ListRepository(ctx);
Assert.Null((await ctx.Lists.AsNoTracking().FirstAsync(l => l.Id == "l1")).Color);
Assert.Equal("Swatch3", (await ctx.Lists.AsNoTracking().FirstAsync(l => l.Id == "l2")).Color);
var tinted = (await repo.GetByIdAsync("l2"))!;
tinted.Color = "#A1B2C3";
await repo.UpdateAsync(tinted);
}
await using (var ctx = Open())
Assert.Equal("#A1B2C3", (await ctx.Lists.AsNoTracking().FirstAsync(l => l.Id == "l2")).Color);
}
[Fact]
public async Task SetListFolderAsync_moves_a_list_in_and_back_out()
{