Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

10 - Interaction Specification (Health Module)

Interaction, state and motion details for the Health surfaces. Shared interaction/motion language in 00-shared/08. Screens (proposed); the endpoint interaction contract is implemented and quoted.


1. Endpoint interaction contract (implemented)

AspectSpecSource
RequestGET /api/v1/health - no params, no body, no headers beyond standardhealth.controller.ts:27-37
Authnone - @Public() skips JWT/RBAC guardshealth.controller.ts:15, app.module.ts:129-131
Rate limit30 req/min sliding window, Redis-backedhealth.controller.ts:16, rate-limit.constants.ts:4
Success200, envelope-wrapped Terminus resultresponse-envelope.interceptor.ts:47-60
Failure503, error envelope; 429 when rate-cappedhttp-exception.filter.ts:56-58, 73-81
Latencyas fast as the slowest dependency probe; no timeout inside the check itself (non-goal, 01 §5)health.controller.ts:31-36

2. S1 screen interactions (proposed)

#InteractionSpec
I1Enter screenimmediate fetch(); skeletons for 5 cards
I2Poll tick (30 s)silent refetch; animate only changed cards (m-fast flash)
I3Tap down-cardopen S2 sheet from cached payload (zero network)
I4Tap up-cardnothing (not a button; avoids dead-affordance taps)
I5Retry tapimmediate fetch; resets poll timer on success; disabled while in-flight; countdown during 429
I6Pull-to-refreshoptional at grid top; same as Retry (skip when I5 timer active)
I7App resume from backgroundimmediate refetch (stale rule, 07 §4)
I8OfflineAppOfflineBanner; cards show last state + "stale"; Retry stays enabled

3. State machine (S1)

stateDiagram-v2
    [*] --> Loading
    Loading --> AllUp: 200 status ok
    Loading --> PartialDown: 503 error has N<5 down keys
    Loading --> AllDown: 503 error has 5 down keys
    Loading --> Offline: network/timeout
    AllUp --> AllUp: poll tick (no change)
    AllUp --> PartialDown: poll tick
    PartialDown --> AllUp: retry/poll recovers
    PartialDown --> Offline: retry fails w/ network error
    AllUp/PartialDown/AllDown --> RateLimited: 429
    RateLimited --> AllUp/PartialDown/AllDown: countdown ends → retry
    Offline --> Loading: retry (connectivity restored)

Down-key counting: API card counts as down when the request itself is 503; dependency keys come from data.error (health.controller.spec.ts:29-35).

4. Motion map

MotionTokenUseSource
Card state flashm-fast (150 ms)status change on poll00-shared/08
Banner swapm-base (250 ms)overall verdict change00-shared/08
Sheetbottom sheet curveS2 open/close00-shared/03
Skeleton shimmerlooploading cards00-shared/08

5. Accessibility interactions

  • Retry, cards, banner: full focus traversal; cards announce button when down (06 S1 a11y).
  • Live region on banner for state changes (00-shared/09).
  • No gestures required for any core action (no swipe-to-refresh dependency - Retry button is the canonical path, 00-shared/09).