Skip to content

fix: make additives and nutrient level attributes clickable (#8492) - #14321

Open
sarthaklole wants to merge 1 commit into
openfoodfacts:mainfrom
sarthaklole:fix-8492-clickable-additives-nutrition-attributes
Open

fix: make additives and nutrient level attributes clickable (#8492)#14321
sarthaklole wants to merge 1 commit into
openfoodfacts:mainfrom
sarthaklole:fix-8492-clickable-additives-nutrition-attributes

Conversation

@sarthaklole

Copy link
Copy Markdown

What

This PR updates lib/ProductOpener/Attributes.pm to make additives and nutrient level product attributes clickable by assigning appropriate panel_id properties for knowledge panel navigation.

Specifically:

  • Additives attribute:
    • Links to additives when additives exist (additives_n > 0).
    • Links to ingredients when no ingredients text is present (so users get an action to add ingredients).
    • Links to ingredients_analysis when ingredients exist but 0 additives are found or status is unknown.
  • Nutrient level attributes (low_fat, low_salt, low_sugars, low_saturated_fat):
    • Links to nutrient_level_<nid> (e.g., nutrient_level_fat) when nutrient levels are known.
    • Links to nutrition_facts_table when nutrient levels are unknown.

Large Language Models usage disclosure

  • Used Google Antigravity AI Assistant (Gemini 3.6 Flash) in agentic pair-programming mode to analyze existing panel linking patterns from PR fix: add more linked panels for attributes #6808, locate attribute definitions in lib/ProductOpener/Attributes.pm, and update panel_id assignment logic.

Related issue(s) and discussion

@sarthaklole
sarthaklole requested a review from a team as a code owner August 22, 2026 14:26
@github-project-automation github-project-automation Bot moved this to To discuss and validate in 🍊 Open Food Facts Server issues Aug 22, 2026
@github-actions github-actions Bot added the Attributes https://wiki.openfoodfacts.org/Product_Attributes label Aug 22, 2026
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Attributes https://wiki.openfoodfacts.org/Product_Attributes

Projects

Status: To discuss and validate

Development

Successfully merging this pull request may close these issues.

Make additives & nutrition related attributes clickable

2 participants