Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard: Proof card: PriceCountChip: misleading colors #1187

Closed
k127 opened this issue Dec 29, 2024 · 2 comments · Fixed by #1207
Closed

Dashboard: Proof card: PriceCountChip: misleading colors #1187

k127 opened this issue Dec 29, 2024 · 2 comments · Fixed by #1207

Comments

@k127
Copy link
Contributor

k127 commented Dec 29, 2024

What

As a user, you may find the colour coding of the price count chip misleading, used on the respective component:

getColor() {
if (this.count === 0) {
return 'error'
}
if (this.count === 1) {
return 'warning'
}
if (this.count > 1) {
return 'success'
}
},
}

While in other contexts such as PriceCard.vue, the same coloring algorithm may be meaningful, it appears not to be in the context of ProofFooterRow.vue.

Steps to reproduce the behavior:

  1. Have some proofs available with zero, one, and more than one prices
  2. Visit https://prices.openfoodfacts.org/dashboard/proofs
  3. Inspect the PriceCountChip within a ProofCard

Expected behavior

Finding a more meaningful color coding that also respects proof.receipt_price_count, in addition to proof.price_count:

      // symbols are pseudo named
      if (this.price_count === 0) {
        return 'error'
      }
      else if (this.price_count < this.receipt_price_count) {
        return 'warning'
      }
      else if (this.price_count === this.receipt_price_count) {
        return 'success'
      }
      else if (this.price_count > this.receipt_price_count) {
        return 'error'
      }

A determination of whether the PriceCountChip component is used in PriceCard, or ProofFooterRow, would also be required.

@raphodn
Copy link
Member

raphodn commented Dec 31, 2024

Indeed the ProofCard price color should be green when at least 1 price is linked, doesn't make sense to have the intermediate yellow color.

Image

@raphodn
Copy link
Member

raphodn commented Dec 31, 2024

Regarding the "consumption-related fields" (receipt_price_count), it's not always equivalent to the price_count, for instance if you buy multiple quantities of the same item. so it's tricky right now to have a hard rule. see #1169

I'll leave this pending/todo in another issue.

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

Successfully merging a pull request may close this issue.

3 participants