Commit Graph

63 Commits

Author SHA1 Message Date
7c02323bf4 test: add CSSCache unit tests and benchmarks
Tests cover:
- get/0, put/1, invalidate/0, warm/0 functions
- Performance benchmark comparing cache hit vs CSS generation
- 100 cache hit consistency test

Run with: mix test test/simpleshop_theme/theme/css_cache_test.exs --include benchmark

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 21:14:27 +00:00
fae851159a docs: move CSS cache warming to completed (already implemented)
The CSSCache.init/1 already calls warm() on startup.
Remove from Quick Wins, add to Completed section.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 21:12:13 +00:00
73e749c573 docs: replace ROADMAP with detailed MVP implementation plan
New "Core MVP" section with 5 phases:
- Phase A: Products Context + Printify Sync
- Phase B: Session-Based Cart
- Phase C: Stripe Checkout integration
- Phase D: Orders + Printify Fulfillment
- Phase E: Cost Verification at Checkout

Includes concrete schemas, code examples, and file lists.
Adds Multi-Provider Support to future features.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 21:06:31 +00:00
7fcfff62a8 Add ROADMAP_UPDATED.md file after chat with Claude 2026-01-18 22:46:34 +00:00
f4ecc11eae docs: correct license to AGPL-3.0
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 23:10:02 +00:00
8e9a10e9b7 docs: rename to SimpleShop in docs, plan full rename for later
- Update README title to "SimpleShop"
- Update ROADMAP title to "SimpleShop Roadmap"
- Add "Rename Project to SimpleShop" to Technical Debt section
  with list of files that would need updating

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 23:09:42 +00:00
ac6a8d248d docs: reframe README with shop as primary feature
The shop is the product; the theme editor is a feature.
Reorder features section to lead with "The Shop" before
"Theme Editor".

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 23:08:33 +00:00
f3451429da docs: add Enhanced Contact Page to roadmap
- Newsletter signup card for prominent subscription CTA
- Social media links card with icons and text labels
- Makes social links more discoverable than small footer icons

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 23:06:04 +00:00
2e61115959 docs: fix ROADMAP references and move sample content to completed
- Remove reference to deleted sample-content.md
- Move Sample Content to Completed section (it's implemented)
- Note Printify integration in completed features

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 22:56:21 +00:00
a3f81af990 docs: add mockup generator to README, delete sample-content.md
- Add "Generating Mockups" section documenting mix generate_mockups
- Remove stale reference to deleted docs/spec.md
- Delete docs/plans/sample-content.md (plan fully implemented)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 22:55:01 +00:00
5050b0bde5 docs: merge UX patterns into design-philosophy, delete ux-patterns.md
- Add Accessibility Baseline section with WCAG 2.1 AA requirements
- Add Quality Checklist for shipping verification
- Delete standalone ux-patterns.md (all useful content merged)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 22:52:06 +00:00
b5fbfd5882 docs: merge typography research into design-philosophy
- Add Typography System section with type scale rationale
- Add line-height guidelines and font pairing categories
- Add spacing system (8px grid) explanation
- Add e-commerce typography patterns (Baymard research)
- Delete standalone typography.md (redundant)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 22:49:10 +00:00
796c39d366 docs: extract design philosophy, remove outdated spec
- Create docs/research/design-philosophy.md with:
  - Core design principles
  - Target audience
  - POD research findings
  - Preset rationale
  - Customisation philosophy
- Delete docs/spec.md (outdated, didn't match implementation)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 22:42:57 +00:00
6b6c7cc148 docs: reorganize documentation and add ROADMAP
- Rewrite README.md with proper project overview, setup, and structure
- Create ROADMAP.md capturing future improvements and known gaps
- Move reference docs to docs/ directory:
  - docs/spec.md (theme system specification)
  - docs/plans/sample-content.md (POD content refresh plan)
  - docs/plans/page-builder.md (existing)
  - docs/research/typography.md
  - docs/research/ux-patterns.md
- Delete obsolete planning files:
  - PLAN.md (work complete)
  - PHASE_9_PLAN.md (work complete)
  - PHASE_9_PROGRESS.md (stale tracker)
  - RECENT_CHANGES.md (stale)
- Keep AGENTS.md (Phoenix codegen guidelines)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 22:39:37 +00:00
a2d655d302 feat: add Cart page and themed error pages
- Add ShopLive.Cart at /cart using shared PageTemplates
- Update ErrorHTML to render fully themed 404/500 pages
- Add dev-only error preview routes at /dev/errors/404 and /dev/errors/500
- Update error page tests for themed output

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 22:29:45 +00:00
94f98b8be0 docs: add page builder feature plan
Document the architecture and implementation phases for transforming
static page templates into a database-driven, customizable page builder
with visual editing capabilities.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 22:19:09 +00:00
c25953780a refactor: consolidate shop and preview page templates
- Create shared PageTemplates module in components/page_templates/
- Shop LiveViews now use explicit render/1 calling shared templates
- Theme preview now uses preview_page/1 component calling shared templates
- Delete duplicate preview_pages directory and shop_live/*.html.heex
- Single source of truth: mode param controls shop vs preview behavior

Templates: home, about, contact, collection, pdp, cart, error

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 22:17:59 +00:00
e02d928815 feat: add Product Detail page to public storefront
Add PDP (Product Detail Page) at /products/:id with full e-commerce
functionality including product gallery, variant selector, quantity
controls, reviews section, and related products.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 21:57:43 +00:00
4f70c6649a feat: add Products listing page to public storefront
- Create ShopLive.Products module and template
- Add /products route to public shop live session
- Shows product grid with category filters and sort dropdown
- Displays all 16 preview products with categories

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 21:54:31 +00:00
5ceff20aaa feat: add Contact page to public storefront
- Create ShopLive.Contact module and template
- Add /contact route to public shop live session
- Includes contact form, order tracking, info cards, social links

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 21:52:11 +00:00
1f8dbd645d feat: add About page to public storefront
- Create ShopLive.About module and template
- Add /about route to public shop live session
- Reuse shop_components for header, footer, hero, rich text

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 21:49:16 +00:00
75206474a1 refactor: consolidate CSS to use .themed class with native nesting
- Add .themed class as shared selector for both shop and preview
- Move visual/behavioral styles from .preview-frame to .themed
- Keep .preview-frame only for CSS variable switching (editor live preview)
- Update CSSGenerator to target .themed instead of .shop-root
- Refactor CSS files to use native CSS nesting syntax
- Update tests to reflect new class structure

This improves maintainability by:
- Eliminating duplicate selectors (.shop-root + .preview-frame)
- Using modern CSS nesting (94%+ browser support)
- Clear separation: .preview-frame = vars, .themed = styles

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 21:43:26 +00:00
7491c34723 test: add CSS consistency tests for shop and preview
Add tests to verify that:
- Both .shop-root and .preview-frame have theme data attributes
- Theme settings changes are reflected on shop pages
- CSS file has correct selectors for both contexts
- Generated CSS cache includes all theme variables

These tests catch regressions like the selector issue where
.preview-frame[data-mood="warm"] was incorrectly transformed to
.preview-frame, .shop-root[data-mood="warm"] instead of
.preview-frame[data-mood="warm"], .shop-root[data-mood="warm"]

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 16:28:22 +00:00
0157f20ae9 fix: update shop layout and CSS selectors for shop-root
- Fix asset paths in shop layout (css/app.css, js/app.js)
- Add Google Fonts preconnect and stylesheet link
- Update theme-layer2-attributes.css to target both .preview-frame
  and .shop-root so theme styles apply to real shop pages
- Properly duplicate attribute selectors (e.g., [data-mood="warm"])
  for both .preview-frame and .shop-root

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 16:25:52 +00:00
88636db9d2 feat: add shop storefront with optimized theme CSS
- Create LoadTheme plug for loading theme settings
- Add shop layout with inline CSS injection (~400 bytes vs 17KB full)
- Create ShopLive.Home at / using shared ShopComponents
- Wire up CSS cache invalidation when theme settings change
- Replace Phoenix welcome page with themed shop home page

The shop layout injects only the active theme CSS variables inline,
achieving a 97% reduction compared to the full variants file used
by the theme editor.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 16:19:35 +00:00
97981a9884 refactor: extract remaining PDP components to ShopComponents
Add PDP-specific components:
- product_gallery with lightbox
- product_info (title, price, sale badge)
- variant_selector
- quantity_selector
- add_to_cart_button
- product_details accordion
- star_rating
- trust_badges
- reviews_section with review_card

Add page layout components:
- page_title for consistent h1 styling
- cart_layout for cart page structure
- rich_text for structured content blocks
- accordion_item for generic collapsible sections

Update preview pages to be fully component-based:
- PDP: 415 → 48 lines (88% reduction)
- Cart: 47 → 23 lines
- About: 65 → 27 lines

Add preview data functions:
- reviews() for product reviews
- about_content() for rich text blocks

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 15:37:58 +00:00
0c15929c19 refactor: extract remaining page sections to ShopComponents
Add reusable components for all page sections:
- category_nav: Category circles for homepage navigation
- featured_products_section: Product grid with title and view-all CTA
- image_text_section: Two-column image + text layout
- collection_header: Page header with title and product count
- filter_bar: Category pills and sort dropdown
- content_body: Long-form content wrapper for about page
- contact_form: Contact form card
- order_tracking_card: Order tracking input card
- info_card: Bullet-point info card
- contact_info_card: Email contact card with icon
- social_links: Social media icon links
- cart_item: Cart item row with quantity controls
- order_summary: Order totals and checkout card
- breadcrumb: Navigation breadcrumb trail
- related_products_section: Related products grid

All preview pages now compose entirely of reusable components,
making them easier to maintain and enabling future section-based
theme customization.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 15:14:25 +00:00
1589ebaeca refactor: expand hero_section with page and error variants
Add variant support to hero_section component:
- :default - Standard hero with section wrapper (home, about)
- :page - Page header style with larger title, more spacing (contact)
- :error - Error page with pre-title (404), dual buttons (error)

Now used in: home, about, contact, error pages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 14:57:31 +00:00
f5b7693b96 refactor: extract hero_section to shared ShopComponents module
Create a centered hero section component with:
- Title (h1) and description (p)
- Optional CTA button with preview/live mode support
- Configurable background (:base or :sunken)

Used in: home page (with CTA), about page (without CTA)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 14:54:11 +00:00
b2869514cb refactor: extract product_grid to shared ShopComponents module
Create a reusable product grid component that handles responsive
column layouts. Supports two modes:

- Theme-based columns: Uses theme_settings.grid_columns for lg breakpoint
- Fixed columns: Use columns={:fixed_4} for 2/4 column layouts

Used in: home (featured), collection, pdp (related), error (suggestions)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 14:45:34 +00:00
9746bf183c refactor: extract product_card to shared ShopComponents module
Create a reusable product card component with four variants:
- :default (collection page) - full details with category
- :featured (home page) - hover animation, badges
- :compact (pdp related) - smaller, no badges/delivery
- :minimal (error 404) - smallest, not clickable

Accessibility improvements:
- Use <a> for all clickable cards (keyboard nav, screen readers)
- Use <div> only for non-clickable decorative cards

Unified badge logic with priority: Sold out > New > Sale

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 14:38:16 +00:00
50941d278f refactor: extract cart_drawer to shared ShopComponents module
Move the cart drawer component from ThemeLive.PreviewPages to the
shared ShopComponents module. The component now supports:
- mode attribute (:live for real stores, :preview for theme editor)
- subtotal attribute (default nil shows "£0.00")
- cart_items attribute (default empty list)

In preview mode, "View basket" navigates via LiveView JS commands.
In live mode, it links directly to /cart.

Preview pages now explicitly pass demo values:
  <.cart_drawer cart_items={...} subtotal="£72.00" mode={:preview} />

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 14:11:23 +00:00
5473337894 refactor: extract shop_header to shared ShopComponents module
Move the shop header component from ThemeLive.PreviewPages to the
shared ShopComponents module. The component now supports:
- mode attribute (:live for real stores, :preview for theme editor)
- cart_count attribute (default 0, preview pages pass 2)
- Navigation links render conditionally based on mode

Preview pages now call <.shop_header ... mode={:preview} cart_count={2} />

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 14:09:43 +00:00
c72f6446a4 refactor: extract shop_footer to shared ShopComponents module
Move the footer from ThemeLive.PreviewPages to the shared ShopComponents
module. Add mode attribute (:live vs :preview) for navigation behavior.
Preview mode uses phx-click handlers, live mode uses real URLs.
Also makes copyright year dynamic.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 14:06:28 +00:00
14b1af5314 refactor: extract search_modal to shared ShopComponents module
Move the search modal from ThemeLive.PreviewPages to the shared
ShopComponents module. Add optional hint_text attribute - preview
pages pass demo hint text while real stores can omit it.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 14:05:00 +00:00
0e998fdac9 refactor: extract skip_link to shared ShopComponents module
Move the accessibility skip link from ThemeLive.PreviewPages to the
shared ShopComponents module for reuse on public storefront pages.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 13:51:15 +00:00
5f3efebdfc refactor: extract announcement_bar to shared ShopComponents module
Move announcement_bar from ThemeLive.PreviewPages to a new shared
SimpleshopThemeWeb.ShopComponents module. This establishes the pattern
for Phase 9 storefront integration where components need to work in
both the admin theme preview and public storefront pages.

Changes:
- Create lib/simpleshop_theme_web/components/shop_components.ex
- Add optional message attribute (defaults to "Free delivery over £40")
- Import ShopComponents in html_helpers for global availability
- Import ShopComponents in PreviewPages for embedded template access
- Update all 7 preview templates to use short-form <.announcement_bar>
- Remove original announcement_bar/1 from PreviewPages (now unused)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 13:15:46 +00:00
d4dbd8998f fix: resolve compilation warnings and update tests to match implementation
- Remove unused generate_mood/1, generate_typography/1, generate_shape/1,
  generate_density/1 functions from CSSGenerator (now handled via CSS
  data attributes)
- Prefix unused _opts parameters in Printify.Client
- Remove unused created_products variable from MockupGenerator
- Update CSSGeneratorTest to test actual generated CSS (accent colors,
  font size scale, layout width, etc.)
- Update PresetsTest to match 8 presets (not 9)
- Fix PreviewDataTest to accept local image paths
- Update ThemeLiveTest to use correct selectors and match actual UI
2026-01-15 22:36:15 +00:00
974d91ce33 feat: implement professional typography system with curated font pairings
Typography Presets (research-backed pairings):
- clean: Manrope + Inter (minimal, modern)
- editorial: Playfair Display + Raleway (fashion, lifestyle)
- modern: Space Grotesk + Inter (tech, futuristic)
- classic: Cormorant Garamond + Source Serif 4 (luxury, elegant)
- friendly: Fraunces + Work Sans (playful, quirky)
- minimal: DM Sans + Source Serif 4 (design-forward)
- impulse: Raleway + Inter (wellness, beauty)

Type Scale & Line Heights:
- Major Third (1.25) ratio for mathematical harmony
- H1: line-height 1.1, letter-spacing -0.025em
- H2: line-height 1.15, letter-spacing -0.02em
- H3: line-height 1.2, letter-spacing -0.015em
- Body: line-height 1.5 (WCAG compliant)
- Small text: letter-spacing +0.01em for readability

Fluid Typography:
- Headings use clamp() for smooth mobile→desktop scaling
- Display: 36px→48px, XL: 30px→40px, LG: 24px→32px

Performance:
- Variable font loading where available (Inter, Manrope, etc.)
- Removed unused fonts (Libre Baskerville, Nunito, Source Sans)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 01:16:21 +00:00
aa469ffb50 feat: implement UX pattern improvements for accessibility & performance
Accessibility:
- Add skip link component for keyboard navigation
- Add visible focus rings on all interactive elements
- Add aria-current="page" to navigation active states
- Ensure 44px minimum touch targets on header icons and filter pills

Product Page (PDP):
- Add accordion layout for Description, Size Guide, Shipping & Returns
- Convert Reviews section to accordion format (open by default)
- Make Add to Basket button sticky on mobile, normal on desktop

Product Cards (home & collection):
- Add "Free delivery over £40" shipping badge
- Add loading="lazy" and decoding="async" to images

Cart Drawer:
- Add "Delivery: Calculated at checkout" label
- Add Remove button to each cart item

All Preview Pages:
- Add skip link to all 7 preview pages
- Wrap main content in <main id="main-content">
- Pass active_page to shop_header for nav highlighting

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 00:24:25 +00:00
0c43d65a04 feat: add automated Printify mockup generation & POD sample content
Printify Integration:
- Add Printify API client module with full HTTP wrapper
- Add mockup generator with dynamic "cover" scaling algorithm
- Create Mix task (mix generate_mockups) for automated mockup generation
- Support --cleanup flag to delete products after downloading mockups
- Calculate optimal scale factor based on artwork/placeholder aspect ratios
- Handle landscape artwork on portrait print areas without white space

Sample Content (16 products across 5 POD categories):
- Art Prints: Mountain Sunrise, Ocean Waves, Wildflower Meadow, Geometric Abstract, Botanical Illustration
- Apparel: Forest Silhouette T-Shirt, Forest Light Hoodie
- Tote Bags: Wildflower Meadow, Sunset Gradient
- Homewares: Fern Leaf Mug, Ocean Waves Cushion, Night Sky Blanket
- Stationery: Autumn Leaves Notebook, Monstera Leaf Notebook
- Accessories: Monstera Leaf Phone Case, Blue Waves Laptop Sleeve

Preview Data Updates:
- Replace generic e-commerce products with POD-focused items
- Update categories to POD-relevant: Art Prints, Apparel, Homewares, Stationery, Accessories
- Update cart drawer items to match new product range
- Refresh testimonials with POD-appropriate reviews

Theme Content Updates:
- Update hero section for "Wildprint Studio" brand identity
- Rewrite about page narrative with humble, British, personal tone
- Update search hints to nature/POD relevant terms
- Add mockups directory to static paths

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 23:35:18 +00:00
1bb8888d7c Add sample content plan 2026-01-03 00:23:01 +00:00
37653e5e7a feat: redesign contact page for POD sellers & add theme enhancements
Contact page redesign:
- Replace retail-style contact info (phone, address, hours) with POD-appropriate layout
- Add order tracking card with email input
- Add "Handy to know" section with printing/delivery/returns info
- Add email contact with response time promise
- Add social links (Instagram, Pinterest)
- Update intro text to be warmer and more personal

Collection page improvements:
- Replace sidebar filters with horizontal category pills
- Add filter pill CSS with theme token integration

PDP enhancements:
- Add image lightbox with keyboard navigation
- Add thumbnail gallery with active state
- Add reviews section (toggleable)
- Add related products section (toggleable)
- Add trust badges section (toggleable)

Theme system additions:
- Add button_style setting (filled/outline/soft)
- Add product_text_align setting (left/center)
- Add image_aspect_ratio setting (square/portrait/landscape)
- Add responsive form layouts with flex-wrap

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 13:48:03 +00:00
98a9e3b3d4 fix: adjust content and demo to be UK-centric 2026-01-01 16:52:43 +00:00
48b1e0bc96 Bring in plan for phase 9 2026-01-01 16:37:55 +00:00
6d66d56b62 Rename md files 2026-01-01 16:20:31 +00:00
0575847263 chore: remove obsolete theme-demo-v28.html
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-01 16:17:12 +00:00
c5a251398a chore: add demo.html to static assets
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-01 16:17:05 +00:00
a8c0e150c8 feat: enhance theme customization with layout controls and real product images
Add comprehensive layout and styling controls including header layout options (standard, centered, left), content width settings (contained, wide, full), and card shadow levels. Update all theme presets with these new settings. Replace placeholder images with real Unsplash product and category images for more realistic previews. Add announcement bar and sticky header toggle options for enhanced header customization.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-01 16:16:05 +00:00
1ca703e548 feat: add dark mode support, accordion UI, and current combination display
- Update Theme Studio sidebar to use DaisyUI theme-aware classes for dark mode
- Convert Customise accordion to native details/summary elements for proper interaction
- Add "Current combination" card showing active theme settings
- Add SVG recolorer for logo color customization
- Add image controller for serving uploaded images
- Implement header background image controls (zoom, position)
- Add toggle_customise event handler to preserve accordion state across re-renders

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 18:55:44 +00:00