Skip to content

Customer Support 0.3.0: Ticket slugs stay put

Customer Support 0.3.0 fixes ticket slugs: a ticket’s slug is now made once from its title and stays the same when the ticket is edited or changes status.

Stable, readable slugs

Each ticket has a slug, its text identifier, which can be used to look the ticket up. Until now it was rebuilt on every save that did not set it, including every status change, and ended in six digits of the clock. It never stayed the same, and it did not guarantee that two tickets had different slugs. A title in Cyrillic gave a slug of digits only.

New tickets now get a slug made from the title, with Cyrillic and other scripts turned into Latin letters. When two tickets would share a slug, the later one gets -2, -3 and so on. An existing slug is kept on every later save. Tickets created before this release keep the slug they have, digits included; it simply stops changing.

A title that gives no slug at all, such as one made only of punctuation, is now rejected by the form with an error. Before, saving it failed in the database.

Form styling

The search field, the reply and internal note boxes and the settings page drop daisyUI’s old bordered classes and use the current field style.

Upgrading

Customer Support 0.3 needs PhoenixKit 2.4 or later, which provides the slug function and the unique index on ticket slugs. Under 0.2 a site with PhoenixKit 2.0 to 2.3 would build fine and then fail on every ticket create and update. Update PhoenixKit first and run mix phoenix_kit.update. The module brings no migration of its own.

Full release notes: Customer Support 0.3.0

0.3.0 · 14 August 2026

Changed

  • ⚠️ Requires phoenix_kit ~> 2.4. Ticket.changeset/2 calls PhoenixKit.Utils.Slug.put_slug/3, which core added in 2.4.0. The previous ~> 2.0 let a host resolve a core without that function: the build succeeded and then raised UndefinedFunctionError on every ticket create and update, in the host’s application. Nothing else about the requirement changed — it stays two-segment, so every later 2.x core still resolves.

Fixed

  • Ticket slugs no longer change on every save (#7). The local generator keyed on get_change(:slug), which is nil on any save that does not carry a slug — so every status transition regenerated. The slugify then appended the last six digits of the millisecond clock, which produced a new value each time and cycled every ~16.7 minutes, so it never guaranteed uniqueness either. Cyrillic titles slugged to a bare timestamp. Existing tickets keep their timestamped slugs (their identifiers simply stop moving); new tickets get a clean romanized title slug, and collisions suffix -2, -3 … against the unique index core V168 added.

  • A title that slugifies to empty (punctuation-only, unromanizable script) now fails validate_required(:slug) on the changeset instead of inserting with a nil slug and raising not_null_violation at the database.

Added

  • test/phoenix_kit_customer_support/ticket_slug_test.exs — integration coverage for stable slugs, romanization, and -2 collisions.
  • test/phoenix_kit_customer_support/ticket_slug_changeset_test.exs — changeset-only coverage that does not need Postgres (existing slug survives status/title edits; a punctuation-only title is rejected).
  • pk_dep/3 in mix.exs — local PHOENIX_KIT_PATH override for running the suite against uncommitted core; the published pin is unchanged when unset.
  • PhoenixKit.Migration.ensure_current/2 in the test helper so a fresh createdb actually builds the tickets tables (they live in core’s chain).

Customer Support 0.3.0. Install or update: {:phoenix_kit_customer_support, "~> 0.3"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.