replace setup checklist with interactive stepper

3-step vertical stepper with inline forms for Printify and Stripe,
real-time sync progress via PubSub, and celebration state on go-live.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-02-12 22:55:29 +00:00
parent fdb09128b4
commit 2fb88df853
3 changed files with 701 additions and 65 deletions

View File

@@ -66,6 +66,7 @@ defmodule SimpleshopTheme.Sync.ProductSyncWorker do
defp sync_products(conn) do
Logger.info("Starting product sync for #{conn.provider_type} (#{conn.id})")
Products.update_sync_status(conn, "syncing")
broadcast_sync(conn.id, {:sync_status, "syncing"})
try do
do_sync_products(conn)
@@ -73,6 +74,7 @@ defmodule SimpleshopTheme.Sync.ProductSyncWorker do
e ->
Logger.error("Product sync crashed for #{conn.provider_type}: #{Exception.message(e)}")
Products.update_sync_status(conn, "failed")
broadcast_sync(conn.id, {:sync_status, "failed"})
{:error, :sync_crashed}
end
end
@@ -95,11 +97,14 @@ defmodule SimpleshopTheme.Sync.ProductSyncWorker do
)
Products.update_sync_status(conn, "completed", DateTime.utc_now())
product_count = Products.count_products_for_connection(conn.id)
broadcast_sync(conn.id, {:sync_status, "completed", product_count})
:ok
else
{:error, reason} = error ->
Logger.error("Product sync failed for #{conn.provider_type}: #{inspect(reason)}")
Products.update_sync_status(conn, "failed")
broadcast_sync(conn.id, {:sync_status, "failed"})
error
end
end
@@ -146,6 +151,10 @@ defmodule SimpleshopTheme.Sync.ProductSyncWorker do
Products.upsert_product(conn, attrs)
end
defp broadcast_sync(conn_id, message) do
Phoenix.PubSub.broadcast(SimpleshopTheme.PubSub, "sync:#{conn_id}", message)
end
defp sync_product_associations(product, product_data) do
# Sync images
images =