Skip to content

feat(phase-2): discovery rows, social feed, achievements, workout & strength tracking - #225

Merged
Eliaaazzz merged 3 commits into
mainfrom
feat/phase-2-discovery-social-tracking
Jun 28, 2026
Merged

feat(phase-2): discovery rows, social feed, achievements, workout & strength tracking#225
Eliaaazzz merged 3 commits into
mainfrom
feat/phase-2-discovery-social-tracking

Conversation

@Eliaaazzz

Copy link
Copy Markdown
Owner

Summary

Phase 2 mobile-first features inspired by Uber Eats (discovery-first) and Strava (achievement + social), plus the mobile YouTube playback fix and image-perf work discussed earlier in the session.

14 new features, 14 new components, 4 new Zustand stores, 3 new hooks. No backend schema changes — everything piggybacks on existing endpoints (meal-history, weekly-insights, recipes/search-text, recommendations).

What's in this PR

Mobile perf & playback fixes

  • YouTubePlayerModal now uses react-native-youtube-iframe (already in package.json) with ID validation, watchdog timeout, error UI, and Linking fallback to the YouTube app — fixes the silent infinite-spinner.
  • WorkoutCard + RecipeImage (native branch) migrated to expo-image (memory+disk cache, transition).
  • Downgrade YouTube thumbs to mqdefault on native; prefetch top 6 thumbs on Workouts/Recipes screens.
  • keepPreviousData on recommended hooks so tab switches don't flash empty.

Phase 2 features (Recipes)

  • F1 — Discovery Rows: 5 themed horizontal carousels (Recommended / Quick ≤20min / High protein / Trending / Plant-forward) replace the flat grid. HorizontalRecipeRow + useRecipesByTag.
  • F2 — Smart Filter Chips: sticky chip bar with 6 multi-select filters (≤20min, ≤500cal, High protein, Vegan, Budget, Saved) drives all rows client-side. FilterChipBar.
  • F4 — Bottom-sheet detail: DetailBottomSheet primitive (slide-up modal w/ backdrop + drag handle); RecipeCard exposes onOpenDetail so taps open a sheet instead of pushing a route.

Phase 2 features (Home dashboard)

  • F3 — Log Again: LogAgainCard surfaces last 7 days' meals (deduped to 3 most-recent unique names); useReLogMeal mutation re-logs at today's timestamp.
  • F5 — Adaptive Home Hero: AdaptiveHomeHero morphs by time-of-day (morning / afternoon / evening / night) with personalized copy + CTA.
  • F6 — Achievements V2: 8-badge wall (AchievementsCard) auto-derived from existing data via useAchievements. Tap-to-detail sheet.
  • F8 — Weekly Summary: WeeklySummaryCard w/ totals, on-target days, PRs + native Share.
  • F9 — Friends Feed: FriendsFeedCard + useSocialStore (Zustand, persisted) with mock seed, kudos toggle, per-activity privacy flags. Drop-in replacement when a real backend feed lands.
  • F10 — Challenges: ChallengesCard + useChallengeStore (persisted) with 4 templates (protein 5/7, breakfast 7-day, 4-in-14, calories in-range 10/30) — progress bars + XP rewards.

Phase 2 features (Workouts)

  • F11 — In-Workout Timer + Live Strip: useWorkoutSessionStore + floating WorkoutSessionStrip mounted at navigator root (persists across tab switches). WorkoutCard gets a 'Start' button.
  • F12 — Strength Sessions: StrengthLogModal with sets/reps/weight steppers + useStrengthLogStore with Epley 1RM auto-PR detection. New 'Log strength' FAB.

Phase 2 features (Profile)

  • F7 — Personal Records: PersonalRecordsCard + usePersonalRecords (longest streak, protein PR, most meals, on-target days, cleanest sodium).
  • F13 — Consistency Heatmap: GitHub-style 12-week grid (ConsistencyHeatmap) + useConsistencyCells.
  • F14 — Day History: tap any heatmap cell → DayHistorySheet showing that day's meals + strength sessions + score.

Files

New components (14): AchievementsCard, AdaptiveHomeHero, ChallengesCard, ConsistencyHeatmap, DayHistorySheet, DetailBottomSheet, FilterChipBar, FriendsFeedCard, HorizontalRecipeRow, LogAgainCard, PersonalRecordsCard, StrengthLogModal, WeeklySummaryCard, WorkoutSessionStrip

New stores (4): useSocialStore, useChallengeStore, useWorkoutSessionStore, useStrengthLogStore

New hooks (3): useAchievements, usePersonalRecords, useConsistencyCells

Modified: RecipesScreen, DashboardScreen, WorkoutsScreen, ProfileScreen, RecipeCard, WorkoutCard, RecipeImage, YouTubePlayerModal, AppNavigator, useMealHistory, services/hooks, two index files

Design constraints honored

  • Glass-morphism + orange (#F97316) / violet-dark (#A78BFA) system.
  • Each new component carries an inline reference to the inspiration source per CLAUDE.md.
  • Core actions still ≤3 taps from Home.
  • AI-generated content carries the existing disclaimer pattern.

Test plan

  • cd frontend && npm install (pulls expo-image + react-native-youtube-iframe which were declared but not installed in this branch).
  • npx tsc --noEmit is clean.
  • npx expo start and verify on iOS + Android:
    • Recipes: see 5 carousels, chip bar multi-select filters every row, tap a card → bottom sheet
    • Home: time-of-day hero, log-again row, achievements badges, weekly summary share button, friends feed kudos, challenges join/leave
    • Workouts: tap 'Start' → floating black session pill appears and persists across tab switches; pause/resume/finish. 'Log strength' FAB → sets table modal works end-to-end
    • Profile: PR grid, heatmap renders, tap any cell → day history sheet
  • YouTube playback works on at least 5 different workout videos; deliberately-broken video ID shows the error UI with 'Open in YouTube' fallback
  • No new red-screen errors in Metro logs

Out of scope (deliberately)

  • Backend endpoints for friends, kudos, challenges, strength sessions — the Zustand stores expose stable APIs that a real backend can later replace.
  • Push notifications for weekly summary / challenge completion.
  • Map view on workouts (Strava parity item 5.3 — separate effort).

…ength tracking

Phase 2 mobile-first features inspired by Uber Eats (discovery) and Strava
(achievement + social). Plus mobile YouTube playback fix and image perf work
already discussed.

Mobile perf & playback (carried from earlier in branch):
- Rewire YouTubePlayerModal to react-native-youtube-iframe with ID validation,
  watchdog timeout, error UI, and Linking fallback to the YouTube app.
- Swap RN Image for expo-image (memory+disk cache, transition) in WorkoutCard
  and RecipeImage (native branch). Web paths untouched.
- Downgrade YouTube thumbs to mqdefault on native; prefetch first 6 thumbs on
  Workouts/Recipes screens. keepPreviousData on recommended hooks.

F1 — Recipe Discovery Rows: HorizontalRecipeRow component + useRecipesByTag
hook; five themed carousels (Recommended, Quick, High protein, Trending,
Plant-forward) replace the flat grid on Recipes.

F2 — Smart Filter Chips: FilterChipBar with six multi-select chips (time, kcal,
protein, diet, budget, saved) filters every row client-side.

F3 — Log Again: LogAgainCard on Home dashboard surfaces last 7 days' meals,
deduped to 3 most-recent unique names; useReLogMeal mutation re-logs at today's
timestamp.

F4 — Bottom-sheet detail pattern: reusable DetailBottomSheet primitive (slide-up
modal w/ backdrop + drag handle); RecipeCard exposes onOpenDetail prop.

F5 — Adaptive Home Hero: AdaptiveHomeHero morphs by time-of-day (morning /
afternoon / evening / night) with personalized copy and CTAs.

F6 — Achievements V2: AchievementsCard badge wall + useAchievements hook
deriving 8 badges from existing data (streak, protein, veggies, cardio,
hydration, macro mastery). Tap-to-detail sheet.

F7 — Personal Records: PersonalRecordsCard + usePersonalRecords hook on Profile
(longest streak, protein PR, most meals, on-target days, cleanest sodium).

F8 — Weekly Summary: WeeklySummaryCard with totals, on-target days, PRs;
native Share with formatted week recap.

F9 — Friends & Activity Feed: FriendsFeedCard + useSocialStore (persistent,
Zustand) with mock seed, kudos toggle, privacy flags per activity type. Ready
to swap to a real backend feed endpoint when it lands.

F10 — Challenges: ChallengesCard + useChallengeStore (persistent) with 4
templates (protein 5/7, breakfast 7, 4-in-14, calories in-range 10/30), progress
bars, XP rewards.

F11 — In-Workout Timer + Live Status Strip: useWorkoutSessionStore + floating
WorkoutSessionStrip mounted at navigator root (persists across tabs).
WorkoutCard gets a 'Start' button.

F12 — Strength Sessions: StrengthLogModal w/ sets/reps/weight steppers +
useStrengthLogStore with auto-PR detection via Epley 1RM. New 'Log strength'
FAB on Workouts.

F13 — Consistency Heatmap: ConsistencyHeatmap (GitHub-style 12-week grid) +
useConsistencyCells hook on Profile.

F14 — Day History: DayHistorySheet opens from any heatmap cell, shows that
day's meals, strength sessions, and day score.

Notes:
- All UI follows the project's glass + orange/violet design system.
- No backend schema changes; everything piggybacks on existing endpoints
  (meal-history, weekly-insights, recipes search, recommendations).
- Local-only stores (social, challenges, strength, workout session) use Zustand
  + AsyncStorage. They expose stable APIs so a real backend can replace them
  later without touching components.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 19, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
aurafit fb1bdee Jun 28 2026, 09:57 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 19, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
aurafitness fb1bdee Jun 28 2026, 09:58 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 19, 2026

Copy link
Copy Markdown

Deploying aurafitness-2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: fb1bdee
Status:🚫  Build failed.

View logs

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 19, 2026

Copy link
Copy Markdown

Deploying aurafitness with  Cloudflare Pages  Cloudflare Pages

Latest commit: fb1bdee
Status:🚫  Build failed.

View logs

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 19, 2026

Copy link
Copy Markdown

Deploying aurafitness-1 with  Cloudflare Pages  Cloudflare Pages

Latest commit: fb1bdee
Status:⚡️  Build in progress...

View logs

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive suite of new features and UI components aimed at enhancing user engagement through gamification and social interaction. Key additions include an adaptive home hero card, a "Log Again" feature for quick meal entry, a Strava-style achievement and personal records system, joinable challenges, and a social feed with kudos. Technical improvements include the adoption of expo-image for optimized image caching, a new workout session tracking system with a persistent UI strip, and a GitHub-style consistency heatmap. The screens for Dashboard, Profile, Recipes, and Workouts have been significantly updated to integrate these new capabilities. I have no feedback to provide.

… Redis L2) as lookup fallback

When the local food_nutrition table misses, fall back to the USDA FoodData Central API,
cached two-level: in-process Caffeine (hot, recurring food vocab) + optional shared Redis
(cross-instance, survives Cloud Run churn). Redis is optional/null-safe. Honest scope: density/
nutrition lookups, not the vision call. Tests: cache L1/L2/miss/redis-absent, client JSON parse,
local-hit-skips-USDA.
…DAR) devices

Adds ARScaleModule (native iOS) + useARScale hook: on ARKit devices without a depth sensor,
raycast frame-center to a horizontal plane for camera-to-table distance -> img_w_cm, the same
scale signal the LiDAR frame-processor emits (tier between LiDAR +-1cm and plate fallback +-5cm).
Degrades to plate fallback when the native module is absent (never fabricates scale). Reference
template -- ARKit raycasting needs a real device; capture-screen AR view wiring documented in README.
@Eliaaazzz
Eliaaazzz merged commit a0d1283 into main Jun 28, 2026
1 of 6 checks passed
Eliaaazzz added a commit that referenced this pull request Jul 1, 2026
Reconcile with #225 (phase-2 discovery/social/tracking, already on main).
Conflicts (all phase-2, taken from main as canonical):
- DashboardScreen: username -> profile.displayName
- DetailBottomSheet: onClose optional -> required
- application.yml: keep the new gemini thinking-budget + nutrition.physics-refine block
Eliaaazzz added a commit that referenced this pull request Jul 1, 2026
- DashboardScreen: currentUser.data.username (UserProfileResponse has no
  displayName field, so #225's profile.displayName does not type-check).
- DetailBottomSheet: onClose optional so the (title || onClose) guard compiles.

Frontend tsc + 100 jest green; backend suite green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant