issie
issie copied to clipboard
Refactor SelectedComponentView and CatalogView input boxes and derived code
This relates to #160 #157 #147. It is fairly straightforward and will have big benefits: #147 (as discussed in #157) will become easier #160 will automatically be done
(1) work out a general purpose numeric input box with constraints and ability to autocomplete on a given list of named alphabetic parameters
(2) Construct helpers which can be used to implement component parameter inputs
(3) rethink PopupDialogData
to support these.
(4) Check that input forms can be constructed functionally without binding in box data (as now) which causes very frustrating and annoying "why does my data not change when I alter model" bugs.
(5) Use optics to bind input boxes to the underlying changed model filed?
The idea is to extract the maximum amount of duplicate code, and make constraints on values (and error messages from them) more systematic.
One advantage would be to make this code (currently a bit obscure) less so by using functional abstraction in a better way
numeric input box:
- name of box
- Lens defines what model field is being updated
- Optional default value for the field
- Constraint function generates error message for non-compliant inputs
- Output is react + update messages
- One special requirement is for the exact input string to be stored as well (e.g. 0x11 not just int 17). Only applies to constants.