Skip to content

PhoenixKit 2.15.0: Rename the admin area and retire the user dashboard

PhoenixKit 2.15.0 lets a site give its admin area another name that stays translated, and stops routing the old user dashboard at /dashboard unless the site asks for it.

A name for the admin area

The admin header and the account menu show “Admin Panel”. A site can now pick one of ten names instead: Admin Panel, Dashboard, Backoffice, Console, Control Panel, Workspace, Portal, My Account, Management and Studio. Each one is translated into all seven languages PhoenixKit ships, so a German visitor still reads it in German.

config :phoenix_kit, admin_panel_label: :workspace

Without that line, the name follows :admin_path. A site with admin_path: "/backoffice" gets “Backoffice” in the header, so the address and the wording match. An address that matches no name keeps “Admin Panel”. A plain string, such as admin_panel_label: "Acme HQ", also works, but it is not translated. An unknown value falls back to the default and logs a warning instead of stopping the site.

mix phoenix_kit.install and mix phoenix_kit.update add the list of names to your config/config.exs as comments, so the choice is in front of you when you edit the file. In the general settings, the checkbox now reads Show the “Admin Panel” label in the admin header, and its description points to admin_panel_label.

The user dashboard is off by default

:user_dashboard_enabled now defaults to false. /dashboard and /dashboard/settings are no longer routed unless your config turns them on. The admin area has taken over their job: every signed-in visitor can open /admin, which shows only the sections they are allowed to see.

The avatar menu that a site embeds in its own header now has a single entry leading to the admin area. An admin sees it as “Admin Panel”, everyone else as “My Account”. It used to point to /dashboard for everyone, even where the dashboard did not exist. The account switch fallback also goes to /admin now. With the dashboard off, /dashboard can be used as your admin_path.

Fixes

  • Links in the account menu no longer carry a dialect such as /en-US/ that was redirected to /en/ right away, and no longer add a language prefix where the primary language has none.
  • The active item in the menu is highlighted again under a renamed admin path.

Upgrading

No migration. Run mix phoenix_kit.update; it tells you when the dashboard default affects you. If your site still uses /dashboard, add config :phoenix_kit, user_dashboard_enabled: true: nothing was deleted, and the routes come back unchanged. A site that already runs under a renamed admin_path matching one of the names will see the header wording change to that name; set admin_panel_label: :admin_panel to keep “Admin Panel”.

Full release notes: PhoenixKit 2.15.0

2.15.0 · 5 September 2026

The deprecated user dashboard stops being routed by default, and the admin area gets a name of its own — one that a host can change without giving up translation.

⚠️ Two behaviour changes for existing hosts, both covered below: :user_dashboard_enabled now defaults to false, so /dashboard stops routing for anyone who never wrote the key; and a host already running a renamed :admin_path that matches a preset will see its header wording change to match the URL. Neither deletes anything — one config line restores either.

Added

  • The admin area can be called something else, and stay translated. Ten built-in names — Admin Panel, Dashboard, Backoffice, Console, Control Panel, Workspace, Portal, My Account, Management, Studio — each a real gettext/1 msgid translated into all seven shipped locales. A host picks one and a German visitor still reads “Arbeitsbereich” where an English one reads “Workspace”:

    config :phoenix_kit, admin_panel_label: :workspace
    

    Unset, the name is derived from :admin_path, so renaming the URL renames the wording with it and the two cannot drift:

    config :phoenix_kit, admin_path: "/backoffice"
    

URL /backoffice, header “Backoffice” — one key, both aligned

- and _ are equivalent in the segment, and a segment matching no preset (/x7q, or any deliberately obscure rename) keeps the translated “Admin Panel” rather than inventing a label out of the URL.

A free-text string still works — admin_panel_label: "Acme HQ" — as the escape hatch for a brand name no preset covers. ⚠️ It is not translated: one string, shown to every visitor in every language. That is exactly why the presets exist, and why neither form is an operator field on /admin/settings: config.exs puts the tradeoff at the point of the decision, and keeps the wording next to :admin_path, which is compile-time config for the same reason.

Resolution is PhoenixKit.Config.admin_panel_label/0 → {:preset, atom} or {:custom, binary}, rendered by the new PhoenixKitWeb.Components.Core.AdminLabel. Both the header chip and the account-menu admin entry go through it, so they cannot disagree. Unlike :admin_path, an unrecognised value here falls back rather than raising — this is cosmetic, and a typo must not take the admin area down in production — but it logs once, naming the valid presets, so the fallback is not silent.

  • mix phoenix_kit.install / .update write the naming options into the host’s config/config.exs, commented out. A closed vocabulary of atoms is not something a developer can guess, and neither of the places it was first written down reaches them: the settings page is read by operators who cannot act on it, and a CHANGELOG is read once. The block puts the whole list — each preset, what it reads as, and the admin_path it pairs with — in the file they open to make the change.

    Every line is a comment, so the block is inert: it cannot execute, cannot conflict, and does not care where in the file it lands, which is what makes appending it after import_config safe. A test asserts that property directly, and a second walks admin_label_presets/0 so a preset added without its comment entry fails the suite instead of raising partway through somebody’s install. Idempotent on a marker, and skipped entirely once the host has an uncommented admin_panel_label: — at that point they have made the choice the block exists to explain.

    With the list living there, the settings-page description shortened to point at it rather than reciting ten names to an audience that cannot use them.

Changed

  • The “Admin Panel” settings field says where the label appears and how to change the wording. The checkbox now reads Show the “Admin Panel” label in the admin header rather than leaving the location to the description, and the description no longer repeats it. It also no longer says the wording “has no setting” — it lists the built-in names and points at admin_panel_label, and notes that renaming the URL with admin_path picks the matching name on its own. Both strings translated in all seven shipped locales.

  • :user_dashboard_enabled now defaults to false — the user dashboard is retired from core’s defaults. /dashboard, /dashboard/settings and the confirm-email compat redirects are no longer routed unless a host asks for them. Its job has moved into /admin, which shows each visitor the sections their permissions allow and greets a permission-less visitor rather than bouncing them (PhoenixKitWeb.Users.Auth.landing_view?/1). Together with the widget change below, nothing in core links to /dashboard any more.

    ⚠️ Breaking for a host that never wrote the key — it took the old default without choosing it, and /dashboard stops routing on the next compile. mix phoenix_kit.update now says so, and says the one line that keeps it.

    Nothing has been deleted. The LiveViews, the layout, the sidebar, the tab machinery and the route macros are all still there, so this is a switch and not a removal:

    config :phoenix_kit, user_dashboard_enabled: true
    

    restores the routes unchanged. That is only true because of the next item.

  • user_dashboard_enabled is now tracked by __mix_recompile__?/0. It is read at macro-expansion time by the route macros, exactly like admin_path, so the compiler had no idea the host router depended on it — and it was not in the recompile check. A host flipping the flag would have kept serving a router compiled against the old value until something unrelated forced a recompile. The setting only became worth having as a real switch once the default flipped, which is what surfaced this.

  • /dashboard is no longer a reserved admin_path segment while the user dashboard is off. @admin_path_collisions refused it unconditionally because core declared a route tree there; with user_dashboard_enabled: false nothing occupies it, so config :phoenix_kit, admin_path: "/dashboard" is now legal — the rename a host retiring the user dashboard is most likely to want. Turning the dashboard back on puts the segment back in the list and the next compile raises, rather than letting whichever tree the router declared first silently win.

  • The deprecation notices split by what the host actually configured. mix phoenix_kit.install no longer warns about a dashboard a fresh install does not have. mix phoenix_kit.update prints the deprecation heads-up only to a host that switched the dashboard on, the new default-changed notice to a host that never wrote the key, and nothing to a host that chose false — via the new PhoenixKit.Config.user_dashboard_configured?/0, which distinguishes “took the default” from “chose false” (user_dashboard_enabled?/0 answers false to both).

  • The session widget’s user-facing entry now leads to the admin area, not the deprecated user dashboard. PhoenixKitWeb.Components.UserDashboardNav.user_dropdown/1 — the avatar dropdown a host embeds in its own header — rendered a “Dashboard” item pointing at /dashboard for every signed-in visitor, and was the one place in core that did not gate that link on PhoenixKit.Config.user_dashboard_enabled?/0. Every other call site does (auth_router.ex, both route macros in integration.ex, NotificationsBell.default_link/1, the AdminNav divider), so a host that compiled the dashboard out was left with a menu entry that 404s.

    Every signed-in visitor now gets exactly one entry leading to Routes.path("/admin"), which is the page core declares unconditionally and admits every authenticated visitor to — PhoenixKitWeb.Users.Auth.landing_view?/1 exempts the index from the admin-area gate, and it shows a permission-less visitor the welcome block and nothing else. An admin-area holder sees it as “Admin Panel” with a shield; everybody else sees “My Account” with a house. The two are mutually exclusive and take their wording from one private admin_entry_label/1, so the pair cannot drift.

    Because the destination is built with Routes.path("/admin"), it picks up a renamed admin segment (config :phoenix_kit, admin_path: "/myaccount") for free. Note that admin_path: "/dashboard" is still refused — dashboard is on @admin_path_collisions for as long as core declares the /dashboard route family.

    The :dashboard key in the :authenticated_links attr keeps its name and its place in the default list, so a host passing an explicit list needs no edit; only where it points has changed. Wording stays gettext/1 on both arms rather than becoming an operator-typed setting, for the reason LayoutWrapper already gives for the “Admin Panel” chip: a stored string would serve one language’s wording to every locale. "My Account" is translated in all seven shipped locales.

  • The context-switch fallback redirect points at /admin. PhoenixKitWeb.Controllers.ContextController string-built "#{url_prefix}/dashboard" for requests arriving with no usable referer — the same dead destination, reached by exactly the visitors who got there by accident. It now goes through Routes.path("/admin"), so it also honours a renamed admin segment instead of concatenating the URL prefix by hand.

Fixed

  • Menu links no longer emit a locale segment the router immediately redirects away from. user_dropdown/1 passed @current_locale straight into Routes.path/2 and Routes.user_settings_path/1. That assign is the gettext dialect ("en-US"); URLs are served on the base code ("en"), as PhoenixKitWeb.Users.Auth.validate_and_set_locale/2 documents. Routes.path/2 takes :locale verbatim, so a visitor on /en/profile/settings was offered /en-US/… links — which route, then bounce through a redirect to /en/…. Worse, default_locale?/1 compares against the base default, so "en-US" != "en" also defeated prefixless-primary and produced a locale segment where there should have been none. Both links now go through the normalising helpers (Routes.locale_aware_path/2 / locale_aware_user_settings_path/1) that the multi-session forms three lines below were already using. Same slip fixed in the modules page’s “Configure” link for crawler settings.
  • The dropdown’s active-item highlight survives a renamed admin segment. active_path?/2 compared the real request path against the /admin written in the markup without canonicalising, so under admin_path: "/myaccount" nothing ever highlighted. It now folds the configured segment back through Routes.canonical_admin_path/1 first.

PhoenixKit 2.15.0. Install or update: {:phoenix_kit, "~> 2.15"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.