thegrumpys / odop

Open Design Optimization Platform (ODOP) - Coil spring design app; mechanical springs; compression spring, extension spring, torsion spring
https://www.springdesignsoftware.org
MIT License
4 stars 5 forks source link

Unexpected closing of Alert "Value" modal #716

Open grumpyinca opened 2 years ago

grumpyinca commented 2 years ago

The Alert table contains a "Value" column that will bring up a "Dependent Variable Value Input" modal. Given certain situations and inputs (example follows), this modal can close unexpectedly.

One theory is that the user input is making a change that causes the alert to no longer be active. No alert, no modal.

Also, there is an idea is that the ownership of the model is not properly established. Is it possible that a React "ref" would resolve the issue ?

Steps to reproduce the issue:

  1. Using the current Master branch, Reload the app.
  2. If present, close the migration dialog.
  3. Change the value of Force_2 to 90.
  4. Expand the Alerts.
  5. Click the "Value" column of the second entry (_RELATIONSHIP: L_2 (-0.7268) < LSolid (1.055))
  6. Click the "Fix" checkbox in the modal
  7. Observe that the modal immediately clears. This is the bug. The original second Alert entry has disappeared. Two new Err severity Alert messages appear. They are associated with L_2 MIN & L_2 MAX.
grumpyinca commented 1 year ago

I confirmed that this issue continues to appear in v4.3.3.

grumpyinca commented 11 months ago

I confirmed that this issue continues to appear in the staging system v4.5.dev8.

grumpyinca commented 11 months ago

Observed: Other changes on the modal can cause it to disappear. Observed: Repeat in Calculator view. Modal does not drop.

1fifoto commented 11 months ago

In Calculator view we have a Layout of SymbolValues and an Alerts component. The SymbolValues contains both a numeric display and the pop-up modal to modify the value. In addition the Alerts component have also SymbolValues with their implicit modal. In other words there are two copies of the SymbolValues with their implicit modal on the Calculator view.

In Advanced view we have a DesignTable component and an Alerts component. The DesignTable component consist of a list of all symbol table entries which allow the element's value to be changed. The Alerts component consist of N Alerts each with a SymbolValue. The SymbolValue component consist of a numeric display of the elements value and a pop-up modal to modify that value. In other words there is only one copy of any SymbolValues in the Advanced view.

Modifying any of the Calculator view's values via its SymbolValues does not cause the sudden-disappearance problem. This is because the modal is associated with the Layout of SymbolValues and not the Alerts ones which are unchanging. However, using either Calculator or Advanced view's Alerts SymbolValues Modal causes the sudden-disappearance problem, because the list of Alerts is being changed out from underneath those views which in turn cause the model to suddenly disappear.

It is the implicit binding of the SymbolValue display along with the Modal that is the problem. The two should be separated into two different components. Each display component should somehow reference its now separate modal one. A set or array of modals (one per element in the symbol table) should be managed independently of the SymbolValue ones. This allows the Alerts to change their values without destroying their implicitly associated Modals. Also the calculator view's SymbolValues should also reference the table of modals.