Skip to content

Feature(#630): Show brand for ingredients#1203

Merged
rolandgeider merged 6 commits into
wger-project:masterfrom
anjakDev:feature/630-show-brand-for-ingredients
May 27, 2026
Merged

Feature(#630): Show brand for ingredients#1203
rolandgeider merged 6 commits into
wger-project:masterfrom
anjakDev:feature/630-show-brand-for-ingredients

Conversation

@anjakDev
Copy link
Copy Markdown
Contributor

Proposed Changes

As requested in #630, in the Nutrition UI, both the search results as well as the ingredient details show the brand of the item (if provided by the API).
This makes it easier to quickly distinguish between multiple ingredient items with the same name, and find the right item to track.

Related Issue(s)

Closes #630

Please check that the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Set a 100-character limit to avoid white space diffs (run dart format .)

Screenshots

Simulator Screenshot - iPhone 17 - 2026-05-23 at 13 54 42 Simulator Screenshot - iPhone 17 - 2026-05-23 at 13 54 49

),
title: Text(
ingredient.name,
title: Text.rich(
Copy link
Copy Markdown
Member

@rolandgeider rolandgeider May 26, 2026

Choose a reason for hiding this comment

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

Is there a reason you added this in the title? Unless it breaks the UI (which I didn't test), I'd vote to simply show the brand in subtitle

Nevermind, we already have a subtitle

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

haha yeah, I saw the subtitle is used for the chips/tags, and I thought a while about what the best design choice is of where to put the brand, but adding it to the subtitle felt too crowded and also mismatched with the chips, and I didn't want to add a 'third' row as it would just increase the per-item space too much. Since most items tend to have a short(er) name, I think name and brand sharing the title space looked okay. I'm open to suggestions though!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

no, you are right, the name and the brand belong more together.

If you want to fix a small thing, instead of changing the alpha here, use the color from one of the Theme.of(context).colorScheme.xyz (I think onSurfaceVariant?), then this also automatically works on the dark mode

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point! I fixed it with the latest commit. I decided to still modify the alpha channel a little in the ListTile title, because otherwise I felt like there was too little contrast between the ingredient name and the brand (since they are sharing a line). For the IngredientDetails view, I use onSurfaceVariant unmodified, since it's positioned in the line below and has smaller fontSize anyway.

@rolandgeider rolandgeider merged commit 90cfd60 into wger-project:master May 27, 2026
4 checks passed
@rolandgeider
Copy link
Copy Markdown
Member

Merged 🚀

@anjakDev anjakDev deleted the feature/630-show-brand-for-ingredients branch May 27, 2026 09:03
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.

App should show brand for ingredients

2 participants