Bug-fix patch: dim labels and Diff Added/Removed rows now read correctly in dark themes.
What was broken
Two contrast bugs surfaced by the v0.9.1 gallery visual verification push:
-
Dim-label ink was invisible in dark themes. Widgets that render a subordinate/muted text tone (HeaderBar Subtitle, ActionRow Subtitle, Stat Title + Stat Flat-change, Timeline event Detail) pulled the ink from `theme.Border`. In the default light palette `Border = #C0C0C0` is a mid-grey visible on `Surface = #FFFFFF` so the dim label read correctly. In the default dark palette `Border = #3A3E46` sits deliberately close to `Surface = #1F2228` so the 1-px stroke around cards stays subtle — but that closeness makes the same Border tone almost invisible when used for TEXT on Surface.
-
Diff Added / Removed rows had light text on light backgrounds in dark themes. The row fills are fixed light-green / light-red (semantic colours — the "added lines are green" convention is stronger than any per-theme adaptation). The row text used `theme.OnSurface` which is dark in light themes (readable) but near-white in dark themes — near-invisible on the light-green / light-red row fill.
The fix
- New `dimInk(theme)` helper in `raster.go`: a 60/40 blend of `OnSurface` and `Surface`. Enough contrast against Surface to stay readable in any theme, less weight than `OnSurface` itself so it still forms a visual hierarchy.
- Replace `theme.Border` with `dimInk(theme)` at the four dim-label sites: `actionrow.go`, `headerbar.go`, `stat.go` (Title AND the Flat branch of `statChangeInk`), `timeline.go`.
- New fixed Diff inks: `diffAddedInk = {20,60,20}` (dark green) and `diffRemovedInk = {90,20,20}` (dark red). `Diff.Draw` picks the per-row ink based on `line.Kind`: Context still uses `theme.OnSurface`, Added / Removed lock in the fixed dark inks that pair correctly with the fixed light row backgrounds regardless of theme.
Compatibility
No API change — no new fields on Theme, no new exported functions, no signature changes. Consumers pinning v0.9.1 keep working; visual output improves on rebuild.
The fix is compositional: any future widget that wants a dim-label tone should call `dimInk(theme)` instead of reaching for `theme.Border`.
Verified
- `go vet ./...` clean
- `go test -cover ./...` → 100.0% of statements
- Cross-compile js/wasm + linux/arm64 + darwin/arm64 clean
- CI green
To pin:
```go
require github.com/go-widgets/toolkit v0.9.2
```
BSD-3-Clause.