Skip to content

PhoenixKit 1.7.152: User menu works on bare language pages

PhoenixKit 1.7.152 fixes the language switcher in the user menu. A page whose address is only a language, such as /ru or /en-GB, failed with an error as soon as it rendered that menu, for guests and signed-in users alike.

Such an address now counts as the home page, so the switch links lead to /ru, /fr and so on. A real three-letter page such as /faq is still not taken for a language.

The menu also marks the current language again on the default-language pages. It compared full dialects, so English set up as en-GB never matched en-US. It now compares the base language. The guest menu button is now a rounded square with a person icon, the same shape as a signed-in user’s avatar.

Full release notes: PhoenixKit 1.7.152

1.7.152 · 15 June 2026

Fixes two user-menu language-switcher bugs on locale-prefixed / default-locale pages.

Fixed

  • user_dropdown / guest dropdown no longer crash on a bare /:locale path. remove_locale_from_path/1 fed the post-strip remainder to Path.join/1, which raised FunctionClauseError on an empty list — so rendering the in-menu language switcher on a path that is only a locale segment (e.g. /ru, /fr, /en-GB) 500’d the page. A path that reduces to just a locale now returns /, so the switch links resolve correctly (/ru, /fr, …). Surfaced by hosts adopting locale-prefixed landings (1.7.150+). Locale detection stays narrow (2-char base or 5-char dialect) so a real 3-char page segment like /faq isn’t mistaken for a locale.
  • Current language now highlights on the default locale. The in-menu list compared the enabled dialect against @current_locale with full-dialect equality, so on the default page (where the active locale resolves to a fixed dialect like en-US while English is enabled as en-GB) nothing matched and the active language wasn’t marked. Highlighting now compares base codes (en/en-GB/en-US all match), matching Core.LanguageSwitcher, and works whether the caller passes a base or a dialect.
  • Guest dropdown trigger matches the authenticated avatar shape. The logged-out trigger was a round hero-user-circle; it’s now a rounded-rectangle placeholder (w-10 h-10 rounded-lg) with a person silhouette, consistent with the signed-in avatar.

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