Skip to content

Catalogue 0.1.15: Drag and drop to reorder catalogues, categories and items

Catalogue 0.1.15 lets admins put catalogues, categories, items and smart catalogue rules in order by dragging them, instead of clicking move up and down one step at a time.

Each row gets a handle, Drag to reorder (for categories, Drag to reorder (among siblings)). The catalogues list, the categories of a catalogue and the items in a category can all be dragged, and so can the rules on a smart item. An item can be dragged into another category of the same catalogue; dropping it into another catalogue is refused with “Items can only be moved within the same catalogue.” If saving the new order fails, the page says Failed to save the new order. The old Move up and Move down buttons for categories are gone.

The global search orders results by name again, since positions only mean something inside one catalogue.

Full release notes: Catalogue 0.1.15

0.1.15 · 2 May 2026

Added

  • Drag-and-drop reorder — catalogues, categories, items, and smart-rule rows can be reordered via DnD. Position writes use a two-pass (negative-then-positive) strategy to avoid unique-index collisions. Cap enforced via Application.compile_env(:phoenix_kit_catalogue, :reorder_max_uuids, 1000).
  • reorder_categories_groups/3 — atomic reorder across multiple parent groups in a single outer transaction (cross-parent partial-commit protection).
  • Helpers.dedupe_keep_last/1 — shared last-wins deduplication for DnD payloads, replacing ad-hoc Enum.uniq calls.

Changed

  • Audit-trail integrity on cross-category item moves — rejection and DB-error log rows from reorder_items/4 inside move_item_and_reorder_destination/4 now survive outer-transaction rollbacks (split into unlogged inner + logged outer).
  • refresh_card_items/3 — gains explicit delta param (default 0). In-scope reorder no longer inflates the limit by +1 on every drag.
  • @reorder_max_uuids consolidated to Application.compile_env/3 — single config source shared by Catalogue and Rules.
  • Global search_items/2 order_by — reverted to name + uuid only. position is per-scope and meaningless across catalogues; catalogue-scoped search keeps it.

Fixed

  • Duplicate list_catalogue_rules query on smart-item mount eliminated — single fetch derives both working_rules and rule_candidate_order.
  • Smart-rule DnD now uses dedupe_keep_last (last-wins) matching catalogue/category/item reorder semantics.

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