feat: Add Knowledge Panel compliant route with enhanced formatting for Folksonomy Engine#317
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #317 +/- ##
===========================================
- Coverage 95.06% 78.59% -16.47%
===========================================
Files 5 4 -1
Lines 324 556 +232
===========================================
+ Hits 308 437 +129
- Misses 16 119 +103 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: teolemon <1689815+teolemon@users.noreply.github.com>
Co-authored-by: teolemon <1689815+teolemon@users.noreply.github.com>
Co-authored-by: teolemon <1689815+teolemon@users.noreply.github.com>
|
@copilot I have allowlisted install.python-poetry.org and world.openfoodfacts.org |
|
@copilot can you turn
Smartphone properties: Other added Property (might be renamed in the future) additive_error |
- Convert URLs to clickable HTML links - Format yes/no values as ✅/❌ emojis - Add color emojis (🔴 red, 🟢 green, 🔵 blue, etc.) - Format units in property names (mm, g, GB, etc.) - Replace colons with › and underscores with spaces for readability - Add comprehensive tests for formatting functions Co-authored-by: teolemon <1689815+teolemon@users.noreply.github.com>
Done in commit c65f4b5. The Knowledge Panel now includes enhanced formatting: Before: After: Features implemented:
The formatting keeps code minimal while making data more enjoyable at scale. |
|
I can implement the wiki/property links as requested. However, the YAML documentation system is a substantial feature that would require:
This seems like it should be a separate issue/PR rather than part of this Knowledge Panel endpoint implementation. For this PR, I'll focus on:
Would you like me to proceed with items 1-3, and create a separate issue for the YAML documentation system?
Implemented in commit 520bdc5. Property links are now included in an unobtrusive way: Features added:
Example output: The 📖 icon links to wiki docs (e.g., https://wiki.openfoodfacts.org/Folksonomy/Property/same_product) and 🔍 links to product listings (e.g., https://world.openfoodfacts.org/property/color). Regarding the YAML documentation system: This is a substantial feature requiring schema design, file structure, multilingual support, and icon management. I recommend creating a separate issue to properly scope this feature. It would involve:
Would you like me to create a detailed issue template for this? |
- Add get_property_wiki_url() to generate wiki documentation links - Add get_property_products_url() to generate product list links - Include unobtrusive 📖 and 🔍 icons with links in property names - Add helpful description text explaining the links - Add comprehensive tests for URL generation and link presence - Links open in new tab with descriptive title attributes Co-authored-by: teolemon <1689815+teolemon@users.noreply.github.com>
|
@copilot sounds good |
|
@copilot can you create in a PR building on this one, a beginner friendly Yaml documentation system for the properties, that's not reliant on the Open Food Facts wiki, but has a link to it, that allows to
|
I cannot create a new PR directly, but I can help design and implement the YAML documentation system in the current codebase. Would you like me to:
For the YAML system, I'd propose:
Let me know which approach you prefer. |
|
@copilot In a new PR based on this one
|
I cannot create a new PR directly, but I can implement the iFixit repair Knowledge Panel feature in this current PR if you'd like, or provide a detailed implementation plan. For the repair Knowledge Panel feature, I would implement:
The implementation would:
Would you like me to:
|
Summary
Successfully implemented a Knowledge Panel compliant route for the Folksonomy Engine with enhanced formatting and property links:
Endpoint
GET /product/{barcode}/knowledge_panelNew Features - Property Links
Enhanced Formatting Features
Example Output
Where:
All Features
Original prompt
Fixes #185
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.