RFC: How do you use color swatches on product bundles?

This would be very easy, requiring no custom code, if custom swatch options were correctly mapped with the `swatch` object.

Lets say I make a “Material” category metafields for my shoe products, and create shopify--color-pattern swatches for “Suede” and “Leather”. Everything maps correctly in the product admin and looks perfect:

It seems like this would be the “correct” way to make custom swatch options. Unfortunately, the “Material” option will not have a swatch object attached to it:

My best option is to do a manual lookup on metafields.shopify['color-pattern'].values['suede'] – which has two problems:

  1. I need to do a string match against the option_group name, “Material”, in order to trigger this manual lookup workflow. That means I need settings and translations for every possible option_group.name containing swatches.
  2. I am limited to 20 colors per product, because global metaobject lookups are slow and appropriately paginated.

I have been getting support tickets about this for a while and I can’t tell if I should apply the manual lookup hack-fix or wait for the proper solution.

Intuitively, I expect an option that shows as a swatch in the Shopify admin to have the swatch object attached in Liquid. The bug affects every theme, including Horizon.

Here’s the main bug-report thread for the issue: