# Gym session

*Your workout, a live set counter and the rest timer.*

**Type: [Checklist](types/checklist.md).** Things to do, ticked on the widget, with a ring that counts. This is one good use of it; the same widget serves smart to-do, what only the user can do, a workout at the gym, groceries at the store and more. Switch the subject when something else matters more.

Template id `gym-session` · Full GUI · uses Location, Health · for: Any agent.

## Goal

The user trains without a notebook or an app to open.

## When to offer it

The user trains with a program. Offer a version that only shows at the gym (place) or on training days.

## What the user gets

- Today's plan, built from your last sessions
- Tick sets, the ring counts them
- Rest timer and logging in one tap

## What each size shows

- **Small**: ring counting ticked items.
- **Medium**: ring counting ticked items; checklist of 4 items.
- **Large**: ring counting ticked items; checklist of 4 items; buttons: Rest 90s (`rest`), Log it (`log`).
- **Lock Screen**: inline "Push day: 4 exercises".

## Make it theirs

**Look.** Send `look` instead of `theme` and `accent`; every combination is designed to read well:

- `style`: `glass` (default: see-through, adapts to dark mode), `soft` (a calm pale tint) or `bold` (a vivid gradient with dark buttons).
- `accent`: blue, indigo, purple, pink, red, orange, green, teal, graphite, or a hex.
- `font`: default, rounded, serif or mono.

This template's own accent is **orange**. To restyle a widget you already saved, send only the look:

```json
{"slug": "gym-session", "look": {"style": "bold", "accent": "orange", "font": "rounded"}}
```

Preview a look without saving: `droplet_preview_widget` with the slug and `look`. When the user says "make it greener", "calmer" or "bolder", change the look; keep the content.

**Their choices.** Ask once (droplet_ask) or use what you know:

- Training days
- Rest timer length
- Program

**Search words:** gym, workout, sets, reps, training, exercise, fitness, rest timer.


## Before you build

- Check `droplet_get_phone_context`: the phone must share location, health. If something is off, ask the user to turn it on in Droplet.ai, Settings, Phone access.
- You need: Any agent.
- Ask once: Ask once which days they train.

## Fill it with real data

Start from the template (`droplet_library` with `id: "gym-session"`), keep the design, and replace each sample value:

| Block | Real value |
|---|---|
| 0 · gauge | Leave as `count: "checked"`. |
| 1 · checklist | Today's exercises with sets × reps @ weight, progressed from the last session. |
| 2 · buttons | Keep ids `rest` and `log`. |

Sources:
- The plan from their program and last session (progress the weight when they hit all reps).
- Version by place: show this when place is 'gym', a summary elsewhere.

## The widget

Sample values; send it with `droplet_set_widget` on your widget's slug (or a new slug with `new_widget: true` if the user asked for a separate widget). Preview it and fix every warning first.

```json
{
  "slug": "gym-session",
  "title": "Push day",
  "symbol": "dumbbell.fill",
  "accent": "#FF9F0A",
  "blocks": [
    {"type": "gauge", "label": "Sets", "count": "checked"},
    {"type": "checklist", "items": ["Bench 4×8 @ 70 kg", "Incline DB 3×10", "Dips 3×12", "Cable fly 3×15"]},
    {"type": "buttons", "items": [{"id": "rest", "label": "Rest 90s", "symbol": "timer"}, {"id": "log", "label": "Log it", "symbol": "square.and.arrow.down.fill"}]}
  ],
  "sizes": {"small": [0], "medium": [0, 1], "large": [0, 1, 2]},
  "lock": {"inline": "Push day: 4 exercises", "circular": 0}
}
```

## Keep it fresh

Before each session; versions handle place on the phone.

## Handle the taps

Each tap reaches you once on `droplet_get_events` (keep a waker running, SKILL.md Process C). Answer within seconds by updating the widget.

**Rest 90s** (`rest`)

```json
{"widget": "gym-session", "kind": "button", "target": "rest", "value": {"label": "Rest 90s"}}
```

droplet_phone_action timer 90 seconds (label 'Rest'). Show 'Resting…'.

**Log it** (`log`)

```json
{"widget": "gym-session", "kind": "button", "target": "log", "value": {"label": "Log it"}}
```

Save the ticked sets to their training log, show 'Logged. Next: Pull day Thu' and reset with reset_checklists: true next time.

## Ask first

Ask once which days they train.

For example:

```json
{"question": "Which days do you train?", "kind": "choice", "options": ["Mon Wed Fri", "Tue Thu Sat", "Every weekday"], "risk": "low"}
```

## Phone actions

timer for rest.

```json
{"kind": "timer", "params": {"seconds": 90, "label": "Rest"}}
```

Send it with `droplet_phone_action` and tell the user what you set.

## Edge cases

- Rest day: a version that shows the next session instead.
- They skip an exercise: don't progress its weight next time.
- No 'timers' in the phone's can list: leave out `rest`.

## Never

None.

## Done when

- [ ] Every sample value is replaced with real data (no "Dr. Lee" on a real widget).
- [ ] `droplet_preview_widget` shows no warnings at the sizes the user placed (`placed` in `droplet_whoami`).
- [ ] Every button has a handler and a waker is running.
- [ ] Refresh is set up as above.
- [ ] You told the user in one line what it does on its own and what it asks first.

## Same widget, other uses

- [Smart to-do](smart-todo.md): A to-do list that knows where you are, what time it is, and what you meant to do.
- [Grocery run](grocery-run.md): A list that fills itself and counts down while you shop.
- [Only you can do](only-you.md): Your agent hit something it can't do. It lists exactly what it needs and carries on when you tick it.
