Repository navigation
feat(categories): nested store and menu categories - #82
Merged
Merged
Conversation
Storefront nests product and catalog categories up to three levels (Drinks › Coffee › Cold brew); each category carries its parent. - Store page: top-level categories are the tabs; each section loads its products once (the API rolls up the subcategories' products, replacing one query per category) and shows them in headings by subcategory, with chips to jump to a subcategory. A link to any category opens its heading. - Category list: top-level rows with their subcategories as pills; a pill opens that subcategory on the store page. - Search chips list top-level categories only. - Truck menus: tabs by top-level menu category, subcategory headings inside; the trucks map's category tiles are top-level only; truck search also matches the top-level category. Against an API without parents every category is at the top, as before.
This was referenced Oct 15, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The app side of nested categories (fleetbase/storefront#156). Storefront now nests product and catalog categories up to three levels, for example Drinks › Coffee › Cold brew. Every category carries its
parent(public id), andproducts?category=returns a category's products together with those of every category under it.Changes
src/commerce/categories.ts: builds the tree from the flat list, withcategoryIndex,ancestorAt,descendantIdsandgroupByCategory.NetworkStoreScreen):categoryIdlinks resolve at any level.StoreCatalogScreen): top-level rows with their subcategories as pills. A pill now opens that subcategory's heading, where before it opened the parent's section.StoreSearchScreen): the chips show top-level categories only.truckCategorieslists top-level menu categories only;truckProductsgives each product's top-level category and its place below it;TruckMenuScreenuses tabs for top-level categories, with subcategory headings inside;Compatibility
Against an API without
parent, every category is top-level and the screens behave as before. The catalog list still reads a category'ssubcategorieswhen an older API lists them.Tests
__tests__/commerce/categories.test.ts(6 tests): the tree, SDK resources, loops,ancestorAtand grouping.__tests__/commerce/food-trucks.test.ts: menus offer top-level categories only, and products carry their place in the menu.jest: 46 suites, 302 tests passed.eslinton the changed files: no errors. The warnings are inline styles, matching the surrounding code.tsc: no new errors. The one error inNetworkStoreScreen(line 435,formatCurrency) is already on the base branch.Not run on a device or simulator.