feat: add dynamic variant selector with color swatches
- Fix Printify options parsing (Color/Size were swapped) - Add extract_option_types/1 for frontend display with hex colors - Filter option types to only published variants (not full catalog) - Track selected variant in LiveView with price updates - Color swatches for color-type options, text buttons for size - Disable unavailable combinations - Add startup recovery for stale sync status Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -35,11 +35,21 @@ defmodule SimpleshopTheme.Images.VariantCache do
|
||||
Logger.info("[VariantCache] Checking image variant cache...")
|
||||
File.mkdir_p!(Optimizer.cache_dir())
|
||||
|
||||
reset_stale_sync_status()
|
||||
ensure_database_image_variants()
|
||||
ensure_mockup_variants()
|
||||
ensure_product_image_downloads()
|
||||
end
|
||||
|
||||
# Reset any provider connections stuck in "syncing" status from interrupted syncs
|
||||
defp reset_stale_sync_status do
|
||||
{count, _} = Products.reset_stale_sync_status()
|
||||
|
||||
if count > 0 do
|
||||
Logger.info("[VariantCache] Reset #{count} stale sync status(es) to idle")
|
||||
end
|
||||
end
|
||||
|
||||
defp ensure_database_image_variants do
|
||||
incomplete =
|
||||
ImageSchema
|
||||
|
||||
Reference in New Issue
Block a user