joachim-n / mutable-typed-data

Typed data system with mutable properties
GNU General Public License v3.0
1 stars 2 forks source link

variant mapping is NOT a good fallback for options #17

Open joachim-n opened 2 months ago

joachim-n commented 2 months ago
    if (!$type_property->hasOptions()) {
      $options = [];

      if ($this->hasVariantMapping()) {
        $options = $this->getVariantMapping();
      }

This is rubbish -- the variant mapping is OPTION VALUE => VARIANT VALUE.

The variant value is not suitable as a human label!

joachim-n commented 2 months ago

We could work through the variants and take their labels, but the whole point of the variant mapping is that multiple options point to one variant, so UIs would get repeated labels!

This just really needs to be removed.