Skip to content

Catalogue 0.26.0: One sort order for the admin, the picker and the embed

Catalogue 0.26.0 makes the item picker popup and the catalogue browse embed list items in the same order as the admin pages, and fixes date columns that sorted days before months.

One shared sort

The item picker and the browse embed used their own fixed order. They now follow the sort set in the catalogue admin: item lists, category tiles, catalogue tiles and the embed’s category chips all use it. A live search still lists results by name, as the admin’s own search does. If the sort setting can’t be read, the picker falls back to Manual order instead of failing to open.

Date sorting

Sorting by Updated or Created compared the dates field by field, with the day before the month, so 2 January came after 1 February. This is fixed in the catalogue, supplier, manufacturer and attribute group tables, in the categories on a catalogue’s page, and when items are reordered by creation date. That last one saved the wrong order as the items’ positions; reorder again to put it right.

Upgrading

No migration and no configuration. Update the dependency. Pickers and embeds will change order if the admin sort is not the default.

Full release notes: Catalogue 0.26.0

0.26.0 · 1 September 2026

Added

  • One shared sort for the whole module (#94) — the item-selector popup and the CatalogueBrowse embed now order by the same catalogue_sort_* settings the admin pages sort by, instead of their own hardcoded order. BrowseState gained an :order ({field, :asc | :desc}, fixed at init like the scope and validated against the sortable :detail_items column ids), Browse.global_items_order/0 and Browse.global_categories_order/0 read the shared settings, and the popup’s listings, category tiles, catalogue tiles and the embed’s chip row all follow. A live search stays name-ordered, which is what the admin’s own search does.
  • Directional item orders in Catalogue.search_items/2 (#94) — order: {field, dir} for name / sku / base_price / status reproduces the admin’s item_order_by/3 chain, uuid tie-break included, so browse paging stays deterministic. order: {:position, _} folds into the existing category-position chain and ignores the direction, like the admin’s Manual sort.

Fixed

  • Date columns sorted structurally, not chronologically (#94) — Enum.sort_by/2‘s default term order compares DateTime structs field-alphabetically (day before month), so Updated / Created sorts put Jan 2nd after Feb 1st. Fixed in the catalogues, suppliers, manufacturers and attribute-groups tables (TableConfig), in the detail page’s categories sort, and — found in the post-merge review — in Catalogue.reorder_items_by/4’s :created_asc / :created_desc strategies, the one place that persists the wrong order into position.
  • A settings failure no longer crashes the selector popup (#94) — the shared-sort read is a Settings (database) call that landed outside ItemSelectorModal‘s tree-degradation guard. It now falls back to Manual ({:position, :asc}, the scope’s own default) and logs, keeping the popup’s “tiles are navigation, not data” contract.

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