Commit Graph

339 Commits

Author SHA1 Message Date
jamey
ae6cf209aa complete admin CSS refactor: delete utilities.css, add layout primitives
- Delete utilities.css (701 lines / 24 KB of Tailwind utility clones)
- Add layout.css with admin-stack, admin-row, admin-cluster, admin-grid
  primitives and gap variants (sm, md, lg, xl)
- Add transitions.css import and layout.css import to admin.css entry point
- Replace all Tailwind utility classes across 26 admin templates with
  semantic admin-*/theme-*/page-specific CSS classes
- Replace all non-dynamic inline styles with semantic classes
- Add ~100 new semantic classes to components.css (analytics, dashboard,
  order detail, settings, theme editor, generic utilities)
- Fix stray text-error → admin-text-error in media.ex
- Add missing .truncate definition to admin CSS
- Only remaining inline styles are dynamic data values (progress bars,
  chart dimensions) and one JS.toggle target

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 21:40:21 +00:00
jamey
22d3e36ed5 format refactored admin templates
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 19:39:56 +00:00
jamey
867a69109e fix visual regressions in admin CSS refactor
Five missing line-height values caused pixel shifts when Tailwind
utilities (text-sm, text-lg, text-xs) were replaced with semantic
classes that only set font-size. Also remove phantom padding-bottom
on .admin-header (the old pb-4 utility was never defined).

Fixes: .admin-header, .admin-header-subtitle, .admin-error,
.admin-brand, .admin-text-secondary

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 19:39:22 +00:00
jamey
b7ec41b0cf refactor admin CSS: replace utility classes with semantic styles
Replace Tailwind utility soup across admin templates with semantic
CSS classes. Add layout primitives (stack, row, cluster, grid),
extract JS transition helpers into transitions.css, and refactor
core_components, layouts, settings, newsletter, order_show, providers,
and theme editor templates.

Utility occurrences reduced from 290+ to 127 across admin files.
All 1679 tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 17:15:25 +00:00
jamey
edef628214 tidy docs: condense progress, trim readme, mark plan statuses
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 17:15:18 +00:00
jamey
580a7203c9 add activity log with order timeline and global feed
All checks were successful
deploy / deploy (push) Successful in 4m22s
Single activity_log table powering two views: chronological timeline
on each order detail page (replacing the old fulfilment card) and a
global feed at /admin/activity with tabs, category filters, search,
and pagination. Real-time via PubSub — new entries appear instantly,
nav badge updates across all admin pages.

Instrumented across all event points: Stripe webhooks, order notifier,
submission worker, fulfilment status worker, product sync worker, and
Oban exhausted-job telemetry. Contextual action buttons (retry
submission, retry sync, dismiss) with Oban unique constraints to
prevent double-enqueue. 90-day pruning via cron.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 15:09:08 +00:00
jamey
b235219aee add dead link monitoring for outgoing content links
All checks were successful
deploy / deploy (push) Successful in 3m42s
Scans page blocks and nav items for broken URLs (internal via DB
lookup, external via HTTP HEAD). Daily Oban cron at 03:30, plus
on-demand checks when pages are saved. Admin UI tab on redirects
page with re-check, ignore, and clickable source links.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 13:00:59 +00:00
jamey
3480b326a9 add pagination across all admin and shop views
All checks were successful
deploy / deploy (push) Successful in 1m38s
URL-based offset pagination with ?page=N for bookmarkable pages.
Admin views use push_patch, shop collection uses navigate links.
Responsive on mobile with horizontal-scroll tables and stacking
pagination controls. Includes dev seed script for testing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 09:42:34 +00:00
jamey
7f6fd012a5 add send test email button to campaign form
All checks were successful
deploy / deploy (push) Successful in 1m22s
Sends the campaign to the admin's own email address as a preview,
with [Test] prefix in subject line. Uses the same HTML template
and formatting as real sends. Does not affect campaign status or
sent counts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 23:52:11 +00:00
jamey
aa008f83b2 add logo to newsletter email header
All checks were successful
deploy / deploy (push) Successful in 1m4s
Uses the shop logo image if configured, falls back to the favicon
icon (served as PNG) alongside the shop name, or plain text if
neither is available.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 23:44:03 +00:00
jamey
c71d08bb5c fix HTML email template for mobile rendering
All checks were successful
deploy / deploy (push) Successful in 1m45s
Add text-size-adjust, word-break, responsive media query, MSO
conditionals, and proper table attributes so emails render at
full size with correct wrapping on mobile clients.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 23:39:48 +00:00
jamey
199f0b506f add HTML email templates for newsletter
All checks were successful
deploy / deploy (push) Successful in 1m2s
Multipart emails (HTML + plain text fallback) with a branded wrapper:
shop name header, content area with auto-linked URLs and paragraph
formatting, and unsubscribe footer. Applied to both confirmation and
campaign emails.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 23:32:27 +00:00
jamey
620f31dde3 fix toggle switch knob centering in newsletter admin
All checks were successful
deploy / deploy (push) Successful in 3m43s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 23:27:54 +00:00
jamey
ad2e6d1e6d add newsletter and email campaigns
Subscribers with double opt-in confirmation, campaign composer with
draft/scheduled/sent lifecycle, admin dashboard with overview stats,
CSV export, and shop signup form wired into page builder blocks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 23:25:28 +00:00
jamey
8f989d892d add block previews, picker thumbnails and newsletter settings
All checks were successful
deploy / deploy (push) Successful in 1m30s
Block cards now show a one-line content summary below the name.
Block picker items include SVG wireframe thumbnails. Newsletter
block marked as decorative with configurable title/description
and form submission prevented on the shop side.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 20:34:52 +00:00
jamey
0a7982dfe8 add admin UX polish: nav grouping, inline settings, real preview data
All checks were successful
deploy / deploy (push) Successful in 1m33s
- sidebar nav grouped under Shop/Content/Settings section headers with
  subtle uppercase labels (#105)
- custom page settings now show inline in a collapsible panel within the
  editor instead of navigating away to a separate page (#107)
- admin editor preview loads real products and categories from the DB,
  falling back to PreviewData only on fresh installs (#108)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 20:17:03 +00:00
jamey
32cd642110 add admin UX quick wins: nav guard, block descriptions, input labels
All checks were successful
deploy / deploy (push) Successful in 1m16s
- rename "Providers" to "Print providers" in sidebar (#110)
- add LiveView navigation guard to EditorKeyboard hook — intercepts
  link clicks in capture phase when editor has unsaved changes (#103)
- add description field to all 26 block types, shown as subtitle in
  block picker; filter searches descriptions too (#104)
- add visible column headers (Label / Path) and proper sr-only labels
  with for attributes on nav editor inputs (#106)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 20:11:13 +00:00
jamey
f4bf9c13e6 add admin UX polish plan from full audit
All checks were successful
deploy / deploy (push) Successful in 53s
10 tasks covering unsaved changes warning, block picker
descriptions, sidebar grouping, nav editor labels, inline
page settings, real data preview, and more.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 19:48:22 +00:00
jamey
ca01f43d70 add no-JS contact form and noscript banner
All checks were successful
deploy / deploy (push) Successful in 1m21s
Wire up the contact form with action/method/name attrs so it works
without JavaScript. Add ContactNotifier, ContactController, and a
noscript info banner in the shop root layout.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 18:57:51 +00:00
jamey
af069c2bca update progress: mark #85 and #96 as done
All checks were successful
deploy / deploy (push) Successful in 1m7s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 17:55:35 +00:00
jamey
93ff66debc add legal page editor integration and media library polish
Some checks failed
deploy / deploy (push) Has been cancelled
Legal pages (privacy, delivery, terms) now auto-populate content from
shop settings on mount, show auto-generated vs customised badges, and
have a regenerate button. Theme editor gains alt text fields for logo,
header, and icon images. Image picker in page builder now has an upload
button and alt text warning badges. Clearing unused image references
shows an orphan info flash.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 17:55:02 +00:00
jamey
3336b3aa26 add page builder polish: utility blocks, templates, duplicate
All checks were successful
deploy / deploy (push) Successful in 1m24s
New block types: spacer, divider, button/CTA, video embed (YouTube,
Vimeo with privacy-enhanced embeds, fallback for unknown URLs).

Page templates (blank, content, landing) shown when creating custom
pages. Duplicate page action on admin index with slug deduplication.

Fix block picker on shop edit sidebar being cut off on mobile by
accounting for bottom nav and making the grid scrollable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 17:33:25 +00:00
jamey
69ccc625b2 fix mobile text autosizing on shop pages
All checks were successful
deploy / deploy (push) Successful in 1m23s
Chrome's font boosting algorithm was applying different text size
multipliers across pages, making the announcement bar font size
inconsistent between home and collection views on mobile.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 15:36:33 +00:00
jamey
79b5161e02 add undo/redo to page editors with keyboard shortcuts
All checks were successful
deploy / deploy (push) Successful in 1m29s
History stacks (@history/@future) on both admin editor and live sidebar,
capped at 50 entries. All mutations routed through apply_mutation for
consistent history tracking. EditorKeyboard JS hook combines DirtyGuard
with Ctrl+Z/Ctrl+Shift+Z. Settings panel fade-in animation. 10 new tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 12:16:15 +00:00
jamey
22d7b0e92b add published custom pages to sitemap
All checks were successful
deploy / deploy (push) Successful in 1m20s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 11:37:16 +00:00
jamey
3a243151af add data-driven navigation with admin editor
All checks were successful
deploy / deploy (push) Successful in 1m34s
Replace hardcoded header, footer and mobile nav with settings-driven
loops. Nav items stored as JSON via Settings, loaded in ThemeHook with
sensible defaults. New admin navigation editor at /admin/navigation
for add/remove/reorder/save/reset. Mobile bottom nav also driven from
header nav items with icon mapping by slug.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 11:18:37 +00:00
jamey
045be2ed7e add admin CRUD for custom CMS pages
All checks were successful
deploy / deploy (push) Successful in 1m21s
New settings form for creating and editing custom page metadata
(title, slug, meta description, published, nav settings). Pages
index shows custom pages section with draft badges and delete.
Editor shows settings button for custom pages, hides reset to
defaults. 20 new tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 09:43:03 +00:00
jamey
bb6b28a163 fix error page layout stacking blocks side by side
All checks were successful
deploy / deploy (push) Successful in 1m32s
The error-main flex container was missing flex-direction: column,
which went unnoticed until the page builder added a second block
(featured_products) to the error page defaults.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 08:45:52 +00:00
jamey
f479be5728 show proper 404 page for missing custom pages instead of redirecting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 08:35:01 +00:00
jamey
ad2f2517e5 add custom page LiveView with catch-all routing
Shop.CustomPage handles /:slug catch-all for CMS pages. Restructured
router so the catch-all is last — all admin, auth, setup, and SEO
routes defined before the shop scope to prevent interception.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 02:21:11 +00:00
jamey
cf627bd585 add custom page data model with split changesets and CRUD context
Stage 1 of custom CMS pages. Adds type/published/meta/nav fields to
pages schema, splits changeset into system vs custom (with slug format
validation and reserved path exclusion), adds create/update/delete
functions with auto-redirect on slug change, and warms custom pages
in ETS cache. 62 pages tests, 1426 total.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 01:56:19 +00:00
jamey
356e336eef plan custom CMS pages feature with catch-all routing
All checks were successful
deploy / deploy (push) Successful in 1m22s
Six-stage plan for user-created content pages at top-level URLs.
System pages keep dedicated LiveViews, custom pages use a single
generic LiveView with portable blocks. Includes navigation
management, SEO, and auto-redirects on slug change.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 01:40:37 +00:00
jamey
2c634177c4 add image picker to page editor and fix thumbnail layout
Wire up image field in block settings with a modal picker that
browses the media library. Fix picker thumbnails collapsing to
14px by replacing overflow:hidden with overflow:clip on grid
items (hidden sets min-height:0 in grid context). Polish media
library mobile sheet with scrim overlay and tighter spacing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 01:00:48 +00:00
jamey
847b5f3e5e add admin media library with image management and block picker integration
- Schema: alt, caption, tags fields on images table with metadata changeset
- Context: list_images with filters, find_usages, used_image_ids, delete_with_cleanup
- Admin UI: /admin/media with grid view, upload, filters, detail panel, metadata editing
- Block editor: :image field type for image_text and content_body blocks
- Page renderer: image_id resolution with legacy URL fallback
- Mobile: bottom sheet detail panel with slide-up animation
- CSS: uses correct --t-* admin theme tokens, admin-badge colour variants

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 22:20:51 +00:00
jamey
a039c8d53c add live page editor sidebar with collapsible UI
All checks were successful
deploy / deploy (push) Successful in 6m49s
Admins can now edit pages directly on the live shop by clicking the
pencil icon in the header. A sidebar slides in with block management
controls (add, remove, reorder, edit settings, save, reset, done).

Key features:
- PageEditorHook on_mount with handle_params/event/info hooks
- BlockEditor pure functions extracted from admin editor
- Shared BlockEditorComponents with event_prefix namespacing
- Collapsible sidebar: X closes it, header pencil reopens it
- Backdrop overlay dismisses sidebar on tap
- Conditional admin.css loading for logged-in users
- content_body block now portable (textarea setting + rich text fallback)

13 integration tests, 26 unit tests, 1370 total passing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 16:22:35 +00:00
jamey
b340c24aa1 add live preview pane to page editor
All checks were successful
deploy / deploy (push) Successful in 4m55s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 08:06:17 +00:00
jamey
6fbd654d57 add SettingsField struct and repeater field type for block settings
All checks were successful
deploy / deploy (push) Successful in 1m23s
Introduces typed settings schema with SettingsField struct, replaces
the read-only JSON textarea with a full repeater UI for info_card items.
Supports add, remove, reorder and inline editing of repeater items.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 00:54:13 +00:00
jamey
3f97742c0b add inline block settings editing to page editor
All checks were successful
deploy / deploy (push) Successful in 3m40s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:47:24 +00:00
jamey
660fda928f add admin page editor with block reordering and management
Stage 6 of the page builder: admin UI at /admin/pages for managing
page layouts. Page list shows all 14 pages grouped by category.
Editor supports reorder (up/down), add, remove, duplicate, save,
and reset to defaults. DirtyGuard JS hook warns on unsaved changes.
ARIA live regions announce block operations for screen readers.

Also: regenerate admin icons (81 rules via mix task with @layer
wrapping), add gen_smtp dep for SMTP email adapter, add :key to
page renderer block loop for correct LiveView diffing.

1309 tests, 0 failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:15:01 +00:00
jamey
21f57e39e2 fix stage 3 checkboxes in page builder plan
All checks were successful
deploy / deploy (push) Successful in 1m0s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 19:33:45 +00:00
jamey
24ad3b8b60 wire order pages and theme preview to page renderer, remove old templates
Some checks failed
deploy / deploy (push) Has been cancelled
All 14 pages now render through PageRenderer. Theme editor preview
unified from 10 preview_page clauses to one function + page-context
helpers. PageTemplates module and 10 .heex template files deleted.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 19:32:50 +00:00
jamey
16ebc29fa9 wire collection, PDP, cart, and search pages to page renderer
Stage 4 of the page builder: all shop pages now render via
PageRenderer instead of inline templates or PageTemplates.

- Collection: full filter bar moved to renderer (category pills,
  sort dropdown, CollectionFilters hook, empty state)
- PDP: related_products and reviews loaded via block data loaders
  instead of manual queries
- Cart: page definition loaded in mount, subtotal computed in render
- Search: page definition loaded in mount, handle_params unchanged
- Added Phoenix.VerifiedRoutes to PageRenderer for ~p sigil
- Net -55 lines (128 added, 183 removed)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 19:13:00 +00:00
jamey
914e0661a1 update url-redirects plan status to complete
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:32:26 +00:00
jamey
c69e51051f wire simple pages to PageRenderer (stage 3)
Home, Content (about/delivery/privacy/terms), Contact, and ErrorHTML
now render through the generic PageRenderer instead of hardcoded
templates. Block wrapper divs enable CSS grid targeting. Featured
products block supports layout/card_variant/columns settings for
different page contexts. Contact page uses CSS grid on data-block-type
attributes for two-column layout.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:29:20 +00:00
jamey
ca9f32fa42 update progress and plan for page builder stages 1-2
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:08:57 +00:00
jamey
32f54c7afc add generic page renderer with block dispatch
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:07:57 +00:00
jamey
35f96e43a6 add page builder data model, cache, and block registry
Stage 1 of the page builder: Pages schema with 14 valid slugs,
BlockTypes registry (26 block types with settings schemas and data
loaders), Defaults module matching existing templates, ETS-backed
PageCache GenServer, and Pages context (get_page/save_page/reset_page
with cache -> DB -> defaults lookup). 34 tests, zero visual change.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 17:45:07 +00:00
jamey
0c54861eb6 add analytics-powered 404 monitoring with FTS5 auto-resolve
All checks were successful
deploy / deploy (push) Successful in 9m48s
BrokenUrlTracker now queries real analytics pageview counts instead of
hardcoding 0, so broken URLs with prior traffic are distinguished from
bot noise. For /products/ 404s with a single FTS5 search match, auto-
creates a redirect and marks the broken URL resolved. 1232 tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:08:25 +00:00
jamey
6e57af82fc add URL redirects with ETS-cached plug, broken URL tracking, and admin UI
All checks were successful
deploy / deploy (push) Successful in 3m30s
Redirects context with redirect/broken_url schemas, chain flattening,
ETS cache for fast lookups in the request pipeline. BrokenUrlTracker
plug logs 404s. Auto-redirect on product slug change via upsert_product
hook. Admin redirects page with active/broken tabs, manual create form.
RedirectPrunerWorker cleans up old broken URLs. 1227 tests passing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 14:14:14 +00:00
jamey
23e95a3de6 make PDP variant selection work without JS
All checks were successful
deploy / deploy (push) Successful in 1m3s
Variant options (colour, size) are now URL params handled via
handle_params instead of phx-click events. Swatches and size buttons
render as patch links in shop mode, so changing variants works as
plain navigation without JS. Quantity is now a number input that
submits with the form. Unavailable variants render as disabled spans.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 01:08:36 +00:00