Entities 0.2.8: Section headings, an Other option, and an embeddable record form
Entities 0.2.8 adds two things to the field editor, a section heading and an “Other” option for choice fields, and gives developers a record form they can place on their own pages.
A Section Heading field groups long forms visually. It stores nothing and is skipped by every check. Select, radio and checkbox fields get Allow custom option (Muu) in the field editor, which adds an Other choice with a text box; the typed answer is stored as the value, as any other choice would be.
PhoenixKitEntities.Components.LiveDataForm shows or edits one record outside the admin, with autosave and an optional submit button, or as a read-only view. Field definitions can also carry translated labels and option texts; the new form and the field builder show them, while the admin record form and the public form do not yet.
Saves now check radio and checkbox values against the field’s options, as select fields already were, and a required checkbox group with nothing ticked counts as empty.
Full release notes: Entities 0.2.8
0.2.8 · 24 July 2026
Added
headingfield type — display-only section header for visually grouping fields in long forms. Carries no data, is skipped by every validation path (EntityData.changeset/2, bothFormBuilder.validate_data/3branches), and renders as an<h3>inFormBuilder.build_field/3andLiveDataForm’s readonly view. (#24)allow_otheroption forselect/radio/checkboxfields — renders an extra “Other” option with a companion free-text input.FormBuilder.merge_other_params/2resolves the UI sentinel ("__other__") into the typed value before validation on every write path (adminDataForm, public entity form, and the new component); stored data stays flat and backward-compatible.FieldTypes.allow_other?/1tolerates bothtrueand"true"(HTML checkbox params). (#24)PhoenixKitEntities.Components.LiveDataForm— embeddable statefulLiveComponentfor viewing/editing oneEntityDatarecord’s fields outside the admin::editmode with debounced autosave and an optional submit button,:readonlymode with static output. The host LiveView owns loading, PubSub, and status semantics; the component reports{:live_data_form, :saved | :submitted, record}messages. Renders DB-free whenrecord.entityis preloaded. (#24)EntityData.update/3gains two opt-in options, both defaulting to current behavior:activity_log: false(skip the per-save activity row for high-frequency callers likeLiveDataFormautosave) andrequire_status: [statuses](re-reads the record underSELECT ... FOR UPDATEinside the update transaction and refuses the write unless the fresh status is in the list — closes a cross-session race where a stale:editview could write into a record another session had just transitioned). (#24)FormBuilder.build_fields/3accepts an opt-inid_prefix, giving per-record DOM id scoping when several forms of the same entity render on one page (e.g.LiveDataFormused once per record in a list). Default output is unchanged. (#24)- Display-only field-definition translations: a field definition may carry an optional
"translations"key (per-languagelabel/option overrides).FormBuilder.translated_label/2andFormBuilder.translated_option_label/3resolve them for display only — validation and stored values always use the canonical strings. Resolved bybuild_field/3(labels + choice-option text) and byLiveDataFormin both modes. Not yet resolved by the adminDataFormor the public entity form (documented scope boundary). (#24)
Fixed
EntityData.changeset/2now validatesradioandcheckboxvalues against the field’soptions(previously onlyselectwas checked), rejects the__other__sentinel unconditionally, rejects a scalar where a checkbox list is expected, and treats[]as a missing value for required checkbox fields. (#24)EntityData.update/3’sactivity_log: falseoption was only wired into the success path — a failed save (e.g.LiveDataFormautosaving against an entity with an unfilled required field, which re-validates on every debounced keystroke) still inserted adb_pending: trueactivity row every time, reopening the exact “one row per keystroke” flood the option exists to prevent. The error path now respects the same opt. (#24 follow-up)- The entity changeset’s field-type whitelist is now derived from
FieldTypes.list_types/0instead of a hand-maintained list, which had already drifted from the real type registry. (#24) - Removed a stale duplicate
mix.lockentry (beamlab_ex_aws_sqs4.0.0, orphaned by thephoenix_kitbump below, which re-aliases the same package under theex_aws_sqsapp name at 5.0.0) that brokemix deps.unlock --check-unused(i.e.mix precommit) onmain.
Changed
- Dependency lockfile bumps:
phoenix_kit1.7.189 → 1.7.210,phoenix_live_view1.2.6 → 1.2.7,etcher0.7.2 → 0.9.0,fresco0.8.0 → 0.10.0,mdex0.13.3 → 0.13.4,mdex_native0.2.5 → 0.2.6,ex_ast0.12.9 → 0.13.1,hackney4.5.2 → 4.6.0,beamlab_countries1.0.8 → 1.1.0,mint1.9.1 → 1.9.3,req0.6.2 → 0.6.3,tessera0.3.2 → 0.3.4,plug_crypto2.1.1 → 2.2.0,lazy_html0.1.11 → 0.1.12,earmark_parser1.4.45 → 1.4.46,elixir_make0.9.0 → 0.10.0,quic1.7.0 → 1.7.1,glob_ex0.1.11 → 0.1.12; addedex_aws_sqs(viabeamlab_ex_aws_sqs5.0.0).
Entities 0.2.8. Install or update: {:phoenix_kit_entities, "~> 0.2"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.