Skip to content

TODAY Widget

The TODAY widget is a pinned dashboard card showing the top NOW tasks selected by the most recent triage run. It is the only morning-ritual UI surface that has shipped.

Where it lives

  • Route: / (the Command Center dashboard).
  • Render order: 2 (pinned near the top, above the rest of the widget grid).
  • Code: optimalOS/client/widgets/today.ts:143-251createTodayWidget().
  • Wiring: optimalOS/client/dashboard.ts:39,42registerWidget(createTodayWidget()).

What it shows

SectionContent
HeaderLast-run timestamp, unconsumed-brief count, Rerank button, Open morning ritual link.
NOW gridUp to 3 cards. Each card shows: rank badge (#1 / #2 / #3), title, track tag, score (2 decimals), due-date pill (if set), expand-reasoning chevron.
Reasoning panelWhen expanded, shows the model's reasoning plus clash_resolution text if the run produced one.
Distribution warningPrepended above the grid when the most recent run had to auto-demote tasks past a cap.

If there are no NOW tasks, the widget renders the empty state: "No NOW tasks. Drop a brief and rerank."

The "Open morning ritual" link

The link target /morning is hard-coded in the widget but the /morning page itself is not yet implemented. The link will 404 in the current build. Tracking under the Loom charter (optimalOS/docs/superpowers/specs/2026-04-14-loom-charter.md).

Live refresh

The widget refreshes from four triggers:

  1. Initial render. widget.render() calls refresh().
  2. Manual rerank. Clicking Rerank posts to /api/triage/rerun and polls /api/triage/runs every 2 s until the latest run is no longer running.
  3. WebSocket events. The dashboard subscribes to the state hub. When it sees triage_run_completed or triage_run_failed, it dispatches a triage:updated CustomEvent on window (optimalOS/client/dashboard.ts:832-837). The widget listens for that event (optimalOS/client/widgets/today.ts:241-243).
  4. Dashboard-driven. The dashboard can call widget.refresh() directly when it needs to.

Data source

The widget pulls from GET /api/morning (optimalOS/src/routes/morning.ts:9-39). The endpoint returns:

json
{
  "now": [
    { "task_id": "...", "title": "...", "track": "...", "score": 0.87, "lane": "now", "rank": 1, "reasoning": "...", "clash_resolution": null, "due_at": "..." }
  ],
  "next": [/* up to 10 */],
  "latest_run": { "id": 42, "status": "succeeded", "started_at": "...", "completed_at": "...", "distribution_warning": null },
  "unconsumed_briefs": 0
}

NOW is capped at 10 by the route, but the widget renders only up to the configured triage.max_now (default 3).

Built by Carlos Lenis in Miami