PhoenixKit 2.14.0: Move the admin area off /admin and collapse the sidebar
PhoenixKit 2.14.0 lets a site serve its admin area under an address of its own choice instead of /admin, adds a collapsed icon sidebar with hover menus, and can hide the “Admin Panel” label in the admin header.
A different address for the admin area
config :phoenix_kit, admin_path: "/backoffice"
moves the whole admin area, so /phoenix_kit/admin/users becomes /phoenix_kit/backoffice/users. This is for sites that would rather not show their users an address that reads as an admin panel. The value must be one lowercase path segment, and not one PhoenixKit already uses, such as users, profile or dashboard; a wrong value stops the compile instead of giving a router full of dead links. Changing it recompiles your router.
Modules need no change. Their pages and links follow the new address on their own, including modules built before the option existed. Left unset, the address is /admin and the routes are exactly as before.
A sidebar that collapses to icons
A Collapse button at the foot of the admin menu narrows the sidebar to a rail of icons. Each icon shows its name on hover, and opens a small panel with the section’s sub-pages, so pages stay one click away. On a touch screen, a tap opens that panel instead of navigating. The current section is marked with a bar on the right edge. The choice is kept per browser, and only applies on wide screens; on smaller screens the sidebar stays a drawer.
Hide the “Admin Panel” label
The general settings at /admin/settings have a new checkbox, Show the “Admin Panel” label, on by default. Turned off, the admin header shows only the project name and the page. The label stays hidden for a visitor without admin rights, as before.
Other changes
- The Default notification link, used when a notification has no link of its own, now defaults to
/admininstead of the user dashboard, which is being retired. A site that saved/dashboardthere keeps it. mix phoenix_kit.gen.user.dashboardnow warns that it writes into the deprecated user dashboard and points tomix phoenix_kit.gen.admin.page.- Checks for admin pages now compare whole path segments, so
/administratorsor a page at/shop/adminno longer count as admin pages.
Upgrading
No migration. Update the dependency; with admin_path unset nothing moves. The release was built against mint 1.10.0, which fixes two denial-of-service advisories (EEF-CVE-2026-82728 and EEF-CVE-2026-82729). Your app’s lockfile decides which mint it runs, so update it with mix deps.update mint.
Full release notes: PhoenixKit 2.14.0
2.14.0 · 5 September 2026
The admin area stops being nailed to /admin, the deprecated user dashboard
stops being promoted from core’s own defaults, and the admin sidebar gains a
collapsed icon rail with hover flyouts.
Security
mint1.9.3 → 1.10.0, clearing two advisories the release gate refused to publish over: EEF-CVE-2026-82728 (HIGH — unbounded HTTP/1 status-line and chunk-extension buffering, memory-exhaustion DoS) and EEF-CVE-2026-82729 (MEDIUM — quadratic chunk-size parsing inMint.HTTP1.Parse, CPU-exhaustion DoS). Transitive, viafinch,swooshandtz; every constraint on it already allowed 1.10.0, so this is a lockfile move with no API change.
Added
-
The admin area’s URL segment is configurable.
config :phoenix_kit, admin_path: "/backoffice"moves the whole admin surface inside the mount prefix —
/phoenix_kit/backoffice/users— for hosts that would rather not show end users a URL that reads as somebody else’s admin panel. Independent of:url_prefix, which names the mount itself. Compile-time, so it belongs inconfig.exs;phoenix_kit_routes()folds it into__mix_recompile__?/0, so changing it re-expands the host router instead of leaving it serving the old segment. Default"/admin"produces a byte-identical route table, so an existing install is untouched./adminremains the canonical name in code. Nothing in core or in a module package is written against the configured value — call sites keep sayingRoutes.path("/admin/users"). The substitution lives in two inverse functions:Routes.apply_admin_segment/1when a URL is emitted (reached fromRoutes.path/2,Routes.admin_path/2, and the router’s own route table), andRoutes.canonical_admin_path/1when one is read back (tab active state, the admin nav parser,LayoutWrapper.admin_page?/1, the language switcher). A module package therefore needs no changes at all to honour a rename: its tabs are declared with relative paths and its links go throughRoutes.path/1.The route table is rewritten once, on the assembled AST of
phoenix_kit_admin_routes/1— the single point where core’s own table,:admin_dashboard_tabsentries, plugin views and a package’sadmin_routes/0all converge. So the rewrite reaches packages compiled long before the option existed, and cannot be forgotten by the next route added to the table.The value is validated (exactly one lowercase path segment, and not one of the segments core already declares —
users,profile,dashboard,api, …) and raises rather than producing a router that compiles and then 404s. -
The admin sidebar collapses to icons. A toggle at the foot of the menu narrows it to a 5rem icon rail; the label of each item moves to a hover tooltip, group headings and subtab lists fold away, and the choice is remembered per browser. Desktop only — below
lgthe sidebar is an overlay drawer that is already absent until summoned, so narrowing it buys nothing and costs the labels.Entirely client-side, and deliberately so. The sidebar is a function component, not a LiveView: there is no
handle_event/3owner for aphx-click, and giving one to every admin page (or bolting a globalattach_hookonto the adminon_mountchain) is a lot of machinery for a display preference. It is also a per-browser density choice, like the theme, so it lives inlocalStoragebeside it rather than in a settings row — and a client toggle costs no round trip and gives morphdom nothing to fight over, since the DOM is identical either way and only<html>changes.That makes the first paint the whole problem, which is why the stamp is a synchronous inline
<script>rendered immediately above the sidebar rather than a hook inphoenix_kit.js: it has to run before the menu is parsed or a viewer who chose compact gets a frame of the full-width sidebar on every load, and it must not depend on the host having re-runmix phoenix_kit.updateto refresh its vendored bundle. Same shape, and the same one-instance guard, asPhoenixKitWeb.Components.ThemeBootstrap.Hovering a rail icon opens a flyout naming that entry and listing its children. It is rendered for every navigable top-level entry, not only the active one:
subtab_displaydefaults to:when_active, so the inline subtab list exists only for the section you are already in — precisely the browsing an icon rail otherwise loses.Built on the
popoverAPI, which earns its place three times over. The top layer escapes the sidebar’s ownoverflow-y: autoclipping — an absolutely positioned panel is cut off at the rail’s edge, which is what would have made a plain CSS flyout (and the hover tooltip this replaces) unusable. Light-dismiss and Esc come free. And only onepopover="auto"can be open, so moving between icons closes the previous flyout with no bookkeeping. Positioned against the viewport on open, clamped so a section near the bottom of a long menu does not open past the fold.Touch is handled rather than assumed: with no hover available, a tap on a rail icon opens its flyout instead of navigating, so a touch user on a wide screen (a convertible laptop, a tablet in landscape — the rail is
lg-only) can still reach a subtab. Keyboard works because the panel sits immediately after its link in the DOM: the top layer changes painting, not the tree, so Tab walks straight into it.The collapsed rail marks where you are with a right-edge bar over a light primary tint, rather than the filled block the expanded menu uses — at 5rem a solid primary slab is most of the row and reads as a state rather than a marker. The tint is
color-mix-based and preceded by a plaintransparentdeclaration, so a browser withoutcolor-mixkeeps the bar-only rendering rather than the block. Two cases both get it: the entry that IS the current page, and the section that merely contains it. The second needed new information — expanded, that highlight sits on the active subtab, and compact mode hides the subtab list, so the parent now states the fact (data-pk-branch-active) and the rail’s CSS paints it. The flyout keeps the ordinary filled highlight; it is a wide panel with text, where the block is right.Accessibility: labels are visually hidden (
clip-path), neverdisplay: none, so every link keeps its accessible name and the collapsed menu still reads correctly to a screen reader. The toggle carriesaria-expandedand swaps its ownaria-labelwith the state. -
The “Admin Panel” label in the admin header can be turned off. New
show_admin_panel_labelsetting (Site Identity,/admin/settings), on by default — the row is absent on every existing install andget_boolean_setting/2answerstrue, so nothing changes until an operator says so. Off renders justProject name / Page.A switch rather than a title field, deliberately. The obvious version — let the operator type their own label — cannot work here: the wording is
gettext("Admin Panel"), already translated in all seven shipped locales, and an operator-typed string is one language. A German operator’s “Adminbereich” would be served to English and Russian visitors too.project_titlegets away with being a plain string because a project name is a brand; “Admin Panel” is a common noun phrase. So the setting controls whether the translated string renders, not what it says.The label also stays subject to the permission gate it already had: it is hidden for a visitor holding no admin rights whatever the setting says, since
/adminis the landing every authenticated user can reach and telling someone with no sidebar that they are in the “Admin Panel” is the one claim on the page that would be false.<LayoutWrapper.app_layout>gains a matchingshow_admin_panel_labelattr —nilreads the setting — so the header stays renderable, and testable, without a database.Unrelated and unchanged: the browser tab still reads
<project> Admin(override it with the existingdefault_tab_titlesetting), andconfig :phoenix_kit, project_title_suffix:still applies only to the user dashboard layout, never to the admin header. -
Routes.admin_area_path?/1is now public — “does this REAL URL land in the admin area?”, asked of the shape a?return_to=, a saved setting or an HTTP referer actually has: mount prefix on, locale segment optional. An audit of the 39phoenix_kit_*packages found the gap it fills. Of 897"/admin"literals across 32 of them, all but one are canonical inputs that the emit/read pair already handles — butphoenix_kit_entitiesallowlists a client-supplied_live_refererwithString.contains?(path, "/admin/"), because core exposed nothing better. That hand-rolled form claims/administrators, claims a host’s own page at/shop/admin, and silently matches nothing once the admin area is renamed. Pair it withlocal_path?/1when the path came from a client — that is the one that rejects//evil.comand ASCII control characters. Behaviour is unchanged; only the visibility and the docs are new.
Fixed
- The custom-admin-pages guide taught hosts to hardcode
/admin. Its worked example used a plain<.link navigate="/admin/blog/new">, which ignoresurl_prefix(so it was already broken on every install that changed the mount) and nowadmin_pathtoo. Switched to<.pk_link>, with the import the example was missing. /adminprefix tests were not segment-aware.Routes’ internaladmin_path?/1and the language switcher’s admin branch usedString.starts_with?(path, "/admin")/String.contains?(path, "/admin"), which also claimed/administratorsand a host page at/shop/admin. Both now compare whole segments. Cosmetic before — a link built through the wrong branch still resolved — but not once a rewrite started acting on the match:/administratorswould have become/backofficeistrators.
Changed
- The default notification click-through no longer points at the deprecated
user dashboard.
notification_default_link— the catch-all destination for a notification carrying nonotification_linkof its own — shipped with/dashboardas its built-in default, prefilled in the “Default notification link” field on/admin/settingsand described there as the page “every signed-in user can reach”. That page is deprecated (PhoenixKit.Install.Deprecations.user_dashboard_warning/0;phoenix_kit.install,.updateand.doctorhave been announcing its removal), and a host can compile it out today withuser_dashboard_enabled: false— so core was steering every new install toward a surface it is asking them to leave, and the field was the one place an operator would read that recommendation as official. The default is now/admin, which core declares unconditionally and admits every authenticated visitor to:PhoenixKitWeb.Users.Auth.landing_view?/1exempts the admin index from the admin-area gate, so a recipient holding no permissions is greeted rather than bounced. That is the same pagePhoenixKit.Utils.Routes.safe_destination/2already terminates on for exactly this reason. Hosts that saved/dashboardinto the settings row while it was the prefilled value are unaffected — that value is still honoured, still guarded againstuser_dashboard_enabled: false, and can be cleared or repointed from the same field. mix phoenix_kit.gen.user.dashboardnow carries the deprecation notice it generates into. The task writes a page onto the deprecated user-dashboard surface, and a host that only ever runs generators never saw the heads-up thatinstallandupdateprint. It is now emitted as an Igniter warning on every run and summarised under--help, which points atmix phoenix_kit.gen.admin.pagefor new work. Advisory only — nothing generated changes, and existing pages keep working.- Documentation examples for
<.pk_link>/<.pk_link_button>and the URL-prefix section ofCLAUDE.mdused/dashboardas their canonical path; they now use/admin, so the snippet a developer copies is not the deprecated one.
PhoenixKit 2.14.0. Install or update: {:phoenix_kit, "~> 2.14"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.