lneugebauer / nextcloud-cookbook

Android client for Nextcloud Cookbook app.
https://lneugebauer.github.io/nextcloud-cookbook/
MIT License
46 stars 8 forks source link

[Regression] Fractions are being converted to decimals #89

Closed TinfoilSubmarine closed 5 days ago

TinfoilSubmarine commented 1 month ago

Describe the bug

All fractions in ingredients list are being converted to decimals.

To Reproduce Steps to reproduce the behavior:

  1. Have recipe with fractions (such as 1/2, 2/3, etc.).
  2. When viewing recipe, see that a decimal is displayed.

Expected behavior

When viewing recipe, if a fraction is input for the ingredient, a fraction should be displayed.

Screenshots

Screenshot_20240805-120840_Cookbook Screenshot_20240805-120847_Cookbook

Smartphone:

Additional context

Not everyone can intuit that e.g. 0.12 ~= 1/8 very quickly. I understand that there are probably some technical issues with doing this if the user changes the serving amount, but at least for the original recipe serving amount, we should display the recipe as it was input by the user.

EDIT: Upon further investigation, this appears to be a regression from version 0.18.0 which displayed the fractions as expected.

lneugebauer commented 1 month ago

Hi @TinfoilSubmarine, thank you for reporting this issue.

I decided to always use the calculated amounts as this is the same behaviour the webapp has. In general, I try to mimic the behaviour of the webapp to have as seamless an experience as possible between the two.

There was a big discussion about how to implement the calculation behaviour and I didn't wanna go against that. It looks like this is going to change though, as there is an open PR (nextcloud/cookbook#2421). I'll get in contact with the developers and figure out the state of that PR.

It looks like porting that would also resolve #84.

But I understand your point. Being limited to decimals doesn't feel right.