Skip to content

Feature: barcodescanner for quick carb entry of processed food#874

Open
EJM0 wants to merge 86 commits intonightscout:devfrom
EJM0:aibarcode
Open

Feature: barcodescanner for quick carb entry of processed food#874
EJM0 wants to merge 86 commits intonightscout:devfrom
EJM0:aibarcode

Conversation

@EJM0
Copy link
Copy Markdown

@EJM0 EJM0 commented Dec 4, 2025

Barcode Scanner and Search Bar using OpenFoodFacts DB

Search Bar (Treatment View & List View)

I recommend logging in via OpenFoodFacts because text search is currently rate-limited for anonymous users, although the barcode API is not affected. By logging in, users can also correct incorrect data, improving their own results while contributing to the quality of the OpenFoodFacts database. Justifying the added usage to their service.


Barcode Scanner


List View (Items Added to Meal)

  • Items can be removed or edited via left and right swipe gestures.

Edit View of Items

  • This view appears after scanning an item to verify that the nutritional information is correct.
  • To confirm, tap Add.
  • The same view is used for updating nutritional information and can also be reused for future meal presets.
  • If the user notices incorrect data, it can be edited.
  • If logged in via OpenFoodFacts, users can submit corrected data to the database.

Treatmentview with added item


Settings

Copy link
Copy Markdown
Contributor

@kingst kingst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm concerned about the use of AI/ML here without any sort of design doc. Given that insulin is a dangerous hormone, anything that uses AI/ML, especially via cloud services, should have a well articulated safety and security discussion.

I love the initiative of this feature, but from a quick glance at the code I'm less enthusiastic about the maintenance overhead given the benefit vs complexity that I can see. Long term I'd like to see Trio move toward no meal announcements vs tools to help with meal announcements, but that's just my own personal opinion.

Architecturally, have you considered using a separate app for this and interfacing with Trio via a universal link or some other IPC mechanism?

As a concrete next step I'd like to suggest starting with a short design document.

@iampickle iampickle force-pushed the aibarcode branch 2 times, most recently from cee3256 to de8d1d3 Compare December 4, 2025 16:12
@MikePlante1 MikePlante1 marked this pull request as draft December 4, 2025 16:22
@EJM0
Copy link
Copy Markdown
Author

EJM0 commented Dec 5, 2025

I thought about implementing it as a separate app, but with that would come unnecessary complications.
In my opinion, it’s just a better quality of life to have an all-in-one approach as long as it is not too much in one.
I think it would be a good improvement if we implement the barcode feature and discard the ai feature.
Additionally, I’d look into nutritional label detection to eventually strengthen the reliability of the feature since the openfoodfact db does have some inconsistencies in the data it provides for the food that is scanned.
Also im aware of the poor code quality that is a product of vibe coding it together in 1h but id like to refine the code to make it also better for maintaining.

@iampickle iampickle force-pushed the aibarcode branch 4 times, most recently from 1ffbf70 to de8d1d3 Compare December 5, 2025 12:05
@EJM0
Copy link
Copy Markdown
Author

EJM0 commented Dec 8, 2025

Ohne.Titel.mp4

@MikePlante1
Copy link
Copy Markdown
Contributor

At this time, we will not be accepting any PRs that require linking an LLM to use them. Please strip the AI parts out. Thank you.

@EJM0
Copy link
Copy Markdown
Author

EJM0 commented Dec 15, 2025

Hi @MikePlante1 , does that mean specifically using LLM for dosing? If yes, I stripped that out of the code. The only "ai" used here is openfoodfact-extractor. Which is only used for extracting nutritional labels from food that is not covered by the barcode db. Therefore, it does not do any carb predictions and also not falling under this case.

@EJM0 EJM0 changed the title Feature: Aibarcode Feature: barcode with ai model for nutrilable scanning Dec 15, 2025
@EJM0 EJM0 changed the title Feature: barcode with ai model for nutrilable scanning Feature: barcodescanner with ai model for nutrilable scanning Dec 15, 2025
@EJM0 EJM0 changed the title Feature: barcodescanner with ai model for nutrilable scanning Feature: barcodescanner with ai model for nutrilable scanning(picture) for supplementing barcode db Dec 15, 2025
@EJM0 EJM0 changed the title Feature: barcodescanner with ai model for nutrilable scanning(picture) for supplementing barcode db Feature: barcodescanner with ai model for nutrilable scanning(picture) to supplementing barcode db Dec 15, 2025
@EJM0 EJM0 changed the title Feature: barcodescanner with ai model for nutrilable scanning(picture) to supplementing barcode db Feature: barcodescanner with ai model for nutrilable scanning(picture) to supplement barcode db Dec 15, 2025
@EJM0
Copy link
Copy Markdown
Author

EJM0 commented Dec 15, 2025

trim.40FE5CFD-C312-402C-8377-89FACF10484A.MOV

Current state

@MikePlante1
Copy link
Copy Markdown
Contributor

Hi @MikePlante1 , does that mean specifically using LLM for dosing? If yes, I stripped that out of the code. The only "ai" used here is openfoodfact-extractor. Which is only used for extracting nutritional labels from food that is not covered by the barcode db. Therefore, it does not do any carb predictions and also not falling under this case.

To quote the comment you linked from @dnzxy :

We will not accept anything into Trio that requires users to add Claude (or any other LLM) to the app at this point in time.

So please strip it out for this PR. If this policy changes in the future, you'd be welcome to PR it again.

@EJM0
Copy link
Copy Markdown
Author

EJM0 commented Dec 16, 2025

Okay I'll do so :)

@EJM0 EJM0 changed the title Feature: barcodescanner with ai model for nutrilable scanning(picture) to supplement barcode db Feature: barcodescanner for quit carb entry of processed food Dec 16, 2025
@EJM0 EJM0 requested a review from kingst January 5, 2026 16:09
@EJM0
Copy link
Copy Markdown
Author

EJM0 commented Jan 10, 2026

Ready @dnzxy,
Would love a review form somebody more knowledgeable than me. :)

@dnzxy
Copy link
Copy Markdown
Contributor

dnzxy commented Jan 24, 2026

Sorry, very busy with life recently and attempting to get dev to main.
This won't make the cut for the dev-to-main push, but will put it on the list to look at ASAP after that.

@EJM0
Copy link
Copy Markdown
Author

EJM0 commented Jan 25, 2026

Okay, good to hear. Looking forward for the big release:) 🍾

@dnzxy dnzxy mentioned this pull request Jan 27, 2026
EJM0 added 2 commits February 1, 2026 22:56
-add quantity selctors for liquids if only per100ml data is present
-refoctor animaton and apperans of amount multiplicator
-reduce height of list components
EJM0 added 3 commits February 2, 2026 13:54
- Add search bar and list to list view
- Separate search bar and search list
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.

4 participants