Catalog
The catalog is a WebView journey driven by FeatureRoute.Catalog. Host UX (categories, preferences, favorites entry points, basket CTA, …) matches Mealz SSR.
Visual Overview
Parameters
There is a single catalog entry point. You choose the starting page with route.
| Parameter | Type | Required | Default | What it does |
|---|---|---|---|---|
route | FeatureRoute.Catalog | no | FeatureRoute.Catalog.Home() | Which catalog surface to open first (home, category, favorites, …). |
navigationCallback | CatalogNavigationCallback | yes | — | How Mealz hands control back to your app (login, store, cart, exit, optional home). |
modifier | Compose Modifier | no | fills max size | Layout (Compose / KMM). |
stateContent | screen state overlays | no | library default | Optional loading / error UI while the WebView boots. |
FeatureRoute.Catalog variants
| Route | Parameters | Use when |
|---|---|---|
Home(displayVariant?) | optional recipe-card variant | Default catalog landing (categories). |
Category(categoryId, title, displayVariant?) | Mealz category id + title shown in UI | Deep-link / open one category. |
List(displayVariant?) | — | Recipe list (e.g. search results shell). |
MySpace(defaultSelectedTab?, displayVariant?) | MySpaceTab.Favorites or History | My Space with optional default tab. |
Favorites(displayVariant?) | — | Favorites as root (wraps My Space favorites). |
History(displayVariant?) | — | Order History as root. |
MyMeals(showTabSelector, defaultSelectedTab?, basketTransferUrl?) | see My Meals (Catalog journeys below) | Meals / products in basket. |
displayVariant (optional Int) selects the recipe-card visual variant inside catalog lists where supported.
Nested Kotlin route types flatten in Swift: FeatureRoute.Catalog.Home → FeatureRoute.Catalog.CatalogHome, MyMeals → CatalogMyMeals, etc. See the iOS inject sample below.
CatalogNavigationCallback
| Callback | Required | What you must do |
|---|---|---|
redirectToLogIn | yes | Open your login when Mealz needs an authenticated user. |
redirectToStoreLocator | yes | Open your store picker when no store is selected (retailer). |
exit | no | Dismiss / pop the Mealz catalog screen. Defaults to a no-op. |
redirectToCart | no | Open your retailer cart / checkout. Defaults to null. |
goToHomeCatalog | no | Open catalog home when a catalog sub-feature (opened as root) asks to leave for the main catalog. See below. |
Why goToHomeCatalog?
This callback can look odd when you open FeatureRoute.Catalog.Home() — you usually leave it null. It exists for the case where you mount the catalog entry on a dedicated sub-feature as the root screen, for example:
FeatureRoute.Catalog.FavoritesFeatureRoute.Catalog.MySpaceFeatureRoute.Catalog.MyMealsFeatureRoute.Catalog.History
Those surfaces can still request navigation to the main catalog home from inside the WebView (empty states, CTAs, …). Classic example: My Space / Favorites with no liked recipes — the UI offers a way to browse the catalog; your host should then open Catalog.Home (or your equivalent home route).
Wire goToHomeCatalog only when that sub-feature is presented as root (not already nested inside a full catalog journey that can navigate home itself). If unset, Mealz falls back to an in-WebView redirect to catalog home when possible.
Inject
CatalogScreen(
route = FeatureRoute.Catalog.Home(),
navigationCallback = CatalogNavigationCallback(
redirectToLogIn = { /* open login */ },
redirectToStoreLocator = { /* open store picker */ },
exit = { /* pop / dismiss */ },
redirectToCart = { /* open retailer cart */ },
goToHomeCatalog = { /* optional: open Catalog.Home when Favorites/My Space/… is root */ },
)
)
Catalog Journeys
Same entry point — only route changes: