Skip to content

Catalogue 0.1.3: Markup pricing, item search and a card view

Catalogue 0.1.3 adds pricing with a catalogue markup, a search over items, and a card view for the admin lists. Deleting now asks for confirmation in a dialog.

What’s new

  • An item’s price is now its Base Price, “Cost/purchase price before catalogue markup.” A catalogue gets a Markup Percentage (0 to 1000), and its item tables show the computed Price next to the base price.
  • The Catalogues tab can search items across all catalogues, and a catalogue’s page searches its own items by name, description or SKU.
  • Every list can switch between a table and a card layout, remembered in the browser. On small screens row actions fold into a menu.
  • Delete and Delete Forever open a confirmation dialog instead of an inline step that did not work.
  • Restoring an item also restores its deleted category and catalogue. Reordering categories can no longer leave two in the same place, and a failed manufacturer and supplier link now shows a warning.

Upgrading

The item column price becomes base_price and catalogues get markup_percentage, both from PhoenixKit core’s migrations: update PhoenixKit and run mix phoenix_kit.update first. The package now needs Phoenix LiveView 1.1.

Full release notes: Catalogue 0.1.3

0.1.3 · 31 March 2026

Added

  • Pricing system — rename price to base_price on items, add markup_percentage to catalogues (default 0%), computed sale price via Item.sale_price/2 and Catalogue.item_pricing/1
  • Search — search_items/2 for global cross-catalogue search, search_items_in_catalogue/3 for catalogue-scoped search, search_items_in_category/3 for category-scoped search; matches name, description, SKU via case-insensitive ILIKE with special character sanitization
  • Reusable components (PhoenixKitCatalogue.Web.Components):
    • item_table/1 — configurable data-driven table with selectable columns, opt-in actions, card view toggle
    • search_input/1 — search bar with debounce and clear button
    • search_results_summary/1 — result count display
    • empty_state/1 — centered empty state card
    • view_mode_toggle/1 — global table/card toggle syncing multiple tables via shared storage key
  • Card view — all tables (catalogues, manufacturers, suppliers, items) support table/card view toggle with localStorage persistence; card titles are clickable links
  • Inline actions — table row actions render as inline buttons on desktop, collapse to dropdown menu on mobile (via table_row_menu mode="auto")
  • Catalogue.swap_category_positions/2 — atomic position swap in a transaction
  • Catalogue.list_items/1 — global item listing with status filter and limit
  • Catalogue.item_count_for_catalogue/1 and category_count_for_catalogue/1 — active counts
  • Gettext localization — all component text (column headers, actions, tooltips, result counts) localizable via PhoenixKit’s Gettext backend
  • Graceful error handling — components never crash; unknown columns, unloaded associations, nil values, and bad path functions produce “—” placeholders and Logger warnings
  • All item list/search functions now consistently preload category: :catalogue and :manufacturer

Fixed

  • Category reorder now atomic (wrapped in transaction instead of two separate updates)
  • sync_manufacturer_suppliers/2 and sync_supplier_manufacturers/2 now return {:ok, :synced} or {:error, reason} instead of silently swallowing errors
  • restore_item/1 now cascades upward to both parent category AND parent catalogue (was only restoring category)
  • deleted_item_count_for_catalogue/1 uses single JOIN query instead of two separate queries
  • Removed misleading list_uncategorized_items_for_catalogue/2 (ignored catalogue param), replaced with list_uncategorized_items/1
  • Confirm-delete flows use modal dialogs instead of broken inline two-step pattern
  • Forms use action="#" to prevent HTTP POST fallback before LiveView connects
  • Added :phoenix_kit to extra_applications for module discovery

Changed

  • All LiveViews migrated to use PhoenixKit core components (table_default, table_row_menu, status_badge, admin_page_header, confirm_modal, icon)
  • Removed all inline HTML tables, SVG icons, and local badge/format helpers in favour of shared components
  • Manufacturer/supplier form save flows now handle sync errors with warning flash messages

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