Public
Brazilian-steakhouse-style team availability board
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

Coaster

Pull up a chair. A Brazilian-steakhouse-style availability board for your team. Green = come on over. Red = catch me later.

Each person's coaster flips automatically when their iPhone/Mac Focus mode turns on or off (and since Focus can follow your calendar, this gets you calendar sync without touching any work system). Everyone's status is visible at a glance on a shared dashboard.

Rendering mermaid diagram...

How this val is laid out

FileWhat it is
main.tsThe HTTP server — dashboard, /set, and /api/state. Edit the TEAM list here.
dashboard.htmlThe board UI, served by main.ts.
scriptable-widget.jsOptional iPhone home-screen widget.

This is already deployed on your account. Your dashboard URL is the HTTP endpoint of main.ts — click the endpoint link at the top of the val to get the exact …web.val.run address, then share it with the team.

Part 1 — Configure the team (the one required edit)

In main.ts, edit the TEAM list:

  • one entry per person, short lowercase name (lauren, sam, …)
  • change every token to something random, e.g. lauren: "k9x2-mango-41". A token is that person's lightweight password for flipping their coaster.

Then privately send each teammate: the dashboard URL + their own token.

The board contains no names beyond first names and no work data — it's just red/green dots — so it's fine on an unguessable URL.

Part 2 — Each teammate's iPhone (~5 minutes each)

A. Automatic flipping via Focus (the passive magic)

Do this twice — once for Focus ON, once for Focus OFF:

  1. Open Shortcuts → Automation tab → + (New Automation).
  2. Scroll to your Focus mode (e.g. Do Not Disturb or Work).
  3. Choose When turning On, and select Run Immediately (this makes it fully automatic — no confirmation tap).
  4. New Blank Automation → add the action Get Contents of URL.
  5. Set the URL to (using your own name + token):
    https://YOUR-DASHBOARD-URL/set?user=lauren&token=YOURTOKEN&status=red
    
  6. Done. Repeat steps 1–5 with When turning Off and status=green.

Now: your Focus follows your calendar → your Focus flips your coaster → your calendar effectively drives the board, with zero work-system integration. This also covers your Mac — if Focus modes are set to "Share Across Devices" (Settings → Focus), turning Focus on from the Mac triggers the iPhone automation.

B. Drive Focus from your Outlook calendar (closes the loop)

Focus doesn't watch your calendar on its own — a small Shortcut does that. Two pieces: get your Outlook events onto the phone, then a half-hourly check.

Step 1 — Get Outlook events into Apple Calendar. Shortcuts can only see calendars that live in the built-in Calendar app; the Outlook app keeps its events siloed. In order of preference:

  1. Outlook app → Settings (gear) → tap your account → "Sync Calendars" — newer Outlook versions have this toggle, and it mirrors your work calendar into Apple Calendar with zero extra setup. Check here first.
  2. Settings → Apps → Calendar → Calendar Accounts → Add Account → Microsoft Exchange → sign in with your work email → enable just Calendars. (Same sanctioned access as the Outlook app itself.)
  3. If IT blocks both: Outlook on the web → ⚙️ → Calendar → Shared calendars → Publish a calendar → pick your calendar with "Can view when I'm busy" → copy the ICS link → iPhone Settings → Apps → Calendar → Calendar Accounts → Add Subscribed Calendar → paste. "Busy" means no titles or details leave Outlook — just blocks of time. Caveat: iOS refreshes subscribed calendars slowly (up to ~an hour), so same-day schedule changes can lag.

Step 2 — Make a "Meeting Check" shortcut. New Shortcut →

  1. Find Calendar Events where… with filters:
    • Calendar is your work calendar
    • Start Date is in the last 8 hours
    • End Date is in the next 8 hours
    • Is All Day is false
  2. If → Count → is greater than → 0
    • inside If: Set Focus → turn Work On until Turned Off
    • inside Otherwise: Set Focus → turn Work Off

(That filter combo means "an event is happening right now", and skips all-day events so a birthday doesn't mute you for the whole day.)

Step 3 — Run it on a schedule. Shortcuts → Automation → +Time of Day → 9:00 → Daily → Run Immediately → action: Run Shortcut → Meeting Check. Repeat for every half-hour you take meetings (9:00, 9:30, … 17:00). Tedious once, automatic forever.

Step 4 — there is no step 4. Your Focus ON/OFF automations from section A already flip the coaster, so calendar → Focus → coaster now runs end to end.

Two tips:

  • Point the meeting check at a dedicated Work Focus and keep Do Not Disturb for manual deep-work — then the half-hourly check never stomps a Focus you turned on yourself. Just set up the section-A automations for both Focus modes.
  • Turn on Settings → Focus → Share Across Devices so your Mac mutes during meetings too.

C. Manual flip (backup / quick toggle)

Pick whichever you like:

  • Tap your tile on the dashboard. First tap asks for your token once per device, then it's one-tap forever.
  • A "Flip Coaster" Shortcut: New Shortcut → Get Contents of URL...?user=lauren&token=YOURTOKEN&status=toggle. Add it to your home screen, Lock Screen, or Action Button.

Part 3 — Seeing everyone at a glance

  • Mac: keep the dashboard URL open in a small pinned browser tab/window. It live-updates every 15 seconds.
  • Desk signal (in-office): prop up an old iPhone/iPad showing the dashboard full-screen. Add it to the home screen first (Safari → Share → Add to Home Screen) so it opens like an app with no browser chrome. Use Settings → Display → Auto-Lock → Never (plugged in) for an all-day desk display.
  • iPhone home-screen widget: see scriptable-widget.js — shows all statuses on your home screen via the free Scriptable app.

Endpoints

MethodPathPurpose
GET/The dashboard (open on any device)
GET/set?user=lauren&token=XXX&status=redFlip a coaster (red | green | toggle)
GET/api/stateAll statuses as JSON (used by widgets)

Notes & guardrails

  • Stale-red safety net: if someone's Focus-off automation ever fails to fire, the board automatically shows them green again after 10 hours (AUTO_GREEN_AFTER_HOURS in main.ts — adjust or set to 0 to disable).
  • Changing the team: edit the TEAM list in main.ts and save. Renames and new people apply instantly.
  • It's a norm, not a lock. Agree as a team what red means ("ping me on Slack if urgent, otherwise catch me when I'm green") — the coaster only works if everyone honors it, same as the steakhouse.
  • ADHD-friendly defaults: the automation means nobody has to remember to set or unset their status — the calendar/Focus does it. The only habit to build is glancing at the board before walking over.