Bento Spaces docs

Bento Spaces documentation

14 — Widget catalogue

The widget backlog, split by where the data lives rather than by how popular a widget is. That split decides everything else: whether a widget needs a secret, whether it can be shared or exported, and whether it belongs in the marketplace.

Rule of thumb. Secret-free widget → shareable and exportable. Account or LAN widget → private in shared views, never in an export.

Tiers

TierData sourceSharingMarketplaceExample
Apublic, no key (Open-Meteo, RSS, CoinGecko, Frankfurter)shareableyesweather, feed, markets
Bthe user's account (calendar, todo, GitHub, Spotify)privatemaybe"next meeting"
Cthe user's LAN (connectors + bridge)privatenoGree AC, NAS, Pi-hole

Tier A is what makes a marketplace look alive. Tier B is what makes people come back daily. Tier C is the moat: nobody else can put your six ACs, your NAS and your Pi-hole on one shelf with server-side rules.

What ships now

Built-ins in web/src/widgets/builtin/, registered in web/src/widgets/registry.js:

WidgetTierDataNotes
clockAnonetwo IANA timezones, optional seconds
countdownAnoneone-off or yearly (birthdays), double-click to edit
weatherAOpen-Meteocurrent, feels-like, today's high/low, two more days
feedAany public RSS/Atomproxied through the API, 20 items, 15 min refresh
marketsACoinGecko + Frankfurtercoins with 24 h change plus FX rates
photo frameAimage URLsslideshow with cross-fade, 3–60 s per photo
qrAnonebyte mode, versions 1–10, levels L/M/Q/H, drawn as SVG
sun & moonAOpen-Meteo + local moon mathsunrise, sunset, daylight left, phase, illumination
unit converterAnonelength, mass, volume, speed, area, data, time, temperature
dice & pickerAnoned2–d100, up to 12 dice, or pick from a list
holidaysANager.Datenext public holidays for a country, two years merged
cryptoACoinGecko market chartprice, 1/7/30/90/365-day change, sparkline
air qualityAOpen-Meteo air qualityEuropean AQI, PM2.5, PM10, colour band
transit ("Departures")ATfL + BVGnext departures from a stop, 60 s refresh
stat, note, links, progressAnonestatic, local
http ("HTTP card")Caccount connectorone path mapped to dotted fields; Home Assistant / Gree / Pi-hole templates
ha ("Home Assistant")Caccount connectorone entity: state, unit, toggle via homeassistant.toggle

All of these are secret-free except the Tier C trio, so they behave like any other widget in a shared view or an export. Tier C is gree, http and ha; see Connectors.

How a Tier A widget gets its data

Two paths, and the choice matters:

The QR encoder is local. web/src/lib/qr.js implements byte mode with Reed-Solomon correction and mask selection, and exposes its capacity so the tests can check every version and level against the published table. The matrices were also decoded with macOS Vision as a one-off check, including a screenshot of the rendered SVG — that is a verification step, not a runtime dependency.

  1. Direct fetch — the browser calls the public host. CSP only allows the three data hosts
  2. below, so this is a short list on purpose. Adding a host is a security change, not a config
  3. change.
    • https://api.open-meteo.com (weather)
    • https://api.coingecko.com (coins)
    • https://api.frankfurter.app (FX)
    • https://air-quality-api.open-meteo.com (AQI)
    • https://date.nager.at (public holidays)
    • https://api.tfl.gov.uk (London departures)
    • https://v6.bvg.transport.rest (Berlin departures)
  4. Same-origin proxy — GET /api/live/feed?url=… in Bento.Api. Needed because feeds do not
  5. send CORS headers. Account-only; public hosts only (no LAN, no loopback, no metadata); no
  6. redirects; 12 s; 512 KB; 5 min browser cache. The XML is parsed in web/src/lib/feed.js, never
  7. evaluated.

A widget that cannot load shows a short message in the box. It never throws, never blanks the shelf and never leaks the URL into a log.

Configuration

In edit mode each configurable widget shows a gear in its corner on hover. It opens one shared settings dialog — the same shell as Edit space — built from the widget's config schema. View-mode double-click stays free for shortcuts. What the dialog asks for:

WidgetDouble-click edits
clockEurope/Malta \| America/New_York
weatherlat, lon, label
countdownlabel \| 2026-12-25 \| yearly yes/no
feedfeed URL, one per line
photo frameimage URLs, one per line
marketscoins \| currencies \| base, e.g. bitcoin,ethereum \| USD,GBP \| EUR
qrtext or URL, optionally \| L, \| M, \| Q, \| H
sun & moonlat, lon, label
unit convertera sentence, e.g. 10 km to mi, 100 c to f
dice & picker6 \| 2 for two d6, or pick: Pizza, Sushi
holidaysMT, Malta (ISO country code, label)
cryptocoin id \| currency \| days, e.g. ethereum \| EUR \| 30
air qualitylat, lon, label
transit ("Departures")network (tfl or bvg), stop id, label
http ("HTTP card")path, optional title, template and Label = dotted.path fields

Next in Tier A

Cheap and secret-free, in rough order:

Not Tier A, by definition: calendar, todo, email, GitHub, Spotify (Tier B) and anything behind a connector (Tier C).

Acceptance for a Tier A widget