fix email settings: missing providers, a11y, no-JS support

show all 10 providers in three groups (popular, transactional,
advanced) with category headings. fix phx-change clobbering text
fields, async test email sending state, integer parse crash on
bad port. add keyboard focus on card radios, fieldset legend,
WCAG-compliant badge contrast, responsive grid. extract shared
save_config into Mailer, add no-JS controller fallback with
configured_adapter hidden field for adapter change detection.
remove CardRadioScroll JS hook (no longer needed).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-03-04 21:26:59 +00:00
parent dd659e4c61
commit dd20ea824f
9 changed files with 637 additions and 235 deletions

View File

@@ -507,28 +507,6 @@ const CollectionFilters = {
}
}
const CardRadioScroll = {
mounted() {
this.el.addEventListener("change", (e) => {
if (!e.target.matches('input[type="radio"]')) return
const key = e.target.value
const form = this.el.closest("form")
if (!form) return
form.querySelectorAll("[data-adapter]").forEach((section) => {
const match = section.dataset.adapter === key
section.hidden = !match
section.querySelectorAll("input, textarea, select, button[type='submit']").forEach((input) => {
input.disabled = !match
})
})
const target = document.getElementById(`adapter-config-${key}`)
if (target) target.scrollIntoView({ behavior: "smooth", block: "nearest" })
})
}
}
// Analytics export: reads the current period and filters from the DOM at click time
// so the download URL is always correct, even if clicked before the LiveView re-render.
const AnalyticsExport = {
@@ -704,7 +682,7 @@ const EditorKeyboard = {
const csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
const liveSocket = new LiveSocket("/live", Socket, {
params: {_csrf_token: csrfToken, screen_width: window.innerWidth},
hooks: {...colocatedHooks, ColorSync, Lightbox, CartPersist, CartDrawer, ProductImageScroll, SearchModal, CollectionFilters, CardRadioScroll, AnalyticsInit, AnalyticsExport, ChartTooltip, DirtyGuard, EditorKeyboard},
hooks: {...colocatedHooks, ColorSync, Lightbox, CartPersist, CartDrawer, ProductImageScroll, SearchModal, CollectionFilters, AnalyticsInit, AnalyticsExport, ChartTooltip, DirtyGuard, EditorKeyboard},
})
// Show progress bar on live navigation and form submits