Skip to content

Catalogue 0.37.0: Item selector picks arrive in catalogue order

Catalogue 0.37.0 changes the order in which the item selector hands its picks to the page that opened it: they now arrive in the catalogue’s own order, so a host app no longer has to sort them itself.

Picks in catalogue order

When someone confirms a selection in the item selector, the picks are now sorted the way the catalogue is arranged in Manual order. Catalogues come first by their position, then the category path from the catalogue’s top down to each pick’s category. A category’s own items come before those of its subcategories, and a catalogue’s items without a category come after all its categorized ones. Within that, items follow their own position, then name.

An admin’s own sort choice for the tiles never changes this order; it only matches what the tiles show under the default Manual sort. The tray inside the selector still lists items in the order they were clicked, like a cart.

One case is not covered: a selector limited to categories only, whose categories belong to several catalogues. The selector shows no tree for it either. Pass the catalogues as well to get the tree order.

Fixes

  • A pick from a subcategory the tiles never showed, reached through a narrow category scope, no longer lands first with an empty path.
  • An item without a position now sorts last, as in the manual order, instead of first.
  • Two catalogues with the same position and name now deliver their picks as one block each instead of mixing them.

Upgrading

No migration and no change in requirements. Update the dependency. If your app sorted the selector’s picks itself, it can stop; if it relied on click order, sort them again on your side.

Full release notes: Catalogue 0.37.0

0.37.0 · 17 September 2026

Review: dev_docs/pull_requests/2026/125-picks-in-catalogue-order/.

Changed

  • ItemSelectorModal Confirm picks arrive in the catalogue’s own manual order (#125), not the order the user clicked or typed a quantity in: catalogue {position, name, uuid}, then the category path from that catalogue’s root down to the pick’s own category ({position, name} per hop) — a category’s own items before its subcategories’, recursively — then that catalogue’s uncategorized picks after all of its categorized ones, and finally the item’s own position (a null one last), name and uuid. An admin’s tile-sort preference never changes it; it only happens to match what the tiles show under the default Manual sort. The tray keeps click order, as a cart should. Hosts no longer need to re-sort picks themselves.
  • One scope shape is outside that guarantee and now says so in the moduledoc: a scope naming only categories (catalogue_uuids: nil) whose categories span several catalogues. The popup draws no tree for it either; pass the catalogues in :catalogue_uuids as well to get the tree order.
  • Browse.present_items/2 carries catalogue_uuid, category_uuid and position on every presented item. No component renders them — they are what the pick order is computed from.
  • Dependency bumps: phoenix_kit 2.28.2, phoenix_kit_ai 0.23.1 and tessera 0.3.7.

Fixed

  • A pick whose category the tiles never showed — a narrow category_uuids scope reaching a subcategory through subtree expansion — no longer falls out of the sort index and lands first as an empty path (#125).
  • An item whose position is NULL now sorts LAST in the confirm payload, the way the manual order has it (asc: i.position, Postgres ASC being NULLS LAST), instead of first.
  • Two catalogues tied on both position and name now deliver their picks as one block each instead of interleaving them position by position, matching the uuid tie-break the manual order already carried.

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