# Travel day

*Flight, gate, when to leave and the ride, as one live widget.*

**Type: [Glance](types/glance.md).** One thing worth knowing right now, at a glance. This is one good use of it; the same widget serves your day, what's useful where you are, flight or train status, what your agents did overnight and more. Switch the subject when something else matters more.

Template id `travel-day` · Informative · uses Location, Calendar · for: Agents with email access (to find the booking).

## Goal

Travel day runs itself.

## When to offer it

The user has a flight or train booking in their email.

## What the user gets

- Flight status, gate and boarding time
- When to leave for the airport, with the ride
- Changes on its own when the flight does

## What each size shows

- **Small**: metric: Gate = C12.
- **Medium**: metric: Gate = C12; text (body): "Boards 7:40 · on time"; buttons: Check in (`checkin`), Ride at 5:45 (`ride`).
- **Large**: metric: Gate = C12; text (body): "Boards 7:40 · on time"; list: Plan (3 rows); buttons: Check in (`checkin`), Ride at 5:45 (`ride`).
- **Lock Screen**: inline "UA 1557 boards 7:40".

## 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 **blue**. To restyle a widget you already saved, send only the look:

```json
{"slug": "travel-day", "look": {"style": "bold", "accent": "blue", "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:

- Airport buffer
- Wake-up alarm

**Search words:** flight, airport, travel, trip, boarding, gate, check in, train.


## Before you build

- Check `droplet_get_phone_context`: the phone must share location, calendar. If something is off, ask the user to turn it on in Droplet.ai, Settings, Phone access.
- You need: Agents with email access (to find the booking).
- Ask once: Before booking anything.

## Fill it with real data

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

| Block | Real value |
|---|---|
| 0 · metric | The gate (or 'TBA'). |
| 1 · text | Boarding time and status in under 25 characters. |
| 2 · buttons | `checkin` url = the airline's check-in page; keep id `ride` with the pickup time in the label. |
| 3 · list | The plan: leave time, alarm, seat, bags. |

Sources:
- The booking from email; live status, gate and delays from the airline or a flight API.
- Leave time from travel time to the airport plus 2 h domestic / 3 h international.

## 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": "travel-day",
  "title": "UA 1557 to SFO",
  "symbol": "airplane",
  "accent": "#0A84FF",
  "blocks": [
    {"type": "metric", "label": "Gate", "value": "C12"},
    {"type": "text", "text": "Boards 7:40 · on time", "style": "body"},
    {"type": "buttons", "items": [{"id": "checkin", "label": "Check in", "symbol": "checkmark.seal.fill", "url": "https://www.united.com/"}, {"id": "ride", "label": "Ride at 5:45", "symbol": "car.fill"}]},
    {"type": "list", "title": "Plan", "items": [{"title": "Leave home 5:45 AM"}, {"title": "Alarm set for 5:00 AM"}, {"title": "Seat 14C · bag checked"}]}
  ],
  "sizes": {"medium": [0, 1, 2], "large": [0, 1, 3, 2]},
  "lock": {"inline": "UA 1557 boards 7:40", "circular": 0}
}
```

## Keep it fresh

Every 30 min on travel day (droplet_schedule with the flight API), immediately on a delay or gate change.

## 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.

**Check in** opens `https://www.united.com/` directly; no event. Put the user's real link there.

**Ride at 5:45** (`ride`)

```json
{"widget": "travel-day", "kind": "button", "target": "ride", "value": {"label": "Ride at 5:45"}}
```

Price the ride, droplet_ask 'Book Uber to JFK, $58, pickup 5:45?' and book on yes.

## Ask first

Before booking anything.

For example:

```json
{"question": "Book an Uber to JFK, $58, pickup 5:45?", "kind": "decision", "options": ["Book it", "I'll drive"], "risk": "medium"}
```

## Phone actions

Offer an alarm (droplet_phone_action alarm) for the wake-up time; tell them it's set.

```json
{"kind": "alarm", "params": {"time": "05:00", "label": "Flight to SFO"}}
```

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

## Edge cases

- Delay: update the times and the leave time; notify only if they asked.
- Gate change: update at once.
- After landing: switch to the hotel/next plan or clear it.

## Never

Delay = update the widget, notify only if they asked for alerts.

## 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

- [Your day](day-brief.md): What you need to know, changing through the day: how you slept, what's first, what's left.
- [Here and now](here-now.md): What's useful where you are: your meetings at work, what's nearby when you're out, tomorrow when you're home.
- [While you slept](overnight.md): What your agents finished overnight, and the one thing that needs you.
- [Usage spike](usage-spike.md): A bill is about to jump. Your agent found out why and how to stop it.
