Catalogue 0.4.0: Item picker display options and a clear PDF queue error
Catalogue 0.4.0 gives the single-item picker four new display options, and stops PDF uploads from waiting forever when the extraction queue isn’t running.
Item picker options
For developers who embed <.item_picker>, four new options all keep the old behaviour by default:
show_unitshows each item’s unit next to its price in the dropdown.format_unitsets how a unit is written, likeformat_pricedoes for prices.highlight_selected={false}drops the coloured border on a picker that always has a value.initial_queryfills the search field and shows matching results once when the picker first appears, without overwriting a real choice or text being typed.
Unit short forms such as pc, m² and rm now come from one shared list, so the item table and the picker always agree. A scope of nil for categories or catalogues, meaning all of them, no longer causes a warning.
PDF extraction queue
When the catalogue_pdf Oban queue is not running, a PDF upload no longer piles up jobs that never run. The extraction is marked as failed at once, with a message that says to add catalogue_pdf to the Oban queues: config or run mix phoenix_kit.update and then upload again. The activity log records it too.
Upgrading
No migration and no change in requirements. Update the dependency. If PDF uploads now fail with the queue message, add the catalogue_pdf queue to your Oban config.
Full release notes: Catalogue 0.4.0
0.4.0 · 30 May 2026
Added
- ItemPicker display options (#29) — four backward-compatible attrs on
<.item_picker>and the underlyingItemPickerLiveComponent, all defaulting to current behaviour:show_unit(opt-in; render the item’s measurement unit beside the price in each dropdown row),format_unit(1-arityunit -> labelfunction, mirroringformat_price; defaults to the shared abbreviation map, return""to omit),highlight_selected(defaulttrue; passfalseto drop theinput-primaryborder on always-rendered pickers), andinitial_query(optional seed string that prefills the search input and opens matching results once on first render, never clobbering a real selection or mid-typing query).
Changed
ItemPickercategory_uuids/catalogue_uuidsattrs relaxed from:listto:anyso callers can pass an explicitnil(the documented “all categories” scope) without a Phoenix attr-type warning.- Unit-abbreviation labels (
piece→pc,m2→m²,running_meter→rm, …) are now centralised inPhoenixKitCatalogue.Schemas.Item.unit_label/1— a single source of truth shared by the items table and the item picker, instead of two divergent copies.
Fixed
- PDF extraction enqueue refuses to enqueue when the
:catalogue_pdfOban queue isn’t running (not configured, or Oban not started). Instead of piling up never-processed jobs it flips the extraction to a terminal failed status with an actionable message + activity row.
Catalogue 0.4.0. Install or update: {:phoenix_kit_catalogue, "~> 0.4"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.