feat(appearance): left stripe by default, with fill and strength as choices

The first version filled the whole row at 24%, and in a real log that meant
every row was painted: nearly every contact has SOME QSL state, so colour was
present everywhere and stopped being information — a striped background with
the data behind it.

The default is now a 3px stripe down the left edge. Same signal, nothing lost
to read it. A filled row is still offered, with a strength slider, for
operators who want the block — and the rule cards in Settings preview whichever
is chosen, so the decision is made by looking rather than by imagining.

Drawn as an inset shadow rather than a border: a border would shift the cells
three pixels on coloured rows only, and the columns would stop lining up.

Style and strength are normalised rather than rejected — a value out of range
is a slider that got away, not a reason to reset the operator's colours.
This commit is contained in:
2026-08-13 01:42:08 +02:00
parent 83e7727aab
commit 4ffdfc2548
7 changed files with 129 additions and 19 deletions
+26
View File
@@ -49,3 +49,29 @@ func TestRowColorsKeepPriorityOrder(t *testing.T) {
t.Errorf("confirmed_lotw lost its colour: %q", got.Rules[0].Color)
}
}
// Style and strength are normalised, not rejected: they only shape a colour, and
// a value that got away is a slider, not a fault worth resetting the operator's
// whole choice for.
func TestRowColorsNormaliseStyleAndIntensity(t *testing.T) {
for _, tc := range []struct {
inStyle string
inPct int
wantStyle string
wantPct int
}{
{"bar", 12, "bar", 12},
{"tint", 30, "tint", 30},
{"both", 45, "both", 45},
{"", 0, "bar", 12}, // never configured
{"wallpaper", 12, "bar", 12}, // not a style we draw
{"tint", 900, "tint", 45}, // clamped, not reset
{"tint", -5, "tint", 12},
} {
got := normRowColors(RowColorSettings{Style: tc.inStyle, Intensity: tc.inPct})
if got.Style != tc.wantStyle || got.Intensity != tc.wantPct {
t.Errorf("(%q,%d) -> (%q,%d), want (%q,%d)",
tc.inStyle, tc.inPct, got.Style, got.Intensity, tc.wantStyle, tc.wantPct)
}
}
}