Summary
The splash date range form and the in-TUI date range dialog (internal/tui/splash.go) validate each date field individually with validateDate (format only), but do not check that start ≤ end. If a user enters From: 2026-05-18 and To: 2026-01-01, the form submits successfully, api.DateRange returns an error, and the TUI shows a generic error screen with no recovery path (other than quitting and relaunching).
Why it matters
The error message returned by api.DateRange ("start date 2026-05-18 is after end date 2026-01-01") is informative but unreachable in the TUI — it becomes the msg.err from dataMsg, which renders as a static error with "Press q to quit." The user has to restart the app entirely.
Suggested approach
Add a cross-field validation either:
- In
validateDate on the end field by accessing the form's start value (huh supports cross-field validation via closures).
- Or as a post-submit check before firing the
splashDoneMsg / data fetch command — if start > end, redisplay the date form with a pre-populated error message.
For the in-TUI dialog, catching it here is especially valuable since the user would otherwise be dumped to the unrecoverable error screen.
🤖 Generated with Claude Code on behalf of Alister
Summary
The splash date range form and the in-TUI date range dialog (
internal/tui/splash.go) validate each date field individually withvalidateDate(format only), but do not check thatstart ≤ end. If a user entersFrom: 2026-05-18andTo: 2026-01-01, the form submits successfully,api.DateRangereturns an error, and the TUI shows a generic error screen with no recovery path (other than quitting and relaunching).Why it matters
The error message returned by
api.DateRange("start date 2026-05-18 is after end date 2026-01-01") is informative but unreachable in the TUI — it becomes themsg.errfromdataMsg, which renders as a static error with "Press q to quit." The user has to restart the app entirely.Suggested approach
Add a cross-field validation either:
validateDateon theendfield by accessing the form'sstartvalue (huh supports cross-field validation via closures).splashDoneMsg/ data fetch command — ifstart > end, redisplay the date form with a pre-populated error message.For the in-TUI dialog, catching it here is especially valuable since the user would otherwise be dumped to the unrecoverable error screen.
🤖 Generated with Claude Code on behalf of Alister