Skip to content

fix(pwa): Custom Feed lists every category (N6); "Calves" label (N9) - #125

Merged
satishbagali merged 1 commit into
mainfrom
fix/n6-n9-custom-feed-categories-calves
Nov 5, 2026
Merged

satishbagali merged 1 commit into
mainfrom
fix/n6-n9-custom-feed-categories-calves

Conversation

@Aiyappa-DigitalGreen

Copy link
Copy Markdown
Collaborator

N6: Custom Feed popup lists every category of the type

  • Before, useCustomFeed used getFeedCategories(type, country), which keeps only categories the country already has feeds in. So India › Concentrate offered only Energy Source, and Minerals and Additive (with their own nutrient forms) couldn't be reached.
  • Now the popup uses the new getCatalogCategoriesForType(type), the existing master-list lookup, now exported. It returns every active category in catalogue order. If that lookup fails, the popup falls back to the country list, so it's never empty.
  • getFeedCategories and the Feed Selection cards are unchanged: they still offer only categories that have feeds.

N9: "Calves"

  • ANIMAL_CATEGORY_LABELS["Baby Calf/Heifer"] changed from "Baby calves/heifers" to "Calves". The API value stays "Baby Calf/Heifer".
  • New label-sheet row "Calves" (Constants) with the drafted translations in all 9 languages, plus Tigrigna, French and Arabic. The translations are machine-drafted and need native review. The old row is removed because nothing uses it any more.

Tests

  • New useCustomFeed.test.tsx: all master categories even when the country list is shorter; fallback when the lookup fails.
  • api-feed-taxonomy.test.ts: the master list vs getFeedCategories overlap for the same country; null on failure.
  • Updated the label assertions in api-helpers and cattle-info.

The full gate passes on Node 20: 983 tests.

Check on Test

  1. Custom Feed → Concentrate: all Concentrate categories, including Minerals and Additive; each opens its own nutrient form.
  2. Forage: all Forage categories.
  3. A Feed Selection card's Category list is unchanged (only categories with feeds).
  4. Cattle Info → Physiological State: the fourth option reads "Calves" (try hi / vi / am). Choose it and press Continue: the calf plan opens.

🤖 Generated with Claude Code

…abel (N9)

N6 — the Custom Feed popup took its categories from the country's
library, so a new feed could only go in a category the country already
had (India Concentrate: Energy Source only; Minerals and Additive were
unreachable). It now lists the type's master categories in catalogue
order, falling back to the country list if that lookup fails. Feed
Selection still offers only categories that have feeds.

N9 — the Physiological State option "Baby calves/heifers" now reads
"Calves" (all 9 languages + Tigrigna/French/Arabic). The API value stays
"Baby Calf/Heifer"; the unused old label row is removed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 5, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@satishbagali
satishbagali merged commit f377b3a into main Nov 5, 2026
7 checks passed
@satishbagali
satishbagali deleted the fix/n6-n9-custom-feed-categories-calves branch November 5, 2026 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants