33697d89

By: Michael Lynch <git@mtlynch.io>

Validate grocery sections with typed values

Add a Section type that trims leading and trailing whitespace and rejects empty section names. Include a MustCreateNewSection helper for known-valid test values and SQLite read paths where invalid persisted data should fail immediately.

Move section-bearing handler and store APIs to use typed section values, converting to raw strings only at user-input, rendering, and SQLite boundaries. Keep item-section JSON and template view models as handler-owned string representations so browser responses remain stable while application logic uses typed values.

Add a SQLite migration that trims legacy section names across grocery items, item-section mappings, stored list items, and section ordering. The migration rebuilds section_ordering through a temporary table keyed by the trimmed name so entries that collide after trimming collapse to the earliest sort order.

Testing:
- ./dev-scripts/run-go-tests
- ./dev-scripts/git-hooks/pre-commit
- nix flake check

Suite timing

Time to Start Worker time Duration Time to finish
Config 2s 9s 9s 12s
Eval 9s 35s 35s 45s
Build 16s 6m02s 14m14s 14m30s
Suite 2s 6m48s 14m27s 14m30s

Timeline

0s10s20s30s40s50s1m1m10s1m20s1m30s