Per-user table view config (columns / sort / filters / view mode) for the
catalogue admin tables. Stored in phoenix_kit_users.custom_fields under
the "catalogue_view_configs" key — no dedicated table. Precedent:
PhoenixKit.Notifications.Prefs.
Global sort
For scopes in @global_sort_scopes the SORT half of the config is not
per-user: it lives in a module setting (catalogue_sort_<scope>), so every
admin sees the same ordering — when one of them switches the catalogues
index to "Manual order" and drags rows, everyone else is looking at that
same order (the live half rides Catalogue.PubSub; see
broadcast_view_sort_changed/4 and CataloguesLive.put_cfg/3).
load/2 overlays the global value over whatever the user row stored, so
the per-user copy is inert for these scopes. Columns / filters / view mode
stay per-user everywhere.
Summary
Functions
The shared sort for a global-sort scope: the catalogue_sort_<scope>
setting ("<column>:<asc|desc>"), falling back to the scope's default
when unset or when it names a column that is no longer sortable.
Functions
@spec defaults(PhoenixKitCatalogue.Web.TableConfig.scope()) :: map()
@spec global_sort?(PhoenixKitCatalogue.Web.TableConfig.scope()) :: boolean()
@spec load(map() | nil, PhoenixKitCatalogue.Web.TableConfig.scope()) :: map()
@spec load_global_sort(PhoenixKitCatalogue.Web.TableConfig.scope()) :: {String.t(), :asc | :desc}
The shared sort for a global-sort scope: the catalogue_sort_<scope>
setting ("<column>:<asc|desc>"), falling back to the scope's default
when unset or when it names a column that is no longer sortable.
@spec normalize(PhoenixKitCatalogue.Web.TableConfig.scope(), map()) :: map()
@spec save(map() | nil, PhoenixKitCatalogue.Web.TableConfig.scope(), map()) :: {:ok, map()} | {:error, term()}
@spec save_global_sort( PhoenixKitCatalogue.Web.TableConfig.scope(), String.t(), :asc | :desc ) :: {:ok, term()} | {:error, term()}
@spec scope_key(PhoenixKitCatalogue.Web.TableConfig.scope()) :: String.t()