Remove ~140 Tailwind utility classes from product.ex and cart.ex, replacing
with semantic CSS classes in components.css. Delete helper functions that
generated Tailwind class strings (card_classes, image_container_classes,
content_padding_class, title_classes, hero_cta_classes, grid_classes).
Use data-* attributes for variant styling, grid columns, and sticky
positioning. Update theme-layer2 selectors for renamed classes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Absorb ~100 Tailwind utility classes from layout.ex and all page
templates into semantic CSS rules in components.css. Uses theme font-size
vars (--t-text-small, --t-text-caption) instead of rem to respect the
theme's em-based scaling system.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move ~104 inline style= attributes from layout.ex (55) and cart.ex (49)
into named CSS classes in components.css. Remove conflicting unlayered
nav link rule from theme-semantic.css that was previously masked by
inline styles. Only dynamic values (background-image URLs, logo height)
remain as inline styles.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move ~80 inline style= attributes from product.ex into ~40 CSS classes
in @layer components. Only genuinely dynamic values (hex colours,
background-image URLs) remain as inline styles. Pre-declare CSS layer
order in shop_root.html.heex so reset < components in the cascade.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- esbuild profile for shop.css bundling (dev watcher + build aliases)
- shop.css loaded as second stylesheet in shop_root layout
- LiveView display:contents rule in reset layer
- updated Lighthouse + Screenshots tasks for new esbuild target
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9-phase plan to replace Tailwind v4 and DaisyUI with hand-written
CSS using @layer, native nesting, container queries, oklch, and
@property. Visual regression testing at each phase. ~22h across
14 sessions.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Gallery was hardcoding 1200px width, breaking for images with smaller
source dimensions where only 400/800 variants exist.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Flex-wrap base (no JS needed, active pill always visible). JS hook
switches to horizontal scroll with scroll-into-view when pills exceed
2.5 rows on mobile. Desktop always wraps.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move all image URL logic into ProductImage.url/2 and thumbnail_url/1,
remove dead on-demand generation code from Optimizer, strip controller
routes down to SVG recolor only, fix mockup startup check to verify all
variant formats, and isolate test image cache directory.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Read-mostly admin views for synced products: filterable/sortable list
with inline visibility toggle, and detail page with images grid,
variants table, storefront controls form, and provider edit links.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- category_nav pulls first product image per category from DB
- ProductImageScroll JS hook resets to index 0 on updated()
- collection filter bar gets CSS fade gradient scroll hint on mobile
- sync_product_images and delete_product_images now clean up orphaned
Media.Image records to prevent DB bloat from repeated syncs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Printify's API returns all blueprint option values (e.g. 21 colours)
even when only a few are enabled as variants. This caused the PDP to
show phantom colour swatches with no images or purchasable variants.
Now filter_options_by_variants strips option values to only those with
enabled variants, ordered by first appearance so the hero/default
colour leads the swatch list.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Printful sync variants don't include color_code — hex values are only
available from the catalog product endpoint. Fetch catalog colors per
unique product type during sync (cached in process dictionary to avoid
duplicate calls) and store as "colors" array in option values, matching
the Printify format that Product.option_types expects.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tag product images with their colour during sync (both Printful and
Printify providers). Printify images are cherry-picked: hero colour
keeps all angles, other colours keep front + back only. Printful
MockupEnricher now generates mockups per colour from the
color_variant_map.
PDP gallery filters by the selected colour, falling back to all
images when the selected colour has none. Fix option name mismatch
(Printify "Colors" vs variant "Color") by singularizing in
Product.option_types.
Generator creates multi-colour apparel products so mock data matches
real sync behaviour.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the enricher adds extra angle images, sort them so front views
come first (position 0) and shift existing images down. This ensures
the product gallery leads with a proper front shot rather than a
handle-side or angled preview.
Also adds Products.update_product_image/2.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New PrintfulGenerator module creates demo products in Printful with
multi-variant support (multiple colours/sizes per product type).
Mix task gets --provider flag to choose between Printify and Printful.
After syncing Printful products, MockupEnricher Oban worker calls the
legacy mockup generator API to produce extra angle images (back, left,
right) and appends them as product images. Jobs are staggered 45s apart
with snooze-based 429 handling. Flat products (canvas, poster) get no
extras — apparel and 3D products get 1-5 extra angles each.
Also fixes:
- cross-provider slug uniqueness (appends -2, -3 suffix)
- category mapping order (Accessories before Canvas Prints)
- image dedup by URL instead of colour (fixes canvas variants)
- artwork URL stored in provider_data for enricher access
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Provider form accepts ?type= query param (printify/printful)
- Conditional setup instructions per provider (API key steps, login URLs)
- Dynamic labels, titles, and config handling (shop_id vs store_id)
- Provider index shows dropdown with both provider options
- Settings page renamed from @printify to @provider (generic)
- Fix Printful shipping rates: add default state codes for US/CA/AU
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New POST /webhooks/printful route with VerifyPrintfulWebhook plug
(shared secret token via header or query param). Handles package_shipped,
order_failed, order_canceled, product_updated, product_synced, and
product_deleted events. Webhook registration via Printful v2 API with
token appended to URL. 19 new tests (819 total).
Also marks task #28 as done — Printful sync products already include
preview mockup images handled by the existing ImageDownloadWorker
pipeline.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add blueprint_id and print_provider_id to Printful provider_data so the
generic shipping calculator can look up rates. Fix v2 API request format
(order_items key) and response field names. Fetch one representative
variant per product to get accurate per-item rates.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Printful HTTP client (v2 + v1 for sync products), Provider behaviour
implementation with all callbacks (test_connection, fetch_products,
submit_order, get_order_status, fetch_shipping_rates), and multi-provider
order routing that looks up the provider connection from the order's
product instead of hardcoding "printify".
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Prefer Print Clever (72) for canvas, Monster Digital (29) for
apparel and mugs where available, fall back to default providers
- Rename Art Print products to Canvas (new Satin Canvas blueprint)
- Add Canvas Prints category in Printify tag extraction
- Add --replace/-r flag to purge existing Printify products before
generating (with interactive confirmation)
- Add purge_all_products/1 to generator module
- Remove old art print mockups, add new canvas + extra provider mockups
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Shipping rates fetched from Printify during product sync, converted to
GBP at sync time using frankfurter.app ECB exchange rates with 5%
buffer. Cached in shipping_rates table per blueprint/provider/country.
Cart page shows shipping estimate with country selector (detected from
Accept-Language header, persisted in cookie). Stripe Checkout includes
shipping_options for UK domestic and international delivery. Order
shipping_cost extracted from Stripe on payment.
ScheduledSyncWorker runs every 6 hours via Oban cron to keep rates
and exchange rates fresh. REST_OF_THE_WORLD fallback covers unlisted
countries. 780 tests, 0 failures.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Route all search modal open/close through the JS hook via custom DOM
events so the _closing flag is always correctly managed. Prevents the
modal flashing back after Escape when a search response is in flight.
Add If-None-Match / 304 Not Modified handling to the image controller
so browsers don't re-download images on revalidation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Track search_open as server state so morphdom doesn't reset display
to none on re-render. Move admin bar from layout banner to a gear
icon in the header actions. Extract layout_assigns/1 helper so page
templates use a spread instead of listing every attr explicitly.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
FTS5 prefix matching misses mid-word substrings (e.g. "ebook" in
"notebook"). When FTS5 returns zero results, fall back to LIKE
query on title and category with proper wildcard escaping. 4 new
tests, 757 total.
Also marks completed plan files (search, admin-redesign,
setup-wizard, products-context) with correct status.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace PreviewData indirection in all shop LiveViews with direct
Products context queries. Home, collection, product detail and error
pages now query the database. Categories loaded once in ThemeHook.
Cart hydration no longer falls back to mock data. PreviewData kept
only for the theme editor.
Search modal gains keyboard navigation (arrow keys, Enter, Escape),
Cmd+K/Ctrl+K shortcut, full ARIA combobox pattern, LiveView navigate
links, and 150ms debounce. SearchModal JS hook manages selection
state and highlight. search.ex gets transaction safety on reindex
and a public remove_product/1. 10 new integration tests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds SQLite FTS5 search index with BM25 ranking across product title,
category, variant attributes, and description. Search modal now has
live results with thumbnails, prices, and click-to-navigate. Index
rebuilds automatically after each provider sync.
Also fixes Access syntax on Product/ProductImage structs (Map.get
instead of bracket notation) which was causing crashes when real
products were loaded from the database.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds cheapest_price, compare_at_price, in_stock, on_sale columns to
products table (recomputed from variants after each sync). Shop
components now work with Product structs directly instead of plain
maps from PreviewData. Renames .name to .title, adds Product display
helpers (primary_image, hover_image, option_types) and ProductImage
helpers (display_url, direct_url, source_width). Adds Products context
query functions for storefront use (list_visible_products,
get_visible_product, list_categories with DB-level sort/filter).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace hardcoded zinc/white Tailwind colors with DaisyUI semantic
colors (base-content, base-200, etc.) that adapt to light/dark themes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
Single-tenant app: every user is the admin. The previous pattern
match on conn.assigns.current_scope didn't work for first-time
logins because the scope isn't assigned to the conn yet at that
point, causing the fallback to ~p"/" instead of ~p"/admin".
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Check socket.assigns.current_scope (validated by mount_current_scope)
instead of raw session token. Prevents stale/invalid session cookies
from bypassing the site-live gate.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fresh installs now redirect to /users/register instead of showing the
demo shop. Post-login redirect goes to /admin dashboard (with setup
checklist) instead of /admin/settings. Added 16 provider tests covering
index (list, delete, sync) and form (new, edit, test connection).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Dashboard at /admin shows setup progress (when not live), stat cards
(orders, revenue, products), and recent paid orders table. Replaces
the old AdminController redirect. Add Dashboard to sidebar nav as
first item, update admin bar and theme editor links to /admin.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merge shop status, payments, products (Printify), account (email/password),
and advanced (dashboard/error tracker links) into /admin/settings. Simplify
Auth.Settings to a redirector for /users/settings and confirm-email tokens.
Remove Providers from sidebar nav. Update all redirects and tests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- New admin root + child layouts with daisyUI drawer sidebar
- AdminLayoutHook tracks current path for active nav highlighting
- Split router into :admin, :admin_theme, :user_settings live_sessions
- Theme editor stays full-screen with back link to admin
- Admin bar on shop pages for logged-in users (mount_current_scope)
- Strip Layouts.app wrapper from admin LiveViews
- Remove nav from root.html.heex (now only serves auth pages)
- 9 new layout tests covering sidebar, active state, theme editor, admin bar
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Consolidates admin_live/, theme_live/, provider_live/ into admin/
(with theme/ and providers/ subdirs). Renames shop_live/ to shop/
and user_live/ to auth/. Updates all module names, router refs,
test files, CSS source paths, and dialyzer ignore.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Settings.site_live?/0 and set_site_live/1 for shop visibility control
- Accounts.has_admin?/0 to detect single-tenant admin existence
- Registration lockdown: /users/register redirects when admin exists
- Setup.setup_status/0 aggregates provider, product, and stripe checks
- Coming soon page at /coming-soon with themed styling
- ThemeHook :require_site_live gate on all public shop routes
- Site live → everyone through
- Authenticated → admin preview through
- No admin → fresh install demo through
- Otherwise → redirect to coming soon
- Go live / take offline toggle on /admin/settings
- 648 tests, 0 failures
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Detailed plan for setup wizard, go-live gate, and registration
lockdown. Covers single-admin account creation, coming soon page,
admin setup checklist, and platform compatibility notes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All internal links used plain <a href>, causing full page reloads
between pages in the same live_session. Changed to <.link navigate>
for client-side navigation across layout, product, cart, base, and
content components.
Added explicit width/height attributes to all SVG icons so they
render at sensible sizes before CSS loads on initial page visit.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- collection filter bar: horizontal scroll on mobile instead of wrapping
across 3 rows, smaller pills at mobile sizes
- add sale collection filter at /collections/sale (filters on_sale products)
- hero :page variant: add consistent top padding (var(--space-2xl))
- contact page: remove redundant top padding (hero handles it now)
- error page: fix CSS path from /assets/app.css to /assets/css/app.css
(broken in production due to asset fingerprinting)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The stretched-link ::after pseudo-element (z-index: 0) was covering
the image area, intercepting touch events. Give the image container
z-index: 1 so swipe gestures reach the scroll container.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
shop_footer now calls PreviewData.categories() itself, removing the
need to thread categories through CartHook, shop_layout, and all 8
page templates.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- add missing cta_href to hero section and error page CTAs
- replace hardcoded footer shop links with real product categories
- restructure product cards with stretched-link pattern so category
badges link to their collection page
- unify social icons: footer and contact page share the same default
links from a single source in content.ex
- add search implementation plan (docs/plans/search.md, deferred)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The drawer now has full quantity controls, remove, subtotal, and
checkout — the link to the cart page added friction without value.
Cart page remains accessible via the basket icon in nav.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>