PROTOCOL FOUR// field manual
FieldField Manual
SystemsSystems
AssetsAssets
Field Manual/You
06 / 14

You

The mirror, weekly

StatsProfileReanimated

Overview

The headline at the top is dynamically generated from the agent's actual numbers — buildHeadline returns one of: 'Clean slate' for a fresh week, 'X day streak' for ≥7 days, 'Strong week' for ≥80% completion, 'Building' for ≥50%, or 'Early days' as the fallback. Below that, five numbered sections — THIS WEEK, DAILY AVERAGE, STREAK, ON THE BOARD NOW, ALL TIME — each fading in with a staggered delay. Every row in THIS WEEK has a delta hint against last week ('+3 vs last week' in sage, '−2 vs last week' in error red). The header has Friends and Settings links, and the NotificationsBell.

How it works

1

`insights.getWeeklyInsights` is a single Convex query that returns this week, last week, daily averages, streak (current + personal best), a snapshot, and all-time totals. It does the math server-side so the client only renders.

2

Tabs are rendered as a row of pressables with an underline indicator that animates between tabs. We measure each tab's `onLayout` and animate `indicatorLeft` between their midpoints. The indicator width is fixed at 120px, centered.

3

`deltaHint(current, prior, unit)` decides the comparison label and its color. New (no prior data) → sage. Flat (delta=0) → muted. Positive → sage; negative → error.

4

Each section uses Reanimated's `FadeInDown` with increasing delays — 120ms, 220ms, 320ms, 420ms, 520ms. Combined with the staggered StatRow borders, this gives the screen a cascade-in feel.

5

Tapping the avatar routes to `/edit-profile`. Tapping FRIENDS routes to `/friends`. Tapping the settings icon routes to `/settings`. The notifications bell routes to `/notifications` and reads its badge count from a `notifications.unreadCount` query.

6

Notes and Updates tabs are placeholders — both show the 'coming soon' copy. We intentionally shipped the surface before the feature so the navigation has a settled shape.

Key decisions

Stats compared against last week, not lifetime

All-time totals are easy and unsatisfying — they always go up. The interesting question is 'did I get better this week than last week?' So every primary metric has a week-over-week hint, color-coded, that surfaces motion rather than absolute size.

Headline derived from numbers, not picked manually

We could have written a hand-curated headline per week. Instead `buildHeadline` is five branches that turn the numeric state into a sentence. It's deterministic, refreshes instantly, and feels personal because the agent can guess which branch they hit.

Ship Insights, surface Notes and Updates

Notes and Updates aren't implemented yet — but leaving them out would have meant restructuring the You tab later. Including them as 'coming soon' tabs reserves the navigation slot and signals product direction.

You

Quick Reference

Routeapp/(app)/(tabs)/you.tsx
StoreConvex queries + local tab state
APIsusers.current, insights.getWeeklyInsights, notifications.unreadCount
Components
AvatarNotificationsBellSettingsIconStatRowSectionHeader
PreviousWorldNextNew Mission