Commit Graph

429 Commits

Author SHA1 Message Date
jamey
242fed0501 move branding settings from Theme tab to Site tab
Some checks failed
deploy / deploy (push) Failing after 10m13s
- Add branding_editor component to site_editor.ex with:
  - Shop name input
  - Show shop name / Show logo toggles
  - Logo upload (size slider, SVG recolor, color picker)
  - Header background toggle and upload (zoom, position sliders)
- Add site_ prefixed event handlers in page_editor_hook.ex:
  - site_update_branding, site_toggle_branding, site_update_color
  - site_remove_logo and site_remove_header (delegate to theme handlers)
- Remove branding sections from theme_editor.ex:
  - Deleted shop_name_input, branding_section, logo/header upload sections
- Theme tab now shows only: preset grid, accent colours, customise accordion

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-28 23:40:48 +00:00
jamey
7c07805df8 add nav editors to Site tab with live preview
All checks were successful
deploy / deploy (push) Successful in 3m27s
- Add header and footer nav editors to Site tab with drag-to-reorder,
  add/remove items, and destination picker (pages, collections, external)
- Live preview updates as you edit nav items
- Remove legacy /admin/navigation page and controller (was saving to
  Settings table, now uses nav_items table)
- Update error_html.ex and pages/editor.ex to load nav from nav_items table
- Update link_scanner to read from nav_items table, edit path now /?edit=site
- Add Site.default_header_nav/0 and default_footer_nav/0 for previews/errors
- Remove fallback logic from theme_hook.ex (database is now source of truth)
- Seed default nav items and social links during setup

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-28 22:19:48 +00:00
jamey
5a5103bc42 update docs for completed social links editor
Some checks failed
deploy / deploy (push) Failing after 10m12s
- Mark tasks 1-9 and 15-16 as done in editor-reorganisation plan
- Update plan status from Planned to In Progress
- Add implementation notes documenting social links architecture
- Update test count to 1800+ in PROGRESS.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-28 10:13:03 +00:00
jamey
638bb4fb70 add Site context with social links editor and site-wide settings
Some checks failed
deploy / deploy (push) Has been cancelled
- Add Site context for managing site-wide content (social links, nav items,
  announcement bar, footer content)
- Add SocialLink schema with URL normalization and platform auto-detection
  supporting 40+ platforms via host and 25+ via URI scheme
- Add NavItem schema for header/footer navigation (editor UI coming next)
- Add SiteEditor component with collapsible sections for each content type
- Wire social links card block and footer to use database data
- Filter empty URLs from display in shop components
- Add DetailsPreserver hook to preserve collapsible section state
- Add comprehensive tests for Site context and SocialLink functions
- Remove unused helper functions from onboarding to fix compiler warnings
- Move sync_edit_url_param helper to group handle_editor_event clauses

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-28 10:09:33 +00:00
jamey
0b86cd66ce improve backup button responsiveness and disable handling
All checks were successful
deploy / deploy (push) Successful in 3m35s
Use async message passing for create_backup to update UI immediately.
Add phx-throttle and pointer-events:none to fully prevent double-clicks.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-27 10:36:05 +00:00
jamey
4ee097596b fix editor blocks not syncing on content page navigation
Move maybe_sync_editing_blocks to run after module.handle_params since
Content pages (about, delivery, privacy, terms) set @page in handle_params
rather than init. Previously editing_blocks would show stale content from
the previous page.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-27 10:36:02 +00:00
jamey
f47a4b90c7 prevent double-click on create backup button
Some checks failed
deploy / deploy (push) Failing after 6m10s
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-13 13:37:47 +00:00
jamey
2af30acb6a remove old database backup files
Some checks failed
deploy / deploy (push) Has been cancelled
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-13 13:34:42 +00:00
jamey
255912af73 update docs and progress tracking
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-13 13:34:36 +00:00
jamey
f2e9960303 scroll flash messages into view on mount
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-13 13:34:32 +00:00
jamey
a2d6bf8a02 add sqlcipher support to docker build
- Install sqlcipher-dev in builder stage
- Configure exqlite to use system SQLCipher
- Add sqlcipher-libs to runtime image
- Exclude mockups/ from live reload patterns

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-13 13:34:28 +00:00
jamey
a6e5db73c0 prevent checkout with unavailable product variants
- Include is_available flag in hydrated cart items
- Show unavailable message on cart items and product page
- Block add-to-cart for unavailable variants
- Redirect back to cart with error if checkout has unavailable items

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-13 13:34:22 +00:00
jamey
09f55dfe67 add database backup and restore admin page
Some checks failed
deploy / deploy (push) Has been cancelled
- SQLCipher-encrypted backup creation via VACUUM INTO
- Backup history with auto-pruning (keeps last 5)
- Pre-restore automatic backup for safety
- Restore from history or uploaded file
- Stats display with table breakdown
- Download hook for client-side file download
- SECRET_KEY_DB config for encryption at rest

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-13 13:33:29 +00:00
jamey
b0f8eea2bc add competitive gap analysis document
All checks were successful
deploy / deploy (push) Successful in 1m8s
2026-03-10 09:46:02 +00:00
jamey
8c053f7495 reference SEO enhancements plan in progress and roadmap
All checks were successful
deploy / deploy (push) Successful in 59s
2026-03-10 08:54:15 +00:00
jamey
e04a5edbbb add SEO enhancements plan 2026-03-10 08:53:47 +00:00
jamey
9f804459fb add editor reorganisation plan to progress
All checks were successful
deploy / deploy (push) Successful in 56s
2026-03-10 08:21:55 +00:00
jamey
f49d52a1e0 add editor reorganisation plan
All checks were successful
deploy / deploy (push) Successful in 50s
2026-03-10 08:14:00 +00:00
jamey
6f78b210ff update progress: mark onboarding UX v2 and notification overhaul complete
All checks were successful
deploy / deploy (push) Successful in 1m5s
2026-03-10 07:57:40 +00:00
jamey
2282af91db complete onboarding UX v2
Some checks failed
deploy / deploy (push) Has been cancelled
Tasks C, H, I from the plan:

- Forgiving API key validation: add Printify UUID format and Printful
  length validation, validate on blur for fast feedback, helpful error
  messages with specific guidance

- External links UX: verified all external links use <.external_link>
  component with target="_blank", rel="noopener noreferrer", icon, and
  screen reader text

- Input styling WCAG compliance: increase input border contrast from
  ~3.3:1 to ~4.5-5:1 across all theme moods (neutral, warm, cool, dark)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-10 07:56:54 +00:00
jamey
951147a675 update progress: mark unified on-site editing complete
All checks were successful
deploy / deploy (push) Successful in 1m14s
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 22:00:18 +00:00
jamey
94c6137ab1 sync editor state with URL for browser back support
Some checks failed
deploy / deploy (push) Has been cancelled
- add ?edit=page/theme/settings param when opening editor or switching tabs
- remove ?edit param when closing editor
- restore .themed class on shop_root for editor panel background tokens
- collapse editor when navigating back to URL without ?edit param

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 21:59:48 +00:00
jamey
2c3c5050f4 mark unified on-site editing feature complete
All checks were successful
deploy / deploy (push) Successful in 52s
All 7 phases done. Admins can now edit theme and page content directly
on the live shop via /?edit=theme, /?edit=page, or /?edit=settings.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 21:18:29 +00:00
jamey
caded6c9f8 fix theme data attributes not updating live during editing
All checks were successful
deploy / deploy (push) Successful in 1m26s
The shop_root.html.heex had duplicate .themed element with data-mood etc
attributes that were static (rendered once at page load). This prevented
live theme changes from visually updating since CSS matched the outer
stale element.

Fix: Remove data attributes from shop_root.html.heex, keeping only the
live-updated .shop-container.themed element inside the LiveView.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 20:51:59 +00:00
jamey
6f0b7f4f63 redirect /admin/theme to on-site editor at /?edit=theme
All checks were successful
deploy / deploy (push) Successful in 1m41s
- Phase 5 was already implemented (URL mode activation via ?edit param)
- Phase 6: Add RedirectController to redirect /admin/theme → /?edit=theme
- Update admin sidebar and dashboard links to point directly to /?edit=theme
- Delete old Admin.Theme.Index LiveView and template (no longer needed)
- Update tests for new redirect behavior

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 20:30:33 +00:00
jamey
378b3fdb6b add image uploads to on-site theme editor and fix scroll on navigation
All checks were successful
deploy / deploy (push) Successful in 1m27s
Phase 4 of unified editing: image upload handling in hook context.
- Configure uploads in Shop.Page mount for logo, header, icon
- Add upload UI components to theme_editor compact_editor
- Pass uploads through page_renderer to theme editor
- Add cancel_upload handler to PageEditorHook

Also fixes scroll position not resetting on patch navigation:
- Push scroll-top event when path changes in handle_params
- JS listener scrolls window to top instantly

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 19:45:43 +00:00
jamey
89c411e0fc clear page-specific assigns on navigation to prevent stale data
All checks were successful
deploy / deploy (push) Successful in 1m27s
When navigating between page types in the unified shop LiveView,
assigns from the previous page could persist and cause stale data
to appear or template errors. Now explicitly nils them out.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 18:34:45 +00:00
jamey
6aaddeaf44 fix settings editor crash on product pages
All checks were successful
deploy / deploy (push) Successful in 1m33s
The provider_label function was accessing product.provider_type but
that field is on the provider_connection association, not the product
itself. Handle the case where the association may not be preloaded.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 16:25:00 +00:00
jamey
f7891188e0 add settings editor component for unified on-site editing
All checks were successful
deploy / deploy (push) Successful in 4m13s
Phase 3b of unified editing mode. The Settings tab now shows
context-specific forms: custom pages get editable title, slug,
meta, visibility and nav options; system pages get read-only info
with links to admin; product/collection pages show provider info.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 15:38:06 +00:00
jamey
bb5d220079 consolidate shop pages into unified LiveView for editor state persistence
All checks were successful
deploy / deploy (push) Successful in 1m27s
Replace individual shop LiveViews with a single Shop.Page that dispatches
to page modules based on live_action. This enables patch navigation between
pages, preserving socket state (including editor state) across transitions.

Changes:
- Add Shop.Page unified LiveView with handle_params dispatch
- Extract page logic into Shop.Pages.* modules (Home, Product, Collection, etc.)
- Update router to use Shop.Page with live_action for all shop routes
- Change navigate= to patch= in shop component links
- Add maybe_sync_editing_blocks to reload editor state when page changes
- Track editor_page_slug to detect cross-page navigation while editing
- Fix picture element height when hover image disabled
- Extract ThemeEditor components for shared use

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 14:47:50 +00:00
jamey
ae0a149ecd add draft-then-publish workflow plan
All checks were successful
deploy / deploy (push) Successful in 53s
Plan for auto-saving drafts with explicit publish. Visitors always see
published version, admins see their drafts while editing. Removes need
for beforeunload warnings since work is never lost.

Planned to follow unified-editing-mode completion.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 11:07:46 +00:00
jamey
0741095a84 exclude /health from force_ssl redirect
All checks were successful
deploy / deploy (push) Successful in 3m38s
Fly.io internal health checks are made over HTTP, so they get redirected
to HTTPS with a 301 which fails the health check. Exclude /health path
from SSL enforcement.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 10:06:26 +00:00
jamey
b82d486877 fix header nav spacing for standard layout
All checks were successful
deploy / deploy (push) Successful in 48s
Remove global margin-left: auto from .shop-actions since it conflicts
with justify-content: space-between in the standard header layout.
Keep margin-left: auto only for the left layout variant where it's
needed. Also fix .shop-cart → .shop-actions selector in layer2.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 09:53:54 +00:00
jamey
a011169459 fix force_ssl compile-time config mismatch
All checks were successful
deploy / deploy (push) Successful in 3m28s
force_ssl must be set at compile time (in prod.exs), not runtime.
Phoenix validates compile-time config at boot and was crashing
because the value differed between compile and runtime.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 09:48:06 +00:00
jamey
168b6ce76f implement unified on-site editor phases 1-2
All checks were successful
deploy / deploy (push) Successful in 1m10s
Add theme editing to the existing PageEditorHook, enabling on-site
theme customisation alongside page editing. The editor panel now has
three tabs (Page, Theme, Settings) and can be collapsed while
keeping editing state intact.

- Add theme editing state and event handlers to PageEditorHook
- Add 3-tab UI with tab switching logic
- Add transparent overlay for click-outside dismiss
- Add mobile drag-to-resize with height persistence
- Fix animation replay on drag release (has-dragged class)
- Preserve panel height across LiveView re-renders
- Default to Page tab on editable pages, Theme otherwise
- Show unsaved changes indicator on FAB when panel collapsed
- Fix handle_event grouping warning in admin theme

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 09:01:21 +00:00
jamey
74ab6411f7 add unified on-site editing mode plan
All checks were successful
deploy / deploy (push) Successful in 46s
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 23:09:51 +00:00
jamey
476da8121a add header background contrast warning and improve branding UX
All checks were successful
deploy / deploy (push) Successful in 1m12s
- extract dominant colors from header images during optimization
- calculate WCAG contrast ratios against theme text color
- show warning in theme editor when text may be hard to read
- prevent hiding shop name when no logo is uploaded
- auto-enable shop name when logo is deleted
- fix image cache invalidation on delete
- add missing .hidden utility class

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 22:40:08 +00:00
jamey
32cc425458 separate account settings from shop settings
All checks were successful
deploy / deploy (push) Successful in 3m28s
- Create dedicated /admin/account page for user account management
- Move email, password, and 2FA settings from /admin/settings
- Add Account link to top of admin sidebar navigation
- Add TOTP-based two-factor authentication with NimbleTOTP
- Add TOTP verification LiveView for login flow
- Add AccountController for TOTP session management
- Remove Advanced section from settings (duplicated in dev tools)
- Remove user email from sidebar footer (replaced by Account link)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 18:42:29 +00:00
jamey
0c2d4ac406 add rate limiting and HSTS for security hardening
Some checks failed
deploy / deploy (push) Failing after 8m33s
- Add Hammer library for rate limiting with ETS backend
- Rate limit login (5/min), magic link (3/min), newsletter (10/min), API (60/min)
- Add themed 429 error page using bare shop styling
- Enable HSTS in production with rewrite_on for Fly proxy
- Add security hardening plan to docs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 08:58:43 +00:00
jamey
48eb7a9d9c update notification system docs as implementation reference
All checks were successful
deploy / deploy (push) Successful in 1m22s
Rewrote planning doc as a reference guide with:
- decision tree for choosing feedback type
- implementation patterns with code examples
- accessibility requirements
- common mistakes to avoid

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 07:55:55 +00:00
jamey
5e03dccb69 improve notification accessibility
- use role="status" for info messages, role="alert" for errors
- add aria-live attribute (polite for info, assertive for errors)
- move phx-click to close button for better keyboard navigation
- add close buttons to shop flash messages
- add aria-hidden to decorative icons

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 07:53:17 +00:00
jamey
8af5cbf41e mark notification system overhaul complete
All 7 tasks done:
- Inline feedback component for form saves
- Banner component (document-flow flash) for page-level outcomes
- Admin forms migrated: theme, pages, settings, email, providers
- Remaining admin pages migrated: media, products, newsletter
- Shop pages: already use correct patterns (cart drawer, banners)
- Setup wizard: already uses inline form errors + banners
- Old toast CSS removed (no .admin-toast exists)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 07:42:53 +00:00
jamey
db28cb8d9f migrate remaining admin pages to inline feedback
Replace put_flash with inline feedback for form saves:
- Media library: metadata save shows "Saved" checkmark
- Product show: storefront controls save shows "Saved" checkmark
- Newsletter campaign form: draft save shows "Saved" checkmark

Page-level outcomes (uploads, deletes, async operations) remain as
flash/banner messages — these are the correct pattern for non-form
actions.

Completes Task 4 of notification overhaul.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 07:34:17 +00:00
jamey
0834437340 add no-JS fallback for provider forms
Progressive enhancement: provider form now works without JavaScript.
Forms POST to ProvidersController (create/update), which handles
validation and redirects with flash messages.

With JS: LiveView phx-submit handles save, navigates with flash.
Without JS: Form POSTs to controller, redirects with flash.

Completes Task 3 of notification overhaul (admin forms migration).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 07:30:16 +00:00
jamey
3e29a89fff add link picker and validation to navigation editor
All checks were successful
deploy / deploy (push) Successful in 1m26s
- replace freeform inputs with grouped dropdown (pages, custom pages,
  collections, external URL)
- add inline URL validation for external links
- add inline feedback component instead of flash messages
- add dismiss-on-interaction pattern (feedback clears on changes)
- add no-JS fallback via NavigationController
- add DirtyGuard hook to warn before navigating away with unsaved changes
- add no-JS fallbacks for settings forms (from address, signing secret)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 02:10:06 +00:00
jamey
42542ac177 migrate admin forms to inline feedback
All checks were successful
deploy / deploy (push) Successful in 1m26s
Replace put_flash calls with inline feedback for form saves:
- Email settings: "Now send a test email" after saving
- Settings: from address and signing secret saves
- Page editor: save button shows "Saved" checkmark

Inline feedback appears next to save buttons and auto-clears after
3 seconds. Banners (put_flash) remain for page-level outcomes like
deletions, state changes, and async operations.

Task 3 of notification overhaul. Theme editor skipped as it auto-saves.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-07 21:01:54 +00:00
jamey
bd07c9c7d9 separate editor FAB and panel for cleaner animation
All checks were successful
deploy / deploy (push) Successful in 1m32s
Split the editor sheet into two distinct elements:
- .editor-fab: floating action button, always a pill in the corner
- .editor-panel: sliding panel that animates in/out independently

This enables proper CSS keyframe animations (slide-up/down on mobile,
slide-in/out on desktop) with a closing class for exit transitions.
Simplified the JS hook to only handle close behaviour.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-07 19:01:32 +00:00
jamey
3f96769840 refine editor sheet to floating pill button
All checks were successful
deploy / deploy (push) Successful in 1m32s
- collapsed state: floating pill button in bottom-right corner
- removed panel background when collapsed (transparent)
- violet accent colour to distinguish from shop theme
- white glow outline for visibility on any background
- consistent behaviour on mobile and desktop
- opens to bottom sheet (mobile) or side panel (desktop)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-07 11:36:18 +00:00
jamey
f4f036b84b replace admin rail with unified bottom sheet editor
All checks were successful
deploy / deploy (push) Successful in 1m30s
- add editor sheet component anchored bottom (mobile) / right (desktop)
- admin cog moves to header, always visible for admins
- remove Done button from editor header, keep only Save
- add editor_at_defaults tracking to disable Reset when at defaults
- sheet collapses on click outside or Escape, stays in edit mode
- dirty indicator + beforeunload warning for unsaved changes
- keyboard shortcuts: Ctrl+Z undo, Ctrl+Shift+Z redo
- WCAG compliant: aria-expanded, live region, focus management

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-07 09:30:07 +00:00
jamey
dbcecc7878 update notification overhaul plan
All checks were successful
deploy / deploy (push) Successful in 37s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 15:30:29 +00:00