equinor / webviz

Mozilla Public License 2.0
5 stars 6 forks source link

Added custom names and colors to `Ensemble` class and ensemble selector component #620

Closed rubenthoms closed 2 months ago

rubenthoms commented 2 months ago

Also...

Closes #552.

rubenthoms commented 2 months ago

Really nice work, looks very good! 👍

Just one minor comment.

And a general thought, which does not need to be resolved at the moment, but can be revisited in the future:

With color and display name as a part of the Ensemble class, the changes are propagated together with the rest of the Ensemble-info. Thereby editing of these settings in the Ensemble dialog will result in the Ensembles being loaded and processed before new color and custom name is propagated to modules, without any changes in the rest of the Ensemble data. As this is configurable/editable settings, should we find a way to propagate these selections without triggering full loading/fetching of ensembles?

Of course, as already mentioned in our conversation yesterday, this is not optimal yet as all ensembles are loaded again when anything in the ensemble selector is changed and a new ensemble set is created. This just made it easier to achieve an update of all modules using the current ensemble set. Moreover, I assume that there aren't very frequent changes to the ensemble names/colors and the ensemble data should be stored in the Tanstack query cache for 60s (and later also in the browser's cache), making this whole operation rather fast in most of the cases. However, I totally agree that we should aim to implement another method for updating modules on ensemble set color/name changes and avoid re-fetching all ensemble data in the future.