Repository navigation
Offer new users the targets wizard once - #5
Merged
Merged
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
Adds tests/smoke.spec.js and tests/playwright.config.js, run in CI by .github/workflows/test.yml on Chromium (Galaxy S8, Pixel 7, 320x568, Desktop 1440x900) and WebKit (iPhone SE, iPhone 15 Pro Max, iPad Mini). Each test blocks all non-localhost requests and the service worker, and fails on any uncaught page error. Coverage: - fresh load: welcome screen shown, no horizontal overflow, nav on screen - tour demo data is removed afterwards and never replaces real data - every nav tab opens its view without overflow - Quick Add shows on Today, updates the calorie total, survives reload - sheet primary buttons are not covered by the bottom nav - export JSON, wipe storage, import JSON restores the log The History calendar test is marked test.fail(): its "Jump to Today" button sits behind the bottom nav on every device (the date-modal has an inline padding-bottom that overrides the 7 Sep fix). MT_BROWSERS picks engines (default chromium,webkit). No app code changed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019C67htt6KV7fmxsGCf5FR7
checkOnboarding() looked for any daily targets, but recordTodayTargets() saves the defaults for today on every launch before it runs, so the wizard never opened and new users started on 2500 kcal. It now treats saved settings, targets from an earlier day or logged data as a returning user, offers the wizard once (also after Skip Tutorial), and remembers that it did. Smoke tests: the tour and import tests expect the wizard and close it, and a new test checks it opens once. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019C67htt6KV7fmxsGCf5FR7
The bug was fixed in v2026-10-06.2, so the test passes. knownBug now takes a description for any scenario marked as failing later. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019C67htt6KV7fmxsGCf5FR7
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019C67htt6KV7fmxsGCf5FR7
4 of 5 tasks
checkOnboarding() runs synchronously in the init block, but openTDEEWizard() assigns obActivityMult, obGoalAdj and obDietType, which are let-declared further down the script. When the wizard is offered at launch (tour finished or skipped earlier the same day on an older version, nothing logged, no settings saved) this threw a ReferenceError that stopped the rest of the script: the wizard never opened but was marked as offered, and Trends, Recalculate targets, the tour and its demo-data cleanup listeners were broken for that session. The launch-time check now runs after the script has finished. A smoke test covers the launch path. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CRtr2mPSPusKdCyJWSbct5
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), now2026-10-06.3in both filesmanifest.jsonis still valid JSON (unchanged)sw.jsother than the version).nojekyll, symlinks, conflict markers)What this changes
Before: the targets wizard never opened by itself, so every new user started on the default 2,500 kcal.
recordTodayTargets()saves the defaults for today on every launch, andcheckOnboarding()ran after it and found them. It has been like this since the first commit.After: a new user is offered the wizard once, after the tour or after Skip Tutorial. Returning users never see it. A returning user is anyone with saved settings, targets from an earlier day, or logged data. It never opens while the tour's demo data is active.
How:
checkOnboarding()uses the checks above instead of "any targets exist", and setsmt_onboarding_offeredonce it has offered the wizard.tourSkip()calls it too. Also bumps the version to2026-10-06.3and updates What's New and the changelog.Testing done
Notes for reviewer
This builds on #4, #2 and #1. Merge those first; this PR's own changes are commits c4ab1e7 and 41b0f70.
🤖 Generated with Claude Code
https://claude.ai/code/session_019C67htt6KV7fmxsGCf5FR7
Generated by Claude Code