Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor SelectedComponentView and CatalogView input boxes and derived code #161

Open
tomcl opened this issue Apr 27, 2022 · 1 comment
Open
Labels
Time: high This is expected to take more than 5 hours.

Comments

@tomcl
Copy link
Owner

tomcl commented Apr 27, 2022

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

@tomcl tomcl added the Time: high This is expected to take more than 5 hours. label Apr 27, 2022
@tomcl
Copy link
Owner Author

tomcl commented Apr 27, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Time: high This is expected to take more than 5 hours.
Projects
None yet
Development

No branches or pull requests

1 participant