Repository navigation
Longer Trends ranges with weekly bars and a 7-day average - #8
Draft
Oliver-Johnson wants to merge 7 commits into
Draft
Oliver-Johnson wants to merge 7 commits into
Oliver-Johnson wants to merge 7 commits into
Conversation
…6-10-06.1) seedCustomFoods() ran on every launch and added 11 foods to each user's custom foods list, re-adding any the user had deleted. The list is now only used as a fibre lookup. Existing users keep whatever is already in their list. Also removes plans/training_plan_2026.md, which held personal health data, and corrects the v2026-09-02.2 changelog date. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019C67htt6KV7fmxsGCf5FR7
…(v2026-10-06.2) - Trends and Macro History: dates under the charts were cut off; the Trends kg/kcal labels overlapped the top axis values and the end bars covered the axis numbers. - History calendar: an inline padding override put "Jump to Today" behind the bottom nav, so tapping it opened Settings. - Additional Nutrients in Manual and Quick Add never collapsed because no .hidden rule existed. It now collapses on tap and stays open by default, as users see it today. - Macro breakdown popup: escape food names before inserting them. - First-run tour: steps whose target is hidden show the tip centred. - Ko-fi card on tablets sits above the bottom nav. - Docs: What's New cards now reveal in Chrome; the observer watched a card clipped to nothing, which never intersects. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019C67htt6KV7fmxsGCf5FR7
Wide screens get their own layout in the same app and URL: - 1024px and up: sidebar nav, centred content, Today split into a main column (rings, meals, food log) and a side column (water, exercise, notes, averages, weight); sheets open as centred dialogs. - 768px and up: the phone layout centred, with floating sheets. - Trends and History charts use a wider viewBox on big screens with horizontal date labels, and re-render when the window crosses a breakpoint. - The tour keeps its tooltip clear of the sidebar. Phones are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019C67htt6KV7fmxsGCf5FR7
- 6M and 1Y ranges. Past 3 months each bar is a week's daily average (weeks counted back from today), with the days logged in the tooltip. - A 7-day average kcal line on the daily ranges. - The summary adds average macros and days logged. - Wide charts show 8 date labels, and a label that would crowd the last one is left out. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019C67htt6KV7fmxsGCf5FR7
This was referenced Oct 6, 2026
- Step through date keys in UTC in getTrendsData and the 7-day average. Local setDate steps on UTC-midnight dates skipped or repeated a day when a range crossed a DST change, so 6M/1Y (and 2W-3M near a change) could drop today, skip a day or count the wrong number of days. - Include the 7-day average in the kcal axis maximum, so a high week just before the range no longer draws the line above the chart. - Read the daily targets and settings once per render instead of re-parsing them for each of up to 364 days. - Remove the unused avgStart variable. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CRtr2mPSPusKdCyJWSbct5
… < 14 MediaQueryList.addEventListener only exists from Safari 14. On older iOS Safari the top-level call threw a TypeError, which stopped every later top-level statement in the script, including the tour's visibilitychange and pagehide listeners that restore real data after the demo. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CRtr2mPSPusKdCyJWSbct5
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CRtr2mPSPusKdCyJWSbct5
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checks
index.htmlorsw.jswithout understanding the PWA cache implicationsindex.htmlhas been bumped (format:Version YYYY-MM-DD.N). Left for promotion, see notesmanifest.jsonis still valid JSON (unchanged)sw.js).nojekyll, symlinks, conflict markers)What this changes
Before: Trends went up to 3 months, one bar per day, and the summary showed only calorie averages.
After:
How:
getTrendsDays()gains 182 and 364.trendsByWeek()buckets the daily data,avg7Of()computes the rolling line, andrenderTrendsSummary()takes the daily data, so averages stay per-day in weekly mode.Testing done
Notes for reviewer
This is a draft. It goes to beta testers first via #9. Before it leaves draft it needs a version bump and a What's New and changelog entry on top of master. This builds on #6, #2 and #1, so its own change is commit f8b0c0b.
🤖 Generated with Claude Code
https://claude.ai/code/session_019C67htt6KV7fmxsGCf5FR7
Generated by Claude Code