-
- Reset to Defaults
-
-
- <%= if @saving do %>
- Saving...
- <% else %>
- Save Settings
- <% end %>
-
-
-
-
+ <%!-- Action Buttons --%>
+
+
+ Reset to Defaults
+
+
+ <%= if @saving do %>
+ Saving...
+ <% else %>
+ Save Settings
+ <% end %>
+
+
+
-
+
diff --git a/lib/phoenix_kit_web/components/auth_page_wrapper.ex b/lib/phoenix_kit_web/components/auth_page_wrapper.ex
index 2ad96854e..5f7fec1a9 100644
--- a/lib/phoenix_kit_web/components/auth_page_wrapper.ex
+++ b/lib/phoenix_kit_web/components/auth_page_wrapper.ex
@@ -52,8 +52,7 @@ defmodule PhoenixKitWeb.Components.AuthPageWrapper do
page_title={@page_title}
>
{raw(@bg_style_tag)}
- <%!-- z-10: above footer (z-auto/0) but below sticky header (z-50) in parent layouts --%>
-
+
<%= if @auth_logo_url != "" do %>
diff --git a/lib/phoenix_kit_web/live/components/user_settings.ex b/lib/phoenix_kit_web/live/components/user_settings.ex
index a169a68aa..47ebfe7e5 100644
--- a/lib/phoenix_kit_web/live/components/user_settings.ex
+++ b/lib/phoenix_kit_web/live/components/user_settings.ex
@@ -20,8 +20,8 @@ defmodule PhoenixKitWeb.Live.Components.UserSettings do
## Optional assigns
- * `sections` — list of sections to display: `:profile`, `:email`, `:password`, `:oauth`
- (default: all four)
+ * `sections` — list of sections to display: `:identity`, `:custom_fields`, `:email`, `:password`, `:oauth`
+ (default: all five). `:profile` is accepted as a legacy alias that expands to `[:identity, :custom_fields]`
* `email_confirm_url_fn` — `(token -> url)` for email confirmation links
(default: `&Routes.url("/dashboard/settings/confirm-email/\#{&1}")`)
* `return_to` — where OAuth redirect returns to (default: `"/dashboard/settings"`)
@@ -43,7 +43,7 @@ defmodule PhoenixKitWeb.Live.Components.UserSettings do
alias PhoenixKit.Users.OAuthAvailability
alias PhoenixKit.Utils.Routes
- @default_sections [:profile, :email, :password, :oauth]
+ @default_sections [:identity, :custom_fields, :email, :password, :oauth]
@impl true
def update(%{action: :check_avatar_uploads_complete}, socket) do
@@ -73,6 +73,13 @@ defmodule PhoenixKitWeb.Live.Components.UserSettings do
user = assigns[:user] || socket.assigns[:user]
sections = assigns[:sections] || socket.assigns[:sections] || @default_sections
+ # Expand legacy :profile into fine-grained sections for backward compatibility
+ sections =
+ Enum.flat_map(sections, fn
+ :profile -> [:identity, :custom_fields]
+ other -> [other]
+ end)
+
email_confirm_url_fn =
assigns[:email_confirm_url_fn] || socket.assigns[:email_confirm_url_fn] ||
(&Routes.url("/dashboard/settings/confirm-email/#{&1}"))
@@ -653,8 +660,8 @@ defmodule PhoenixKitWeb.Live.Components.UserSettings do
~H"""
- <%!-- Profile Section --%>
- <%= if :profile in @sections do %>
+ <%!-- Identity Section (avatar, name, username, timezone) --%>
+ <%= if :identity in @sections do %>
<%!-- Success Message --%>
<%= if @profile_success_message do %>
@@ -678,7 +685,7 @@ defmodule PhoenixKitWeb.Live.Components.UserSettings do
<% end %>
- <%!-- Profile Form with Avatar --%>
+ <%!-- Identity Form with Avatar --%>
<.simple_form
for={@profile_form}
id={"#{@id}-profile-form"}
@@ -733,84 +740,6 @@ defmodule PhoenixKitWeb.Live.Components.UserSettings do
label="Username"
/>
-
- <%!-- Custom Fields --%>
- <%= if length(@custom_field_definitions) > 0 do %>
-
-
Additional Information
-
-
- <%= for field <- @custom_field_definitions do %>
- <% field_name = "profile_form[user][custom_fields][#{field["key"]}]" %>
- <% field_value =
- get_in(@user.custom_fields, [field["key"]]) || field["default"] || "" %>
-
+
+
+ <%= if Enum.any?([:email, :password, :oauth], & &1 in @sections) do %>
+
+ <% end %>
<% end %>
@@ -927,7 +961,9 @@ defmodule PhoenixKitWeb.Live.Components.UserSettings do
<% end %>
-
+ <%= if :email in @sections and Enum.any?([:password, :oauth], & &1 in @sections) do %>
+
+ <% end %>
<%!-- Password Section --%>
<%= if :password in @sections do %>