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>
This commit is contained in:
jamey
2026-03-08 02:10:06 +00:00
parent 42542ac177
commit 3e29a89fff
10 changed files with 551 additions and 204 deletions

View File

@@ -68,7 +68,7 @@ defmodule BerrypodWeb.Admin.EmailSettings do
@impl true
def handle_event("form_change", %{"email" => %{"adapter" => key}}, socket) do
if key == socket.assigns.adapter_key do
{:noreply, socket}
{:noreply, assign(socket, :save_status, :idle)}
else
{:noreply,
socket
@@ -76,7 +76,8 @@ defmodule BerrypodWeb.Admin.EmailSettings do
|> assign(:selected_adapter, Adapters.get(key))
|> assign(:field_errors, %{})
|> assign(:test_result, nil)
|> assign(:test_error, nil)}
|> assign(:test_error, nil)
|> assign(:save_status, :idle)}
end
end
@@ -94,8 +95,6 @@ defmodule BerrypodWeb.Admin.EmailSettings do
socket.assigns.current_scope.user.email
) do
{:ok, _adapter_info} ->
Process.send_after(self(), :clear_save_status, 3000)
{:noreply,
socket
|> assign(:adapter_key, adapter_key)
@@ -145,10 +144,6 @@ defmodule BerrypodWeb.Admin.EmailSettings do
# Swoosh test adapter sends {:email, ...} messages — ignore them
def handle_info({:email, _}, socket), do: {:noreply, socket}
def handle_info(:clear_save_status, socket) do
{:noreply, assign(socket, :save_status, :idle)}
end
@impl true
def render(assigns) do
~H"""