Skip to content

Projects 0.7.0: Workflow statuses that each project keeps for itself

Projects 0.7.0 lets a site define its own workflow statuses for projects. A project takes its list from a catalogue kept in the Entities module and, once it starts, keeps its own copy that later catalogue edits do not touch.

Workflow statuses

A project picks a status list on its form, with a live preview, or uses the site’s default list. Until the project starts, it follows the list as it is in the catalogue. When it starts, the list is copied into the project, so a running project owns its statuses and can be edited on its own. The project page gets a picker for its current status, which shows as a coloured badge, and the project list can be filtered by status.

Status titles can be translated. A site-wide default decides whether translated titles are shown, and each project can override it. Translations are captured either way.

Statuses come from the optional Entities module. Without it, the feature simply stays off and nothing breaks.

A Project settings page

The module gets a Project settings page in the admin settings. Under Workflow statuses you choose the Default status list, or create a starter list with Generate default, and set whether translated status titles are shown by default.

An external reference

Projects get an external_id field for an id from another system. It has no form field; apps set it from code.

Fixes

  • Switching a started project to another status list now happens in one step, so a failure cannot leave it half changed, and a removed status no longer stays selected.
  • A status colour is only used when it is a plain hex value, and the text colour is picked for contrast.

Upgrading

Projects 0.7 needs PhoenixKit 1.7.125 or later: core’s migration V125 adds the status tables and columns. Update core and run its migrations. To use workflow statuses, add phoenix_kit_entities (0.2 or later) to your app.

Full release notes: Projects 0.7.0

0.7.0 · 31 May 2026

User-defined workflow statuses for projects — a status vocabulary sourced from the optional phoenix_kit_entities catalog and cemented locally when a project starts (the module’s template→instance philosophy), so a running project owns a frozen, independently-editable copy that later catalog edits don’t touch. Also adds a free-form external_id reference, and folds in the PR #1/#12 follow-ups plus two rounds of post-merge review hardening.

Added

  • Workflow statuses (PhoenixKitProjects.Statuses) — an optional-dependency context (graceful degradation mirroring Translations: reads return []/nil, provisioning returns {:error, :entities_not_available}, cementing is a no-op when entities is absent). A project draws its status list from a chosen phoenix_kit_entities catalog (or the admin-set global default); at start_project/2 the list is snapshotted into the new phoenix_kit_project_statuses rows (Schemas.ProjectStatus) inside the same transaction. The selected status is addressed by a stable slug (current_status_slug), resolving against the live catalog before start and the cemented rows after.
  • Status localization — primary-language titles are cemented as canonical labels and per-language overrides captured into each row’s translations JSONB, resolved to the viewer’s content locale on read. A global default (“show translated status titles”) plus a per-project tri-state override gate display; translations are always captured regardless.
  • /admin/settings/projects page (ProjectsSettingsLive, via settings_tabs/0) — pick the global default status list (or generate a starter one) and toggle translated-title display.
  • UI — workflow-status badge, form status-source picker with live preview + “Generate default”, show-page current-status picker, and a list-view status filter (list_projects/1 / count_projects/1 gain :current_status_slug).
  • Project.external_id — free-form external reference (id/uuid/slug, max 255), included in the PubSub payload. No UI; set programmatically by host apps.
  • Projects.scoped_assignments/2 — single-query multi-endpoint scope check (used by dependency removal).

Changed

  • Minimum phoenix_kit is now ~> 1.7.125 — the V125 release that ships the workflow-status schema (phoenix_kit_project_statuses table + status_entity_uuid / current_status_slug / settings / external_id columns).
  • New optional dependency phoenix_kit_entities (~> 0.2) — the status catalog source. Kept optional: true so it stays out of host closures; the feature degrades gracefully when it’s absent.
  • Project schema gains server-owned status_entity_uuid / current_status_slug (written only via current_status_changeset/2, never the form changeset) and a settings JSONB whose keys are whitelisted on cast.

Fixed

  • PR follow-ups — unique_constraint single-field edge (#9), scoped_assignments/2 endpoint check in remove_dependency (#12), validate_required(:counts_weekends) (#16).
  • Re-cement is atomic — switching a started project’s status list updates the project, re-copies its local rows, and reconciles the selection in one transaction; :project_updated is broadcast only after commit, so a rollback can’t leak a phantom event.
  • No dangling selection — current_status_slug is cleared when a re-cement drops the selected status or when remove_project_status/1 deletes the selected row.
  • reverse_reference_count/1 excludes started (cemented) projects, matching the entities “Used by N” semantics.
  • CSS-injection guard — the badge only emits a colour into the inline style when it’s bare hex; text colour is chosen by luminance for contrast.
  • TranslateResourceWorker uniqueness — the unique state list now includes :suspended (added by Oban 2.20) so dedup covers every incomplete state and compile --warnings-as-errors stays clean.

Projects 0.7.0. Install or update: {:phoenix_kit_projects, "~> 0.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.