adsys
adsys copied to clipboard
Refactor watchdtui using the new bubbles `Validate` API
Describe the problem you'd like to have solved
The new bubbles release comes with a Validate API which we can use to validate our TUI inputs (directories and config file). Currently, validation is done via arbitrary functions that directly operate on the textinput.Model objects, e.g. https://github.com/ubuntu/adsys/blob/e298b39f930f3a62b6172a63462350fcbd5f0ef6/internal/watchdtui/watchdtui.go#L397-L435
Describe the ideal solution
Input validation is done via the newly added API.
I have a branch up for this refactor -- based on top of https://github.com/charmbracelet/bubbles/pull/185
Fixed with https://github.com/ubuntu/adsys/commit/1f819dcab406c936a3a22737798acab4d1dde73a