Help centre Families Coaches Support

Littles Baby Tracker

Help for families and coaches

Site Tools


technical:features:05_family_home

05 — Family home

Technical reference. For task-based help, see the corresponding user guide.
Documentation status: complete for the current implementation

Reviewed: 2026-07-21

Primary users: family members and authorized coaches viewing a family

Surfaces: mobile web app and platform API

Purpose

Family Home is the launch point for daily baby care. It identifies the selected baby, presents the seven trackers, summarizes the latest log of each type, shows a date-grouped recent timeline and surfaces invitations, allergy ladders, timers, branding and app-update state without forcing the user through multiple screens.

Entry points

Context Route
Family self-mode /family
Coach phone view-as /coach/families/:familyId/view-as with optional babyId query

The family side menu supplies capability- and rollout-dependent routes to Analysis, Reminders, Messages, Questionnaires, Sleep Plans, Allergy Ladders, Access/Subscription, guides, settings and support. Artifact rows are shown only when the linked family has eligible content. A dormant Session Prep destination also exists in the menu model, but family self-mode currently points it to the coach roster route and therefore does not provide a usable family journey; Session Prep remains the coach workflow documented in Feature 18.

Screen structure

Header and selected baby

  1. A time-of-day greeting uses the family's/actor's first name.
  2. The selected baby's name and authorized private image appear in the hero.
  3. Connected-practice branding can replace/decorate the default hero artwork.
  4. Family self-mode can tap the baby avatar to edit it; coach view-as shows the baby but disables that shortcut.
  5. A dual-role coach/family can return to the coach workspace from the family menu.

Activity grid

The grid links to Breastfeed, Bottles, Sleep, Nappies, Pumping, Medication and Solids. Each visible card shows either No logs yet or the relative age of the most recent matching log for the selected baby. Range activities use their end time for “Last ended”; instantaneous activities use their log time.

The chosen baby ID is carried into coach view-as tracking routes so changing babies never silently opens another child's data.

Allergy ladder bubble

The optional bubble opens the selected baby's Allergy Ladders. A family can hide it directly or manage it with the other home preferences. A coach viewing the family sees the saved choice but cannot change it.

Latest activity

  1. Recent records are filtered to the selected baby, sorted newest first and grouped by the family-local date.
  2. Headings use Today, Yesterday, or a calendar date.
  3. Each row shows tracker type, local time, a compact tracker-specific detail and an 80-character note preview.
  4. Sleep rows are attributed to their sleep/statistics day, including overnight sleep, and each group shows an authoritative Total Sleep duration.
  5. The initial page comes from the family summary; Load more activity uses cursor pagination in pages of ten.
  6. Selecting a row opens the shared edit sheet. Save/delete availability follows the subject permission and external-update conflict rules in Feature 07.

Home personalisation

Choose Activities contains one switch for each tracker plus the Allergy Ladder bubble. All are enabled for a new/default profile. Turning a tracker off removes its shortcut from Home and from the matching Analysis navigation; it does not delete existing logs or disable the tracker API.

The form saves the complete current visibility map to PATCH /families/me/home-preferences. If all trackers are hidden, Home explains how to add activities back. Preferences are family self-service and cannot be changed from coach view-as.

Invitations, timers and app updates

  1. Pending coach invitations load shortly after the core home summary so they do not delay first paint. Each card requires consent before acceptance and also supports decline.
  2. Active Breastfeed, Sleep and Pumping timers are restored from the authoritative summary and appear through the global floating timer interface described in Feature 08.
  3. When the native release loader reports an installed update ready to activate, the hero shows Update; selecting it restarts into the verified build.
  4. These controls are not shown in coach view-as where they would mutate the family's account-level state.

Loading, cache and realtime behavior

  1. If a cached family summary exists, the screen renders it immediately and refreshes from the API.
  2. A timeout/failure with usable cached data shows Showing cached data and a Retry button; an authorization/client error that invalidates the cache clears protected content instead.
  3. Realtime activity/timer changes trigger a fresh summary. If an activity is being edited, refresh is deferred and the app verifies whether that record changed before allowing a save.
  4. Signed baby-image URLs are cached only until shortly before expiry. A failed image load clears the cached URL, retries once, then falls back to the baby icon.
  5. Initial summary, activity, image and invitation failures have separate states so one optional panel cannot blank the whole home screen.

Coach view-as differences

  1. A persistent banner names the family, displays the family timezone and provides Exit view.
  2. Baby switching is route-local for the viewed family instead of changing the family's saved selected-baby preference.
  3. Invitation handling, home-preference editing, account controls and app update actions are absent.
  4. An authorized coach may see a private baby note card; the note is coach-private and is not merged into family-authored data.
  5. Data reads and any permitted log edits still go through the assignment-scoped platform API.

Validation and user-visible states

State Expected behavior
First load Show hero, card and timeline skeletons without exposing stale data from another family.
No baby Keep the workspace safe and direct the family to add a baby from the menu.
No tracker logs Show No logs yet per card and a clear empty timeline.
All shortcuts hidden Show the home-grid recovery message; retain the underlying logs.
More history loading fails Keep loaded rows and show a retryable error below them.
Cached refresh fails Keep authorized cached content, label it stale and offer Retry.
External edit arrives Block overwrite until the activity is reloaded or the edit is closed.
Coach view ends/expires Platform authorization denies further family reads and the app exits/blocks the view.

Platform API contract

Method and path Role
GET /families/me Family summary: subject/access, selected baby, babies, recent/latest activities, preferences, premium and active timers.
GET /activities Cursor-paginated recent activity and complete sleep totals for visible dates.
PATCH /families/me/home-preferences Save tracker visibility and allergy-bubble preference.
PATCH /families/me/selected-baby Persist family self-mode selected baby.
GET /families/me/invitations Load family pending invitations.
POST /families/me/invitations/:id/accept Accept after consent.
POST /families/me/invitations/:id/decline Decline a pending invitation.
POST /files/signed-download-url Resolve an authorized baby/practice image for display.

Coach view-as obtains the equivalent family summary and activity list using an explicit familyUserId subject. The server resolves the assignment and permissions; the query parameter itself grants nothing.

Authorization rules

  1. Family self-mode can manage its home preferences and saved selected baby.
  2. Coach view-as is always an actor/subject context and requires a current authorized assignment.
  3. Client hiding is presentation only. Every family summary, log, note and image read is separately authorized by the API.
  4. Premium inactivity does not hide or disable the tracker grid.
  5. Cached content is keyed to API/auth/subject identity to prevent cross-account reuse.

Acceptance checklist

  1. Home displays the correct selected baby and latest log per visible tracker.
  2. Tracker visibility and allergy-bubble choices persist after reload without deleting history.
  3. Recent rows are grouped using the family timezone and show authoritative sleep totals.
  4. Pagination appends without duplicates and preserves loaded content on failure.
  5. Pending invitations require consent and disappear after accept/decline refresh.
  6. Cached data is visibly labelled when refresh fails and protected cache is cleared on authorization failure.
  7. Coach view-as names the subject, preserves route-local baby choice and excludes family account controls.

Source evidence

  • mobile-web/src/routes/FamilyDashboard.tsx
  • mobile-web/src/components/FamilySideMenu.tsx
  • mobile-web/src/components/ManageHomeActivitiesModal.tsx
  • mobile-web/src/utils/selected-baby.ts
  • mobile-web/src/realtime/use-resource-realtime-refresh.ts
  • mobile-web/src/api/client.ts
  • platform/apps/api/src/routes/family-routes.ts
  • platform/apps/api/src/services/family-service.ts
  • platform/packages/shared/src/family.ts
  • platform/docs/multi-tenancy/06-existing-app-feature-inventory.md