Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 30, 2025

Implements a "Maintain" section knowledge panel for Open Products Facts that surfaces maintenance and repair advice for products with epargnonsnosressources_fr_url:en taxonomy property.

Implementation

  • Added create_maintain_card_panel() function in KnowledgePanels.pm that:

    • Uses get_inherited_property_from_categories_tags() to find maintenance URLs from category taxonomy
    • Creates maintenance advice panel for France (target_cc = 'fr')
    • Returns early if product_type ≠ "product"
  • Created template structure:

    • maintain_card.tt.json - Card container
    • maintenance_advice_fr_epargnonsnosressources.tt.json - Panel with actionable link to government maintenance resources
  • Integrated into knowledge panels flow:

    • Added panel request check and creation in create_knowledge_panels()
    • Added has_maintain_card to root panel template

Scope

Applies to 14+ product categories including smartphones, computers, appliances, and tools. Panel displays between Environment and Secondhand cards in the product page.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add maintenance URLs for France for Open Products Facts Add maintenance knowledge panel for Open Products Facts Oct 30, 2025
Copilot AI requested a review from teolemon October 30, 2025 09:10
Copilot finished work on behalf of teolemon October 30, 2025 09:10
@github-actions github-actions bot added 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. labels Oct 30, 2025
@github-project-automation github-project-automation bot moved this to To discuss and validate in 🍊 Open Food Facts Server issues Oct 30, 2025
@github-actions github-actions bot added the 💥 Merge Conflicts 💥 Merge Conflicts label Nov 1, 2025
@teolemon teolemon added the 📸 Open Products Facts Our project to increase the lifespan of objects. https://world.openproductsfacts.org label Nov 3, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 3, 2025

@teolemon
Copy link
Member

teolemon commented Nov 4, 2025

lib/ProductOpener/KnowledgePanels.pm: Begin Error Output Stream
lib/ProductOpener/KnowledgePanels.pm: assertion failure: '--assert-tidy' is set but output differs from input
lib/ProductOpener/KnowledgePanels.pm:
lib/ProductOpener/KnowledgePanels.pm: Input file length has 66936 chars in 1810 lines
lib/ProductOpener/KnowledgePanels.pm: Output file length has 66965 chars in 1817 lines
lib/ProductOpener/KnowledgePanels.pm: Files first differ at character 36 of line 933
lib/ProductOpener/KnowledgePanels.pm: 932: if ($target_cc eq 'fr') {
lib/ProductOpener/KnowledgePanels.pm: <933: create_panel_from_json_template("maintenance_advice_fr_epargnonsnosre...
lib/ProductOpener/KnowledgePanels.pm: >933: create_panel_from_json_template(
lib/ProductOpener/KnowledgePanels.pm: ^
lib/ProductOpener/KnowledgePanels.pm:

@teolemon teolemon changed the title Add maintenance knowledge panel for Open Products Facts feat: Add maintenance knowledge panel for Open Products Facts Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels 💥 Merge Conflicts 💥 Merge Conflicts 📸 Open Products Facts Our project to increase the lifespan of objects. https://world.openproductsfacts.org Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes.

Projects

Status: To discuss and validate
Status: In progress
Status: In progress

Development

Successfully merging this pull request may close these issues.

2 participants