# Gym session

Today's lifts as a checklist the user ticks between sets, with a ring for active calories from the phone.

**Sizes:** small (the ring), medium (ring on the left, lifts on the right), large (ring, lifts, a note)
**Interaction:** checklist (works with no agent running)
**Freshness:** your agent during the session, from the phone's Health data; the ticks need nothing

## Widget

```json
{
  "slug": "gym",
  "title": "Gym session",
  "symbol": "figure.strengthtraining.traditional",
  "accent": "#FF9F0A",
  "blocks": [
    { "type": "gauge", "label": "Active kcal", "value": 180, "max": 600, "text": "180" },
    { "type": "checklist", "title": "Today's lifts", "items": [
      { "title": "Bench press 3x8", "done": true },
      { "title": "Squats 3x8", "done": false },
      { "title": "Deadlift 3x5", "done": false },
      { "title": "Pull-ups 3x10", "done": false }
    ] },
    { "type": "text", "style": "caption", "text": "Rest 90 s between sets." }
  ],
  "sizes": { "small": [0], "large": [0, 1, 2] },
  "lock": { "circular": 0, "inline": "Gym: 1 of 4 lifts" }
}
```

Medium has no `sizes`, so it uses the split layout: the ring (77 pt with its label) on the left, the four lifts (82 pt) on the right. Next to a number, item titles fit about 23 characters.

## During the session

```javascript
const ctx = await droplet_get_phone_context();
const kcal = ctx.health?.active_kcal_today;          // the whole day so far, not just this session
const { widgets } = await droplet_list_widgets();
const current = widgets.find((w) => w.slug === "gym");

await droplet_set_widget({
  slug: "gym",
  title: "Gym session",
  blocks: [
    kcal === undefined
      ? { type: "gauge", label: "Active kcal", value: 0, max: 600, text: "–" }
      : { type: "gauge", label: "Active kcal", value: kcal, max: 600, text: String(kcal) },
    current.blocks[1],                                // the lifts, with the user's ticks
    current.blocks[2],
  ],
});
```

The phone shares `active_kcal_today`, `exercise_min_today`, `steps_today`, last night's sleep and resting heart rate. It doesn't share live heart rate or workouts, so don't show them.

## After the session

```json
{
  "slug": "gym",
  "title": "Gym session",
  "blocks": [
    { "type": "metric", "label": "Active kcal", "value": "487" },
    { "type": "metric", "label": "Lifts", "value": "4 of 4" },
    { "type": "text", "text": "Session done in 52 min. Rest day tomorrow; I moved Thursday's run to Friday." },
    { "type": "list", "items": ["Bench press 3x8", "Squats 3x8", "Deadlift 3x5", "Pull-ups 3x10"] }
  ],
  "sizes": { "small": [0], "medium": [0, 1, 2], "large": [0, 1, 2, 3] },
  "lock": { "circular": 0, "inline": "Gym: done, 487 kcal" }
}
```

Medium: the two numbers side by side (41 pt) and the summary sentence, which is long enough to span the width. Large adds the lifts you did.
