Skip to content

Catalogue 0.1.12: Tabs and metadata for catalogues, images for categories

Catalogue 0.1.12 gives the catalogue form the same Details, Metadata and Files tabs as the item form, adds metadata fields for catalogues, and lets a category have a featured image.

Catalogue form

The featured image and attached files move to the Files tab. The Metadata tab offers five fields for a catalogue: Brand, Collection, Season, Region and Vendor Reference. Blank values are dropped on save. Switching tabs keeps what has been typed, including other languages, and Save works from any tab.

Category image

The category form gets a featured image card, “Shown on category landing pages.” A category has no file list, only the one image, and its storage folder is created the first time an image is picked.

Items keep their seven metadata fields as before; the metadata editor now looks the same on items and catalogues.

Upgrading

No migration: the new values are stored in the existing data column of each record. Code that used the PhoenixKitCatalogue.ItemMetadata module from 0.1.11 must switch to PhoenixKitCatalogue.Metadata and pass :item to definitions/1.

Full release notes: Catalogue 0.1.12

0.1.12 · 24 April 2026

Added

  • Catalogue form tabs — CatalogueFormLive gains Details / Metadata / Files tabs (mirrors ItemFormLive). Featured image + attached files live under the Files tab; metadata under Metadata. Panels stay in the DOM (toggled via hidden) so multilang state and in-progress input survive tab switches. Save sits outside the tab panels and works from any tab.
  • Catalogue metadata — Metadata.definitions(:catalogue) ships five opt-in fields (brand, collection, season, region, vendor_ref) stored under catalogue.data["meta"].
  • Category featured image — CategoryFormLive gains a featured-image card (no tabs, no file grid; a category is a taxonomy node). Attachments.folder_name_for/1 picks up a %Category{} clause (catalogue-category-<uuid>). Folders are created lazily on first picker open, so categories without a featured image never materialize one.
  • Components.featured_image_card/1 — shared featured-image card (thumbnail + name + size, or dashed empty state with primary button) used by catalogue / category / item forms.
  • Components.metadata_editor/1 — shared metadata tab body (per-key text input + remove button + add-picker dropdown; legacy keys render disabled with a “Legacy” pill).

Changed

  • PhoenixKitCatalogue.ItemMetadata → PhoenixKitCatalogue.Metadata with resource-type-scoped definitions/1. Items keep color / weight / width / height / depth / material / finish; catalogues get the five new keys above. Upstream consumers of the ItemMetadata module (introduced in 0.1.11) need to update the alias and pass :item to definitions/1.
  • Extracted the three-phase form helpers — Metadata.build_state/2, absorb_params/2, inject_into_data/3 — out of ItemFormLive and into the shared module so CatalogueFormLive uses the same plumbing (~150 lines of duplication removed across the three form LVs).

Notes

  • No migrations. All three schemas (Item, Catalogue, Category) already carry JSONB data; featured_image_uuid, files_folder_uuid, and meta all live under that column.
  • 27 unit tests for the pure Metadata helpers + 7 component-render tests for featured_image_card/1 and metadata_editor/1.

Catalogue 0.1.12. Install or update: {:phoenix_kit_catalogue, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.