fix(widget): drop the blanket FromHttpApiData orphan that hijacked query-param parsing

Pkg/Components/Widget declared

    instance {-# OVERLAPPABLE #-} AE.FromJSON a => FromHttpApiData a

which meant every module transitively importing Widget parsed query params for
any JSON-decodable type through AE.eitherDecodeStrict — so a param only ever
parsed if it was a *quoted* JSON string. Nothing actually needed the blanket
form; what the FromForm derivations need is container and per-type instances.

Replaced with narrow ones in Utils, beside the existing JSONHttpApiData:
[a], V.Vector a and AE.Value. The four record types now derive FromHttpApiData
via JSONHttpApiData, and WidgetType/SummarizeBy derive it via WrappedEnumSC, so
they parse the bare snake_case spelling a form submits (widget_type=top_list)
rather than requiring quotes.

Also dropped two redundant imports in Pages/Charts/Charts.hs that Relude already
re-exports. The watcher now reports All good with zero warnings.
This commit is contained in:
Anthony Alaribe 2026-09-01 23:40:11 +02:00
commit 7625d7de1b
3 changed files with 35 additions and 13 deletions