Context
After PR #N (variant card rev 2), the canonical formula for a variant's display name lives in one place — build_variant_display_name(parent_name, config_attributes, fallback_sku) -> str in katana_public_api_client/domain/variant.py. Three consumers already delegate to it:
KatanaVariant.get_display_name (domain class)
CachedVariant.display_name (typed-cache postprocess hook)
VariantDetailsResponse.display_name (new field — surfaces on get_variant_details UI)
This issue tracks the audit and rollout to the other surfaces where variants appear and currently use ad-hoc name formatting (or worse, raw Variant.name).
Audit candidates
Each item below needs a check: "what does this UI currently render as the variant's title?" and "should it use display_name?"
| Surface |
Tool |
Current behavior |
Action |
search_items results |
search_items |
Pulls from CachedVariant.display_name already, but verify it flows through the response payload |
Verify |
| Inventory check rows |
check_inventory |
Per-row "name" field |
Switch to display_name |
| Low-stock rows |
list_low_stock_items |
Per-row "name" field |
Switch to display_name |
| Item detail (nested variants) |
get_item |
Today shows raw variant name |
Switch to display_name |
| PO row tables (preview + result) |
create_purchase_order, modify_purchase_order |
row.variant_id only? Looks up names? |
Determine + switch |
| SO row tables |
create_sales_order, modify_sales_order |
Same question |
Determine + switch |
| MO row tables |
create_manufacturing_order, modify_manufacturing_order |
Same question |
Determine + switch |
| MO recipe row cards |
get_manufacturing_order_recipe |
line items reference variants |
Switch |
| Modification preview / result cards |
Generic modify dispatcher |
Diff context references variants |
Switch |
| Fulfillment cards |
fulfill_order (sales + manufacturing) |
Per-row variant rendering |
Switch |
| Receipt card |
receive_purchase_order |
Per-row variant rendering |
Switch |
| Verification card |
verify_order_document |
line-by-line comparison |
Switch |
Suggested approach
- Walk each surface, find the variant-display code path, and either:
- Use the cache's pre-computed
CachedVariant.display_name directly (cheapest — already there)
- Compute via
build_variant_display_name from the cache row's parent_name + config_attributes if the row was fetched without the precomputed field
- Add the field to whatever response model needs it, mirroring how
VariantDetailsResponse.display_name was added
- Update tests per surface to assert the slash-joined format appears
- Land per-surface in small PRs (one per tool family, e.g. one PR for inventory tools, one for PO/SO/MO row tables, one for fulfillment/receipt)
Acceptance criteria
- Every UI that displays a variant title uses
display_name (or equivalent precomputed cache column)
- One end-to-end test per surface confirming the slash-joined format renders
- No ad-hoc string formatting like
f"{parent_name} - {sku}" remaining
Related
Context
After PR #N (variant card rev 2), the canonical formula for a variant's display name lives in one place —
build_variant_display_name(parent_name, config_attributes, fallback_sku) -> strinkatana_public_api_client/domain/variant.py. Three consumers already delegate to it:KatanaVariant.get_display_name(domain class)CachedVariant.display_name(typed-cache postprocess hook)VariantDetailsResponse.display_name(new field — surfaces onget_variant_detailsUI)This issue tracks the audit and rollout to the other surfaces where variants appear and currently use ad-hoc name formatting (or worse, raw
Variant.name).Audit candidates
Each item below needs a check: "what does this UI currently render as the variant's title?" and "should it use
display_name?"search_itemsresultssearch_itemsCachedVariant.display_namealready, but verify it flows through the response payloadcheck_inventorydisplay_namelist_low_stock_itemsdisplay_nameget_itemdisplay_namecreate_purchase_order,modify_purchase_ordercreate_sales_order,modify_sales_ordercreate_manufacturing_order,modify_manufacturing_orderget_manufacturing_order_recipefulfill_order(sales + manufacturing)receive_purchase_orderverify_order_documentSuggested approach
CachedVariant.display_namedirectly (cheapest — already there)build_variant_display_namefrom the cache row'sparent_name+config_attributesif the row was fetched without the precomputed fieldVariantDetailsResponse.display_namewas addedAcceptance criteria
display_name(or equivalent precomputed cache column)f"{parent_name} - {sku}"remainingRelated
VariantDetailsResponse