Food: the header's arrows go by week; days switch in place

- Dashboard: the arrows (and the left / right keys) move a week, the week
  strip picks the day. Switching fetches the page and swaps in its header and
  diary instead of loading everything again (back / forward work); a day is
  fetched ahead while the pointer rests on it.
- App: the arrows move a week, swiping sideways moves a day (1.1.6).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Bashy 2026-10-26 15:41:23 +02:00
parent eeca189b7f
commit 98b110dd56
7 changed files with 62 additions and 9 deletions

View file

@ -13,6 +13,11 @@ What changed in each published build of the app. `tool/publish.sh` shows the ent
- The band's data goes with the phone's time zone, so the dashboard reads its times right without a
setting.
## 1.1.6 — 2026-10-26
- Food: the arrows at the top go a week back / ahead; swiping sideways goes a day. The dashboard's arrows go
by week too.
## 1.1.5 — 2026-10-26
- Food: "All products" lists everything — My foods, the food database and products you kept first, then

View file

@ -92,7 +92,18 @@ class _FoodPageState extends State<FoodPage> {
label: Text(es.isEmpty ? 'Make a meal' : 'Make a meal (from this day’s entries)'),
),
];
return ListView(padding: const EdgeInsets.fromLTRB(12, 10, 12, 24), children: [
// the arrows go by week; a swipe sideways goes by day
return GestureDetector(
onHorizontalDragEnd: (e) {
final v = e.primaryVelocity ?? 0;
if (v.abs() < 300) return;
if (v > 0) {
setState(() => d = plus(d, -1));
} else if (daysBetween(today(), d) < ahead) {
setState(() => d = plus(d, 1));
}
},
child: ListView(padding: const EdgeInsets.fromLTRB(12, 10, 12, 24), children: [
if (wide)
Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
Expanded(child: Column(children: head)),
@ -100,13 +111,14 @@ class _FoodPageState extends State<FoodPage> {
Expanded(child: Column(children: meals)),
])
else ...[...head, const SizedBox(height: 10), ...meals],
]);
]),
);
});
},
);
Widget _nav() => Row(children: [
IconButton(onPressed: () => setState(() => d = plus(d, -1)), icon: const Icon(Icons.chevron_left)),
IconButton(tooltip: 'Week before', onPressed: () => setState(() => d = plus(d, -7)), icon: const Icon(Icons.chevron_left)),
Expanded(
child: GestureDetector(
onTap: () => setState(() => d = today()),
@ -115,7 +127,8 @@ class _FoodPageState extends State<FoodPage> {
),
),
IconButton(
onPressed: daysBetween(today(), d) < ahead ? () => setState(() => d = plus(d, 1)) : null,
tooltip: 'Week after',
onPressed: daysBetween(today(), d) + 7 <= ahead ? () => setState(() => d = plus(d, 7)) : null,
icon: const Icon(Icons.chevron_right)),
]);

View file

@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.1.5+8
version: 1.1.6+10
environment:
sdk: ^3.12.2