SpaceMIX v0.1.0 (latest)

Widget checklist

experimentalfor bothsince protocol 1

What to check before you save a widget, share it with the team or export it as a widget file.

Go through this before you save a widget, put it on a shared dashboard or export it. Each item links to the page that explains it. The assistant is told most of these; check them anyway in the Studio preview.

Data

  • Every source is a read-only tool that is installed here, or a web source, and its key is a plain identifier (tasks, open_deals). (Sources)
  • Each web source's URL is the public API you mean, read in full, with no key or personal data in it, and refreshSeconds respects the API's rate limits. (Web sources)
  • A count shows total, not the length of items: a collection's list returns at most limit items, 20 by default. (Sources)
  • Heavy reads are sources, not spacemix.calls at render time: sources are cached, calls aren't. (Data)
  • refreshSeconds fits the data: the default day for most widgets, 3600 for data that must be current within the hour, rarely less. (The data cache)
  • The widget shows nothing a viewer shouldn't see in a shared place: it runs as each viewer, but whatever it reads is on screen wherever it's placed. (Runs as the viewer)

Code

  • It renders from spacemix.onData, never from spacemix.data read once at load. (spacemix in the widget)
  • Every source is checked with failed(result) and rendered with error(result); empty data is rendered with empty(text); every spacemix.call has a catch. (Handling errors)
  • Markup is built with html`…`, so every value from the data is escaped. (Building markup)
  • It is self-contained: inline <style> and <script>, images only as data: URIs, no external scripts, stylesheets, fonts, fetch or links that navigate. (Widgets)
  • The Studio shows no error, and the status dot is not red.
  • The HTML is small: under about 15 KB, and never more than 60,000 characters. (Limits)

Look

  • It is built from .op-widget and the kit's classes and helpers, with little CSS of its own, on its own classes and ids only. (Look and feel)
  • No hard-coded colors: var(--op-…) and spacemix.ui.color(i) only, and it reads well in light and in dark. (Colors and the theme)
  • It fits any size: no fixed pixel widths, lists scroll with .op-scroll, long text is truncated. Try Small and Large in the Studio. (The grid and sizing)
  • It still reads at one column, about 350 px wide, as on a phone. (On a phone)
  • Animations of its own sit inside @media (prefers-reduced-motion: no-preference). (Reduced motion)
  • It is quiet and clear: one big number or a compact list beats clutter. Rows that stand for an extension's records open it with data-open.

Sharing

  • The name is short and the description says in one line what it shows; both show in the gallery, the add-widget picker and Team Chat.
  • It is saved: a widget that was never saved shows only in its Studio. (Save, discard, and unsaved widgets)
  • Before exporting: whoever imports the file needs the same extensions installed, or the widget shows the missing-extension pill. (Importing)
  • Before importing or opening someone else's never-saved widget: read the list of tools it reads in the confirm, and every web address the server will fetch for it. It runs with your access. (Runs as the viewer)

This page as markdown · All pages as one file