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>
This commit is contained in:
jamey
2026-03-09 19:45:43 +00:00
parent 89c411e0fc
commit 378b3fdb6b
6 changed files with 543 additions and 8 deletions

View File

@@ -951,6 +951,11 @@ window.addEventListener("phx:scroll-preview-top", (e) => {
}
})
// Scroll to top on page navigation (patch navigation within LiveView)
window.addEventListener("phx:scroll-top", () => {
window.scrollTo({top: 0, behavior: 'instant'})
})
// connect if there are any LiveViews on the page
liveSocket.connect()