diff --git a/README.md b/README.md
index c4ad7bd..a441ae0 100644
--- a/README.md
+++ b/README.md
@@ -5,10 +5,12 @@ A single-user, self-hosted nutrition journal. PWA first, with a responsive deskt
## Included
- Daily calorie vessel with colliding physics bubbles, week navigation, meal journal, editable entries, fractional servings. New bubbles drop from the top as calories increase.
+- Food names are optional: unnamed daily entries use the meal name and next available number, such as `Dinner 1`. The main Add food action suggests breakfast from 5–11am, lunch from 11am–4pm, dinner from 4–10pm and snacks overnight, using the device's local time. Meal-specific add buttons preserve their category; the selection remains editable.
+- Food entries include an editable local clock time, shown in the journal and all export formats. Existing entries without a time remain valid and show “Time not recorded” until you add one. Entries sort by time within each meal.
- Saved foods and reusable plates. Logging a plate creates an atomic batch of independent food entries. Logs retain a nutrition snapshot when library foods change.
- Independently enabled calorie, protein, carbohydrate, fat, fiber, sugar and sodium goals.
- Weight journal in lb or kg; internally stored in kg. Multiple weigh-ins are retained, with the latest measurement per day used in charts.
-- 7 / 30 / 90 / 365 day nutrition and weight trends. Unlogged days are excluded from intake averages.
+- Dedicated Weight tab on desktop and mobile, with its own logging, graph and journal. Nutrition trends live under Library → Trends. Both support 7 / 30 / 90 / 365 day periods. Unlogged days are excluded from intake averages.
- Markdown, CSV and JSON export with date range, nutrient and weight selections. Markdown is designed for LLM analysis. Data is downloaded locally, never submitted to an LLM. Save preferences to remember the export format, range preset and selections.
- Password authentication, IndexedDB offline journal/outbox, a precached app shell, automatic foreground/reconnect sync, and explicit PWA update prompts.
@@ -66,9 +68,9 @@ To restore a database backup: stop Calio, preserve the current data directory, r
### Bubble motion
-Tap **Enable tilt** beneath the calorie circle to allow device orientation. On iPhone, Safari asks for motion/orientation permission from that tap; the public site must use HTTPS. The app remembers the choice for the current page session and does not transmit sensor readings. Portrait, landscape and upside-down positions are mapped to the screen's gravity direction. Devices without sensors, or with permission denied, retain downward gravity and the **Give a nudge** control.
+Enable **Settings → Look & feel → Tilt calorie bubbles** to allow device orientation. On iPhone, Safari asks for motion/orientation permission from that gesture; the public site must use HTTPS. The preference is stored only on this device, and iOS may require enabling it again after reopening the app. Sensor readings are never transmitted. Portrait, landscape and upside-down positions are mapped to the screen's gravity direction. Devices without sensors, or with permission denied, retain downward gravity.
-The circle uses a bounded Matter.js simulation: bubbles collide with each other and the circular wall, new calorie bubbles drop from the top, and removing calories removes the corresponding particles. Bubbles draw smaller than their collision boundaries, creating a small visible gap between them. A full hexagonal packing defines the 100% capacity; near a full vessel, the numeric readout moves below the circle so it does not hide dots. The particle count caps at the daily goal; over-goal calories still show the exact excess and a red ring. With the calorie goal disabled, the display uses a fixed 2,500 kcal visual scale. The animation sleeps when settled, pauses in hidden tabs, and honors the device's reduced-motion preference with a still arrangement. The graphic is an approximate visual; the numeric calorie total is authoritative.
+The circle uses a bounded Matter.js simulation: bubbles collide with each other and the circular wall, new calorie bubbles drop from the top at 30 per second (50% faster than the original pace), and removing calories removes the corresponding particles. Bubbles draw smaller than their collision boundaries, creating a small visible gap between them. A full hexagonal packing defines the 100% capacity. The numeric readout always sits below the circle, leaving every dot visible. The particle count caps at the daily goal; over-goal calories still show the exact excess and a red ring. With the calorie goal disabled, the display uses a fixed 2,500 kcal visual scale. Macro bars animate when totals change, and rows with one or two tracked macros are centered. Motion honors the device's reduced-motion preference. The physics animation sleeps when settled and pauses in hidden tabs. The graphic is an approximate visual; the numeric calorie total is authoritative.
## Forgejo CI and container registry
diff --git a/shared/bubble-physics.js b/shared/bubble-physics.js
index 91e0f2f..6b2515b 100644
--- a/shared/bubble-physics.js
+++ b/shared/bubble-physics.js
@@ -102,7 +102,8 @@ export function createBubbleWorld(initialCount = 0, random = Math.random) {
}
function step(delta = 1000 / 60) {
spawnTime += delta;
- if (balls.length < target && spawnTime >= 45) {
+ // Two 60 Hz frames per bubble, previously three: 50% more arrivals/second.
+ if (balls.length < target && spawnTime >= 1000 / 30) {
spawnTime = 0;
// Each new bubble enters at the upper inside edge, then falls naturally.
const x = 160 + (random() - 0.5) * 55;
diff --git a/shared/domain.js b/shared/domain.js
index 1932cfd..2801e26 100644
--- a/shared/domain.js
+++ b/shared/domain.js
@@ -31,6 +31,10 @@ const food = z.object({
const entry = food
.extend({
date,
+ time: z
+ .string()
+ .regex(/^([01]\d|2[0-3]):[0-5]\d$/)
+ .optional(),
meal: z.enum(["Breakfast", "Lunch", "Dinner", "Snacks"]),
quantity: z.number().finite().positive().max(1000),
})
diff --git a/shared/entry.js b/shared/entry.js
new file mode 100644
index 0000000..29fc2c9
--- /dev/null
+++ b/shared/entry.js
@@ -0,0 +1,22 @@
+/** @returns {'Breakfast' | 'Lunch' | 'Dinner' | 'Snacks'} */
+export function suggestedMeal(date = new Date()) {
+ const hour = date.getHours();
+ if (hour >= 5 && hour < 11) return "Breakfast";
+ if (hour >= 11 && hour < 16) return "Lunch";
+ if (hour >= 16 && hour < 22) return "Dinner";
+ return "Snacks";
+}
+
+export function localTime(date = new Date()) {
+ return `${String(date.getHours()).padStart(2, "0")}:${String(date.getMinutes()).padStart(2, "0")}`;
+}
+
+export function nextFoodName(prefix, names) {
+ let highest = 0;
+ for (const name of names) {
+ if (!name.startsWith(prefix + " ")) continue;
+ const suffix = name.slice(prefix.length + 1);
+ if (/^\d+$/.test(suffix)) highest = Math.max(highest, Number(suffix));
+ }
+ return `${prefix} ${highest + 1}`;
+}
diff --git a/src/App.tsx b/src/App.tsx
index 7fdfea3..b88181e 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,13 +1,17 @@
-import { useCallback, useEffect, useMemo, useState } from "react";
import {
- Activity,
+ useCallback,
+ useEffect,
+ useMemo,
+ useState,
+ type ReactNode,
+} from "react";
+import {
ArrowRight,
ArrowUpRight,
BookOpen,
Check,
ChevronLeft,
ChevronRight,
- CircleHelp,
CloudOff,
Coffee,
Home,
@@ -15,7 +19,6 @@ import {
LoaderCircle,
LockKeyhole,
Moon,
- MoreHorizontal,
Pencil,
Plus,
Scale,
@@ -31,6 +34,7 @@ import {
} from "lucide-react";
import { defaultSettings, totalNutrients } from "../shared/domain.js";
import { accentPalette } from "../shared/theme.js";
+import { suggestedMeal } from "../shared/entry.js";
import {
deleteRecord,
initStore,
@@ -53,11 +57,11 @@ import {
import {
dayDate,
displayDate,
+ displayTime,
number,
offsetDay,
recordsOf,
today,
- weightValue,
} from "./utils";
import {
CalorieOrb,
@@ -70,7 +74,7 @@ import {
import { Trends } from "./Trends";
import { Settings } from "./Settings";
-type Page = "today" | "library" | "trends" | "settings";
+type Page = "today" | "library" | "weight" | "settings";
type Editor =
| { kind: "log"; meal: Meal; record?: JournalRecord
{reauth
@@ -213,7 +216,6 @@ function Dashboard({
edit,
remove,
openLibrary,
- logWeight,
}: {
records: JournalRecord[];
settings: SettingsData;
@@ -223,7 +225,6 @@ function Dashboard({
edit: (r: JournalRecord
- {latestWeight - ? `Latest weigh-in · ${displayDate(latestWeight.data.date, { month: "short", day: "numeric" })}` - : "Log your weight. See the bigger picture."} -
-A little less effort, every time you log.
- Progress looks
-
- different every day.
-
+ {tilt.status === "denied" + ? "Motion permission was not granted. Check your browser’s website permissions." + : tilt.status === "unavailable" + ? "Orientation sensors are unavailable on this device. Bubbles still fall normally." + : tilt.status === "permission" + ? "Enable tilt again to grant motion access for this session." + : "Uses this device’s orientation. iPhone may request permission again after reopening. Reduced motion pauses the animation."} +
Small moments. A little perspective.
+ {mode === "weight" && ( +Your weigh-ins and changes over time.
+- {loggedDays.length} of {period} days logged · Empty days are - excluded from the average. -
- -+ {loggedDays.length} of {period} days logged · Empty days are + excluded from the average. +
+
+ {delta === null ? (
+ "Log another day to see a change over time."
+ ) : (
+ <>
+ {delta < 0 ? (
+
- {delta === null ? (
- "Log another day to see a change over time."
- ) : (
- <>
- {delta < 0 ? (
-
No weigh-ins in this date range.
) : ( -No weigh-ins in this date range.
- ) : ( - [...weights].reverse().map((r) => ( -- Motion access was not granted. You can allow it in your browser’s - website settings. -
- )} - {physics.motion === "unavailable" && ( -- No tilt data yet. Falling bubbles still work on this device. -
- )} - > - )} + {!small &&