Remove redundant habit copy and document goal layouts

This commit is contained in:
syntaxbullet
2026-09-05 08:07:55 +02:00
parent b832b5734e
commit 1f017caee5
5 changed files with 27 additions and 31 deletions

View File

@@ -40,7 +40,6 @@ export function isHabitColor(value: string) {
export function HabitColorPicker({
value,
onChange,
mode = "demo",
compact = false,
}: {
value: string;
@@ -55,8 +54,8 @@ export function HabitColorPicker({
return (
<fieldset className="ds-color-picker" aria-describedby={`${id}-hint`}>
<legend>Habit color</legend>
<p id={`${id}-hint`} className="ds-footnote">
{showDetails ? "Choose a suggested shade or enter a custom color for this habit’s calendar." : "Choose a color for your habit."}
<p id={`${id}-hint`} className={showDetails ? "ds-footnote" : "ds-visually-hidden"}>
Custom colors use six-digit hex values, such as #426582.
</p>
{compact && (
<>
@@ -156,13 +155,6 @@ export function HabitColorPicker({
<span className="ds-muted">0 → complete</span>
</div>
)}
<p className="ds-footnote">
{mode === "create"
? "Saved with your habit."
: mode === "edit"
? "Save to apply this color; Cancel restores the saved color."
: "Charts preview changes immediately. Save keeps the demo color; Cancel reverts it."}
</p>
{!valid && (
<p id={`${id}-error`} role="alert" className="ds-form-feedback">
Use a six-digit hex color, such as #426582.

View File

@@ -135,7 +135,7 @@ test("invalid custom colors associate both guidance and corrective feedback", as
await act(async () => root.render(<HabitColorPicker value="#bad" onChange={() => {}} />));
const input = container.querySelector('input[type="text"]')!;
expect(input.getAttribute("aria-invalid")).toBe("true");
expect(description(input)).toContain("Choose a suggested shade");
expect(description(input)).toContain("Custom colors use six-digit hex values");
expect(description(input)).toContain("Use a six-digit hex color");
});