fix: A1-9 replace native color input with 17-preset colour picker popover + custom hex

This commit is contained in:
2026-05-29 09:28:57 +02:00
parent 1f645f6e5e
commit 5b21dcb17d
8 changed files with 237 additions and 5 deletions

View File

@@ -241,7 +241,8 @@ defmodule BDS.Desktop.ShellLiveTest do
edit_draft: %{"name" => "news", "color" => "#3b82f6", "post_template_slug" => ""},
selected: ["news", "updates"],
merge_target: "news",
templates: [%{slug: "post-template", title: "Post Template"}]
templates: [%{slug: "post-template", title: "Post Template"}],
colour_presets: BDS.Desktop.ShellLive.TagsEditor.colour_presets()
}
}
end

View File

@@ -229,6 +229,13 @@ defmodule BDS.TagsTest do
] = Jason.decode!(File.read!(tags_path))
end
test "colour_presets contains exactly 17 unique valid hex colours" do
presets = BDS.Desktop.ShellLive.TagsEditor.colour_presets()
assert length(presets) == 17
assert length(Enum.uniq(presets)) == 17
assert Enum.all?(presets, &Regex.match?(~r/^#[0-9a-fA-F]{6}$/, &1))
end
defp errors_on(changeset) do
Ecto.Changeset.traverse_errors(changeset, fn {message, opts} ->
Regex.replace(~r"%{(\w+)}", message, fn _, key ->