Skip to content

Catalogue 0.25.0: Catalogue-first browsing in the picker and photo ordering

Catalogue 0.25.0 reworks how the item picker popup moves through catalogues, lets admins drag a record’s photos and files into order, and lets the catalogue list search items as well as catalogues.

Browsing in the item picker

When the picker covers several catalogues, it now opens with one tile per catalogue. Choosing one shows its top categories and its Uncategorized items, and Back climbs back up. A header names the level you are in. A picker limited to one category opens inside it. At the top level the picker shows the categories only; items appear once you enter a level or search.

Picking is quicker to read: a row is marked as selected as soon as a quantity is typed, and only when the server would accept it. When a quantity column is shown, the checkbox is the one sign of selection and the quantity is shown read-only, in the table and in the card view.

Fee items in smart catalogues no longer look free. A fee without its own price shows its flat amount as the price, its percentage, or Computed.

Photo and file order

On the catalogue, category and item forms, photos and files can be dragged into order. The order is saved with the form and used by the product card’s photo carousel and file list.

Admin lists

The catalogue list’s search now finds catalogues and items together, so the switch between the two is gone: matching catalogues come first, then matching items, and an item opens its edit page. The catalogue page drops the same switch. Switching language keeps the category and search you were in, and catalogue and category thumbnails link to their record.

Fixes

  • Item names in the picker and browse lists were never translated. They now follow the item’s translation, and an empty translation no longer blanks a name.
  • Browse lists that span several categories now keep the admin’s order: by category first, then by item.
  • The item picker uses the page’s language instead of always English.
  • A scope that names categories but no catalogue now shows its subcategory tiles.

Upgrading

No migration. The module’s JavaScript hooks (picker keyboard keys, the instant selection highlight, automatic loading) are colocated hooks, and until now they never reached the browser. Import them in assets/js/app.js with import {hooks as catalogueHooks} from "phoenix-colocated/phoenix_kit_catalogue" and add catalogueHooks to the LiveSocket hooks. Without that the components still work, without those extras.

Full release notes: Catalogue 0.25.0

0.25.0 · 31 August 2026

Added

  • Catalogue-first drilling in the item selector (#90) — a scope naming several catalogues now lists them as tiles at the root; choosing one lands on that catalogue’s own level (its top categories, its Uncategorized bucket) and Back climbs the same chain. BrowseState gained {:set_catalogue, uuid | nil}, membership-checked against scope.catalogue_uuids like every other narrowing, and only accepted when the scope actually offers several.
  • Smart-catalogue fees are presented instead of blank (#90) — Browse.smart_fee/1 resolves a fee item with no intrinsic price to {:price, decimal} (a standalone flat fee IS the price), {:note, "12%"}, or a localized Computed. Presented maps carry a :fee_note, the confirm payload carries it too, and the product card’s Price row falls back to it — so a percent-fee pick no longer arrives indistinguishable from a free item.
  • Drag-reorder for a resource’s photos and files (#90) — the attachments grid is a draggable_list; the order persists at save in data["media_order"] and drives the product card’s carousel and file list. Attachments.apply_media_order/2 and handle_reorder_files/2 are shared by the catalogue, category and item forms.
  • A live context header in the item selector (#90) — the header names the level being browsed (drilled category, chosen catalogue, the Uncategorized bucket) and carries the Back button, replacing the in-list Up.
  • Instant selection feedback (#90) — a colocated QtySignal hook flips data-selected on keystroke, mirroring the server’s accept set (select_floor / zero_deselects) so a value the server will reject never previews as selected. Rows and cards style off data-selected, and the browse surfaces use phx-click-loading for click feedback.
  • show_photo and photo_asset_type on <.item_picker> (#91) — show_photo={false} suppresses the real thumbnail for every selected item (the clickable placeholder stands in), and photo_asset_type chooses the Storage variant. Both default to the previous behaviour.
  • inline_qty and root_switcher opt-ins on the item selector (#90) — see Changed; both restore behaviour that stopped being the default.

Changed

  • The item selector’s root is just a level (#90) — with categories it lists the outline and does not even fetch page 1; items come from entering a level or searching. The Categories | Items switcher is now opt-in via root_switcher: true.
  • Click flavour with a visible :qty is either-or (#90) — the leftmost checkbox is the one selected signal and the quantity cell shows the picked amount read-only. inline_qty: true restores the legacy checkmark-plus- stepper pairing.
  • A scope naming exactly one category opens standing in it (#90) — its child tiles and its own directly-filed items, with Back hidden at that floor.
  • The catalogue index searches items alongside catalogues (#90) — the Catalogues | Items search-mode switcher and its ?mode= URL state are gone; matching catalogues stay on top as navigation with matching items underneath, and an item result opens that item’s edit page. The catalogue detail page’s equivalent switcher is retired the same way.
  • Language switching keeps your place (#90) — both index and detail LiveViews publish the full current URL as url_path, so core’s language switcher no longer drops the drilled category and query.
  • Featured thumbnails enter their record (#90) — catalogue and category thumbnails on the admin tables are links, like their names.
  • item_picker follows the process locale (#90) — a host that passes no :locale (or an explicit nil) gets Gettext.get_locale/1 instead of a hardcoded "en", so the dropdown, breadcrumbs and product card stop being English on localized pages.

Fixed

  • Browse listings read in the admin’s document order (#90, corrected post-merge) — search_items/2 accepts order: :position, and it now uses search_items_in_catalogue/3‘s chain (category position first, then the item’s own). Leading with the item’s raw position alone interleaved the per-category ordinals for any listing spanning several categories — which is every CatalogueBrowse level, since BrowseState’s default drill is :subtree.
  • The card view shows the picked quantity too (#90, post-merge) — the read-only amount in the click-without-inline_qty flavour had reached the table row only, so a preselection at another quantity was invisible one view toggle away.
  • List names were never translated (#90) — Browse.present_items/2 read a bare "name" key instead of the multilang "_name" the editor writes. All the ad-hoc translation chains across the picker, selector, browse and product card now route through the presence-guarded Catalogue.translated_name/2 / translated_description/2, so a stored blank override can no longer blank a display name.
  • Subcategory tiles were missing for category-only scopes (#90) — a scope passing category_uuids without catalogue_uuids fell through to the empty tree. The catalogue is now derived from the scoped categories for the tree only; the browse scope and every fetch stay exactly what the host passed. A tree-build failure is logged instead of degrading silently.
  • A whitespace-only query counted as a search (#90) — the fetch layer trims it to no filter, so BrowseState and the level-navigation gates now agree it is no search, instead of flipping a :direct level to subtree listing while hiding the level nav.
  • A crafted cross-catalogue browse_category is refused (#90) — under the catalogue-first drill it would have produced a contradictory dead-end level.
  • The auto-load sentinel pushed to the host LiveView (#90) — replaced with a colocated hook that pushes through its own phx-target, so it works on every published core instead of crashing hosts without a load_more clause.
  • item_picker placeholder sizing and alt text (#91) — the placeholder box now matches the image box at every photo_size, and both thumbnail branches carry the item’s display name as alt instead of "".

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