Polish PWA gestures, transitions and nutrition averages
All checks were successful
Verify and publish Calio container / build-and-push (push) Successful in 32s

This commit is contained in:
Elijah 2026-10-22 09:16:52 -07:00
parent b19de6f9ea
commit 7288e56c02
16 changed files with 1019 additions and 245 deletions

View file

@ -36,7 +36,12 @@ export function Settings({
install: (() => void) | null;
update: (() => void) | null;
}) {
const [draft, setDraft] = useState(settings);
const [draft, setDraft] = useState({
...settings,
minimumAverageCalories:
settings.minimumAverageCalories ??
Math.round(settings.goals.calories.target / 2),
});
const tilt = useTilt();
const [busy, setBusy] = useState(false);
const [format, setFormat] = useState(settings.exportFormat);
@ -174,6 +179,40 @@ export function Settings({
</label>
</div>
))}
<div className="settings-section">
<h3>Nutrition averages</h3>
<label className="average-cutoff">
Minimum calories for averages
<span className="unit-input">
<input
aria-label="Minimum calories for averages"
type="number"
inputMode="numeric"
min="0"
max="100000"
step="1"
required
value={draft.minimumAverageCalories}
onChange={(event) =>
setDraft({
...draft,
minimumAverageCalories:
event.target.value === ""
? ("" as unknown as number)
: +event.target.value,
})
}
/>
<span>kcal</span>
</span>
</label>
<p className="small muted">
Days below this amount are treated as incomplete in every
nutrition average. Starts at half your calorie target. Set to 0 to
include all logged days. Charts and exports always keep every
entry.
</p>
</div>
<div className="settings-section">
<h3>Look & feel</h3>
<div className="preference-row">