mirror of
https://github.com/kuhyx/diet-guard.git
synced 2026-11-27 22:49:09 +01:00
Record why the gate's delivery prefill must set the dish's grams as its basis
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
file-length / file length <= 250 lines (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (push) Waiting to run
Tests / test (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
file-length / file length <= 250 lines (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (push) Waiting to run
Tests / test (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e0d62e19a0
commit
d2df4c51eb
@ -87,9 +87,13 @@ List<KuchniaDish> dishesInSlotOrder(
|
|||||||
|
|
||||||
/// Returns `(portionGrams, (kcal, protein, carbs, fat))` as form strings.
|
/// Returns `(portionGrams, (kcal, protein, carbs, fat))` as form strings.
|
||||||
///
|
///
|
||||||
/// Mirrors `_kuchnia_spread.dish_field_values`. Formatted here rather than in
|
/// Phone-only, deliberately: this form logs the fields as typed, so writing
|
||||||
/// the widget so the numeric formatting is covered by a test that needs no
|
/// the dish's whole-portion macros into them is correct. The PC gate's form
|
||||||
/// display.
|
/// scales its macros from a "per" basis to the amount eaten, so it goes
|
||||||
|
/// through `_kuchnia_log.dish_nutrition` (basis = the dish's own grams)
|
||||||
|
/// instead -- filling its fields this way logged 3.5x the calories.
|
||||||
|
/// Formatted here rather than in the widget so the numeric formatting is
|
||||||
|
/// covered by a test that needs no display.
|
||||||
///
|
///
|
||||||
/// Python uses `f"{value:g}"`, which drops a trailing `.0`; Dart's
|
/// Python uses `f"{value:g}"`, which drops a trailing `.0`; Dart's
|
||||||
/// `toStringAsFixed` would keep it and `toString` would render `435.0`. So a
|
/// `toStringAsFixed` would keep it and `toString` would render `435.0`. So a
|
||||||
|
|||||||
@ -2,7 +2,7 @@ name: diet_guard_app
|
|||||||
description: "Companion phone app for diet_guard: log meals on the go."
|
description: "Companion phone app for diet_guard: log meals on the go."
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 1.0.88+1
|
version: 1.0.89+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.12.2
|
sdk: ^3.12.2
|
||||||
|
|||||||
@ -85,6 +85,15 @@ This was proven, not assumed: 4·protein + 4·carbs + 9·fat reproduces the stat
|
|||||||
payload and would silently skew every logged meal by a factor of several, so
|
payload and would silently skew every logged meal by a factor of several, so
|
||||||
the parser refuses rather than importing a plausible-looking lie.
|
the parser refuses rather than importing a plausible-looking lie.
|
||||||
|
|
||||||
|
The same mix-up has a second home: the PC gate's form. Its macro fields are a
|
||||||
|
*reference* scaled from the "per" basis to the amount eaten, so the delivery
|
||||||
|
prefill must go through `_apply_reference` with `_kuchnia_log.dish_nutrition`
|
||||||
|
(basis = the dish's own grams). Writing the macros straight into the fields
|
||||||
|
left the basis at `_clear_inputs`'s 100 g default and logged grams/100 times
|
||||||
|
too much while the fields still read correctly (350 g owsianka: 448 shown,
|
||||||
|
1568 logged; every gate-logged delivery 2026-08-23 to 2026-09-20). The phone's
|
||||||
|
`dishFieldValues` has no such basis and is correct as is.
|
||||||
|
|
||||||
## Credentials
|
## Credentials
|
||||||
|
|
||||||
Three files under `~/.config/diet_guard/`, all mode 600. They are outside
|
Three files under `~/.config/diet_guard/`, all mode 600. They are outside
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user