Skip to content

feature(web/monitor): Triggers tab UI#182

Open
jamby77 wants to merge 1 commit into
feature/monitor-trigger-webhooksfrom
feature/monitor-web-triggers-tab
Open

feature(web/monitor): Triggers tab UI#182
jamby77 wants to merge 1 commit into
feature/monitor-trigger-webhooksfrom
feature/monitor-web-triggers-tab

Conversation

@jamby77
Copy link
Copy Markdown
Collaborator

@jamby77 jamby77 commented May 11, 2026

Summary

PR 17 of the MONITOR stack. Adds the Pro+ Triggers tab to `/monitor`.

  • New `TriggersTable` component renders: created at, status badge (`configured` / `queued` / `fired` / `skipped` / `expired` / `cancelled`), source anomaly (`metricType / anomalyType`), expiry (relative), fired session id (short), created by, and a Delete button on active rows
  • `Monitor.tsx` wraps the existing sessions table in a Tabs container; the Triggers tab is visible only when the license grants `Feature.MONITOR_ANOMALY_TRIGGER` (Pro+)
  • `monitorApi` gains `listTriggers` / `createTrigger` / `cancelTrigger`
  • Triggers list polls every 5 s; `cancelTrigger` invalidates the query so the row disappears on success
  • Picked up the two new webhook event labels (`monitor.session.skipped`, `monitor.trigger.created`) introduced in PR 16 so they render correctly in `WebhookForm`

How to verify

Requires a Pro+ license configured locally (otherwise the API returns 402 and the tab is hidden).

  1. `MONITOR_DEV_PREVIEW=true VITE_MONITOR_DEV_PREVIEW=true pnpm dev` with a Pro+ license loaded.
  2. `curl -X POST localhost:3001/monitor/triggers -d '{"connectionId":"","metricType":"connections","anomalyType":"spike"}'` (from PR 15).
  3. Browser → `/monitor` → click the Triggers tab. The created trigger appears with `status: configured`.
  4. Click Delete → row disappears within one poll; `curl /monitor/triggers` returns `[]`.

Test plan

  • `pnpm exec tsc --noEmit` (apps/web) → clean
  • `pnpm exec eslint` on touched files → clean
  • `pnpm exec vitest run` (apps/web) → 187 tests pass
  • Verified API gate: GET `/monitor/triggers` returns 402 on Community tier (`feature: monitorAnomalyTrigger`)
  • Live verify the Triggers tab renders + delete works on a Pro+ license (deferred — no Pro license configured locally)

@jamby77 jamby77 force-pushed the feature/monitor-trigger-webhooks branch from d074c71 to 1108f68 Compare May 12, 2026 11:16
@jamby77 jamby77 force-pushed the feature/monitor-web-triggers-tab branch from 497ad76 to fd90f16 Compare May 12, 2026 11:17
@jamby77 jamby77 force-pushed the feature/monitor-trigger-webhooks branch from 1108f68 to 0b5686d Compare May 12, 2026 12:45
@jamby77 jamby77 force-pushed the feature/monitor-web-triggers-tab branch from fd90f16 to 217ea9d Compare May 12, 2026 12:45
@jamby77 jamby77 force-pushed the feature/monitor-trigger-webhooks branch from 0b5686d to 9781e93 Compare May 12, 2026 12:49
@jamby77 jamby77 force-pushed the feature/monitor-web-triggers-tab branch from 217ea9d to 287231a Compare May 12, 2026 12:50
@jamby77 jamby77 force-pushed the feature/monitor-trigger-webhooks branch from 9781e93 to 0372c5b Compare May 13, 2026 12:41
Pro+ feature, gated by MONITOR_ANOMALY_TRIGGER:

- New TriggersTable component: created at, status badge, source
  metric/anomaly, expiry (relative), fired session id, created by,
  Delete button on active rows
- Monitor.tsx wraps Sessions in a Tabs container; adds a Triggers
  tab visible only when the license grants MONITOR_ANOMALY_TRIGGER
- monitorApi gains listTriggers / createTrigger / cancelTrigger
- WebhookForm gets labels for monitor.session.skipped and
  monitor.trigger.created (introduced in PR 16)
- Polling refreshes triggers every 5s while the tab/page is open;
  cancel invalidates the query so the row disappears on success
@jamby77 jamby77 force-pushed the feature/monitor-web-triggers-tab branch from 287231a to 33b47d3 Compare May 13, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant