CRM 0.4.0: Client becomes customer, plus a CRM landing page
CRM 0.4.0 renames the client role to customer, gives the CRM a landing page with counts, puts the list comparison into the sidebar and links contacts with their login accounts both ways. Sites that used the client role must run one data task after updating.
Client is now customer
The party role formerly called client is now customer everywhere: the role checkboxes on contacts and companies, the Customer badge and the customers filter on the lists. Roles saved by earlier versions still say client in the database. Until they are rewritten they are missing from the filter and the checkboxes and show as a plain grey badge. A task rewrites them:
mix phoenix_kit_crm.rename_client_role # dry run, reports the count
mix phoenix_kit_crm.rename_client_role --apply # rewrite
Running it twice is harmless, and on a site that never used the role it does nothing.
A landing page
/admin/crm now opens on counts of Companies, Contacts, Interactions and Lists, each linking to its page. The Lists count leaves archived lists out, as the Lists page does. A Portal access section shows the PhoenixKit roles allowed to open the CRM and how many users hold each.
Compare in the sidebar
The comparison page at /admin/crm/comparison, which shows contacts that share an email and contacts subscribed to all of several lists, now has a Compare entry in the sidebar, right after Lists.
Contacts and login accounts
The table of a role’s users gets a CRM contact column linking to the matching contact, read in one query per page. A contact’s Overview links to its login account with View login account. Rows in the CRM tables are now fully clickable, using core’s row link.
Contacts also get an Orders tab, shown only when the host app defines an Andi.CRMBridge module with orders_for_contact/1. The bridge is called only when the tab is opened, and an error in it does not take the rest of the contact page down.
Upgrading
Update PhoenixKit to 1.7.219 or later first; CRM 0.4 does not compile against an older core. If your CRM ever granted the client role, run mix phoenix_kit_crm.rename_client_role, check the count, then run it with --apply.
Full release notes: CRM 0.4.0
0.4.0 · 29 July 2026
Upgrade note — run the party-role data migration
The commercial party role client is now customer. Rows written by 0.2.x /
0.3.x keep role = "client" and are invisible to the renamed code: absent
from the Customers filter, absent from the company/contact role checkboxes,
and rendered as a raw grey badge. Rewrite them once per database:
mix phoenix_kit_crm.rename_client_role # dry-run: reports the count
mix phoenix_kit_crm.rename_client_role --apply # rewrite
The task is idempotent and a no-op on databases that never granted the role.
Added
Compareadmin tab (/admin/crm/comparison) — contacts subscribed to every one of several selected lists (PR #17).- Contact ⇄ login-account linkage (PR #17): a
CRM contactcolumn on the per-role users table linking to the matching contact, and a real link from a contact’s Overview to its login account. - Orders tab on the contact profile, populated by the host application’s
optional
Andi.CRMBridgeand hidden entirely when that bridge is absent (PR #17). - CRM landing page — company / contact / interaction / list counts, each linking to the page that manages it, plus a clearer “Portal access” section for the PhoenixKit roles that may open the CRM (PR #17).
mix phoenix_kit_crm.rename_client_role— theclient→customerdata migration described above.PhoenixKitCRM.Contacts.map_by_user_uuids/1,PhoenixKitCRM.Lists.count_lists/1,PhoenixKitCRM.Interactions.count_interactions/0, andPhoenixKitCRM.PartyRoles.{rename_legacy_client_roles/0, count_legacy_client_roles/0}.
Changed
client→customerthroughoutPartyRole, the contacts/companies role filters and the role labels/badges (PR #17). See the upgrade note above.- UI standardisation (PR #17): page wrappers no longer clamp to
max-w-*,phx-clickcheckboxes use core’s<.checkbox>, list-members pagination usesjoinstyling, and clickable table rows use core’s<.row_link>stretched-link overlay instead of aphx-clickhandler. This raises thephoenix_kitfloor to>= 1.7.219, the first release shippingPhoenixKitWeb.Components.Core.RowLink. - The
Comparetab now sorts directly afterListsin the sidebar rather than afterOrganizations.
Fixed
- The
CRM contactcolumn issued one query per table row, insiderender/1— so every re-render (opening the column modal, toggling card/table view) re-ran the whole set, not just the initial load. It is now a single batched lookup per page load, skipped entirely when the column isn’t selected. - A row’s stretched link could collapse onto a single cell.
relativeon thecrm_contactcell made that cell the row-link overlay’s positioned ancestor whenever the user ordered it first, so the row stopped being clickable. The link inside the cell lifts itself above the overlay instead. - The host order bridge was queried on every contact-profile tab switch, not just the Orders tab, and was not rescued — an exception in host code took down the whole profile rather than one tab.
- The Overview “Lists” count included archived lists while the Lists page it links to opens on Active, so the card disagreed with the page one click later.
- The CRM landing page no longer prints a specific host application’s backfill mix task, which does not exist in any other consumer of this package.
CRM 0.4.0. Install or update: {:phoenix_kit_crm, "~> 0.4"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.