Skip to content

Dashboards 0.5.0: Places to show dashboards across the admin

Dashboards 0.5.0 lets an admin choose where a dashboard appears outside the Dashboards section: on the admin home page or in places other modules offer, for everyone or for one role.

The Places screen

A new Places screen, at /admin/dashboards/places, lists every place a dashboard can be shown. It explains itself as “Choose which dashboard appears where, and who sees it. Only shared dashboards can be placed.” For each place you pick a dashboard and Who sees it: Everyone or A role. Where several roles match one viewer, a Priority decides which dashboard wins. A personal or role-limited dashboard is refused with a message saying why, and so is a pixel dashboard on an admin page.

A place can be a tab in a module’s sidebar, a tab inside one of that module’s own records, or the admin home page. This module offers the Admin home place itself. Other modules declare their own places without depending on this package, and a host app can add some with config :phoenix_kit_dashboards, slot_providers: [...]. When a module is turned off, its places are hidden.

Personal versions

A viewer who wants a placed dashboard arranged differently clicks Make it mine: they get their own copy in that place, and Use the shared one goes back. A personal version wins over a role’s dashboard, which wins over the one for everyone.

Widgets that follow the page

A widget setting can now follow the page it is shown on, for example “the record this page is about” or “mine”, instead of one fixed record. On the Places screen such a place says “Widgets on this page can follow whatever this page is about.” When the record cannot be worked out, the widget shows a card explaining why instead of showing some other record.

The admin home page

PhoenixKit’s /admin landing page can now show the dashboards placed on Admin home. When nothing is placed there, or the module is off, the page shows its usual overview.

Fixes

  • The settings page of a dashboard limited to a role could be saved as your own by anyone with the dashboards permission. It now checks that you may manage it.
  • The role of a role dashboard is now checked against the real list of roles.
  • Saving or reordering a place now checks the permission of that place, and a refused reorder shows an error instead of quietly reverting.
  • A project tab could swap back to the dashboard it showed before after the project was pointed at another one.
  • Dashboards shown inside another page now use that page’s language.

Upgrading

Dashboards 0.5 needs PhoenixKit 2.15 or later. No migration: placements are stored as PhoenixKit settings. Nothing is placed after the update, so the admin home page looks the same until you place a dashboard on it.

Full release notes: Dashboards 0.5.0

0.5.0 · 11 September 2026

Added

  • Dashboard placement slots (#10). Modules can now declare a slot — a place a dashboard can be shown, such as a sidebar sub-tab (:module_tab), a tab rendered inside one of the declaring module’s own records (:record_tab), or the shared admin home page (:admin_home) — the same duck-typed, zero-dependency style as the widget provider contract. An admin binds a system dashboard to a slot for an audience (everyone, or one role) from a new Places screen (/admin/dashboards/places), with personal/role/everyone resolution (PhoenixKitDashboards.Placements.resolve/3) and per-viewer “make it mine” forking (Web.Personal) shared by every surface that renders a place.
  • Context binds. A widget’s settings field can declare context: "<kind>", letting a placed dashboard resolve that field to “the record this page is about” or “mine” instead of a fixed pin — resolved on the host side (PhoenixKitDashboards.Binds) so no widget needs to change. An unresolvable bind always renders an explanatory card, never a fallback record.
  • Admin-home slot. The core admin /admin landing page can now embed one placed dashboard (Web.AdminHomeLive), gated the same way as any other :admin_home slot.

Changed

  • Raised the phoenix_kit floor to ~> 2.15 (was ~> 2.0). The declared ~> 2.0 floor resolved core 2.13.5, whose Settings.update_setting_with_module/3 is arity 3; Placements.write/3 needs the arity-4 version core first shipped in 2.15.0. Below that floor, write/3’s rescue silently swallowed every place/unplace/reprioritise call — the whole feature dead on arrival with no visible error. core_pin_conformance_test.exs now pins the real floor by name.

Fixed

Found and fixed during this PR’s own pre-merge quality sweep (see dev_docs/pull_requests/2026/10-dashboard-placement-slots/QUALITY_SWEEP.md):

  • The dashboard settings page could re-own a role dashboard: it gated on manageable_by?/2, which only restricts personal boards, so any holder of the dashboards permission could open a role board they don’t belong to and save it as their own.
  • role_uuid was written straight from the request without checking it against the real role list.
  • Placement writes never re-checked the slot’s own permission (the read path already did); the slot key is a hidden form input, so the permission-filtered list was display-only. set_priority/3 also discarded a refusal, so a blocked reorder looked like a silent revert.
  • The project-tab viewer adopted {:dashboard_updated, _} for whatever dashboard it last resolved to and never unsubscribed, so re-pointing a project’s dashboard could have an edit to the old board swap it back in.
  • Neither off-router-mounted view (live_render) applied the locale it documented receiving, so their strings fell back to English inside an otherwise-translated page.

Dashboards 0.5.0. Install or update: {:phoenix_kit_dashboards, "~> 0.5"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.