Skip to content

Support for nested crafting categories (Upstream PR #8059) #89

@ushkinaz

Description

@ushkinaz

Summary

Implement support for nested crafting categories as introduced in upstream PR #8059. This includes data layer updates to handle the new nested_category type and UI changes to maintain parity with the game's hierarchical crafting organization and subcategory display.

Categorization

enhancement, logic, data parsing

Context

  • src/data.ts: Data loading and indexing logic.
  • src/types.ts: Type definitions for recipes and categories.
  • src/types/Recipe.svelte: Recipe detail rendering.
  • src/types/Item.svelte: Item detail rendering (breadcrumb).
  • src/types/item/Recipes.svelte: Recipe listing and indexing.

Impact

The wiki will stay synchronized with the latest C-BN data structure. Users will benefit from better-organized crafting information and a UI that matches the in-game experience (e.g., "Category / Subcategory" labels).

Severity

Medium

Tech details

  • Implement NestedCategory type in src/types.ts.
  • Update CBNData in src/data.ts to index nested_category objects even though they lack a result field.
  • Modify Recipe.svelte to render nested category children and handle entries without components/tools.
  • Update Item.svelte and Recipe.svelte to display hierarchical category information (e.g., FOOD > SNACKS > SANDWICHES).
  • Update recipe indexing in src/types/item/Recipes.svelte to surface recursive relationships in nested categories.

Examples

PR #8059 introductes FOOD > SNACKS > SANDWICHES hierarchy.
Example nested category object:

{
  "type": "nested_category",
  "id": "hot_drinks",
  "nested_name": "hot drinks",
  "category": "CC_FOOD",
  "subcategory": "CSC_FOOD_DRINKS",
  "description": "Warm beverages and infusions.",
  "nested_category_data": ["coffee", "tea", "herbal_tea"]
}

Acceptance criteria

  • nested_category objects are correctly parsed and indexed.
  • Item/Recipe pages show full category + subcategory breadcrumbs/labels.
  • Nested categories correctly list their children in the UI.
  • Logic stays robust across standard recipe and nested category entries.

Dependencies

Blocked by: cataclysmbn/Cataclysm-BN#8059

Metadata

Metadata

Assignees

No one assigned

    Labels

    data parsingTasks related to the ingestion and mapping of raw game JSONlogicImplementation of application-specific rules, calculations, or data-driven behaviors.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions