Skip to main content
Version: 1.0

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​

Recipe catalog

Parameters​

There is a single catalog entry point. You choose the starting page with route.

ParameterTypeRequiredDefaultWhat it does
routeFeatureRoute.CatalognoFeatureRoute.Catalog.Home()Which catalog surface to open first (home, category, favorites, …).
navigationCallbackCatalogNavigationCallbackyes—How Mealz hands control back to your app (login, store, cart, exit, optional home).
modifierCompose Modifiernofills max sizeLayout (Compose / KMM).
stateContentscreen state overlaysnolibrary defaultOptional loading / error UI while the WebView boots.

FeatureRoute.Catalog variants​

RouteParametersUse when
Home(displayVariant?)optional recipe-card variantDefault catalog landing (categories).
Category(categoryId, title, displayVariant?)Mealz category id + title shown in UIDeep-link / open one category.
List(displayVariant?)—Recipe list (e.g. search results shell).
MySpace(defaultSelectedTab?, displayVariant?)MySpaceTab.Favorites or HistoryMy 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.

iOS naming

Nested Kotlin route types flatten in Swift: FeatureRoute.Catalog.Home → FeatureRoute.Catalog.CatalogHome, MyMeals → CatalogMyMeals, etc. See the iOS inject sample below.

CatalogNavigationCallback​

CallbackRequiredWhat you must do
redirectToLogInyesOpen your login when Mealz needs an authenticated user.
redirectToStoreLocatoryesOpen your store picker when no store is selected (retailer).
exitnoDismiss / pop the Mealz catalog screen. Defaults to a no-op.
redirectToCartnoOpen your retailer cart / checkout. Defaults to null.
goToHomeCatalognoOpen 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.Favorites
  • FeatureRoute.Catalog.MySpace
  • FeatureRoute.Catalog.MyMeals
  • FeatureRoute.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: