:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(dashboard-widgets): refine intake for discover-first agent work… (#61705)
Matt Pua8761715ed7cf
diff --git a/.agents/skills/dashboard-widgets/SKILL.md b/.agents/skills/dashboard-widgets/SKILL.mdindex 9474c72afc0e..2eb879e10881 100644--- a/.agents/skills/dashboard-widgets/SKILL.md+++ b/.agents/skills/dashboard-widgets/SKILL.md@@ -5,7 +5,11 @@ description: >new widget_type (WIDGET_REGISTRY, catalog, run_widgets, WidgetCard) or change anexisting shipped type (config, query, layout, RBAC). Use when implementing ormodifying dashboard widget types such as error_tracking_list or session_replay_list.- New types require widget-intake spec confirmation before coding. Do not use for MCP+ When wiring an existing product, match scene list/card UI via shared components where+ possible. Do not ship chart-based widget types — use insight tiles for trends and+ graphs. New types require widget-intake: discover product UI in-repo, infer group and+ template without asking the engineer, ask only for ambiguous spec fields, then confirm+ before coding. Do not use for MCPbatch-add of existing types or adding tiles to a dashboard.---@@ -21,11 +25,12 @@ Human overview: [`products/dashboards/CONTRIBUTING.md`](../../../products/dashbo## 1. Route first-| Request | Path | Start here |-| ---------------------------------------------------------------------- | ---------- | ------------------------------------------------------------------ |-| New **`widget_type`** that does not exist | **Ship** | [§2 Ship a new type](#2-ship-a-new-widget_type) — intake mandatory |-| Change a **shipped** type (config, query, UI, layout, RBAC, deprecate) | **Update** | [§3 Update a shipped type](#3-update-a-shipped-type) — skip intake |-| Add existing type to a dashboard | — | MCP only — not this skill |+| Request | Path | Start here |+| ---------------------------------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------- |+| New **`widget_type`** that does not exist | **Ship** | [§2 Ship a new type](#2-ship-a-new-widget_type) — intake mandatory |+| Change a **shipped** type (config, query, UI, layout, RBAC, deprecate) | **Update** | [§3 Update a shipped type](#3-update-a-shipped-type) — skip intake |+| Add existing type to a dashboard | — | MCP only — not this skill |+| **Chart / trend / graph** for product metrics on a dashboard | — | **Insight tile** — [architecture.md § Charts → insight tiles](references/architecture.md#charts--use-insight-tiles-not-widgets) |Shipped types (code truth): [architecture.md § Shipped types](references/architecture.md#shipped-types-source-of-truth).@@ -35,25 +40,28 @@ Shipped types (code truth): [architecture.md § Shipped types](references/archit**Mandatory for new types only.** Read [widget-intake.md](references/widget-intake.md) and:-1. Infer from the request ([§2.2 defaults](#22-infer--defaults)).-2. Ask **one batched follow-up** for gaps — max 6 questions ([question bank](references/widget-intake.md#ask-when-not-stated)).-3. Post the [spec table](references/widget-intake.md#spec-fields-to-lock); get confirmation before checklist §1.+1. [Discover product UI in the repo](references/widget-intake.md#discover-product-ui-in-the-repo) — concrete components/scenes before generic tile-body questions.+2. Infer `groupId` + [implementation template](references/widget-intake.md#infer-implementation-template) from product + catalog — **never** AskQuestion those.+3. Apply other [§2.2 defaults](#22-infer--defaults).+4. [Resolve ambiguity](references/widget-intake.md#resolve-ambiguity-ask-dont-guess) — ask plain questions for open spec fields; never guess or "recommend from my answers" ([question bank](references/widget-intake.md#ask-when-not-stated); [banned prompts](references/widget-intake.md#askquestion--do-not-ask)).+5. Post the [spec table](references/widget-intake.md#spec-fields-to-lock); get confirmation before checklist §1.### 2.2 Infer — defaults-Apply silently; ask only when the request is silent on a [question-bank](references/widget-intake.md) row.--| Derive | Default |-| ------------------- | ----------------------------------------------------------------------------- |-| `widget_type` | Unique `snake_case` from label |-| `groupId` | Same as sibling in that product area |-| Copy spine | `error_tracking_list` / `frontend/widgets/error_tracking/` |-| Copy spine (replay) | `session_replay_list` when recordings, throttles, or session RBAC |-| Config | List: `limit`, `orderBy`, `orderDirection`, `dateRange`, `filterTestAccounts` |-| RBAC | Same `required_product_access` as sibling |-| Layout | Sibling `defaultLayout`; explicit `minH` for dense lists |-| Setup gating | Match sibling pattern |-| `sharedPlaceholder` | Platform default |+Apply when confident; if ambiguous after discovery, [ask](references/widget-intake.md#resolve-ambiguity-ask-dont-guess) — do not silently default.++| Derive | Default |+| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| `widget_type` | Unique `snake_case` from label |+| `groupId` | [Infer](references/widget-intake.md#infer-groupid-add-modal) from product + `catalog.ts` — **do not ask** |+| Implementation template | [Infer](references/widget-intake.md#infer-implementation-template) — `session_replay_list` only for replay; else `error_tracking_list`. **Do not ask the user.** |+| Config | List: `limit`, `orderBy`, `orderDirection`, `dateRange`, `filterTestAccounts` |+| RBAC | Same `required_product_access` as sibling |+| Layout | Sibling `defaultLayout`; explicit `minH` for dense lists |+| Setup gating | Match sibling pattern |+| `sharedPlaceholder` | Platform default |+| Product UI | Reuse scene list/card/empty/skeleton components — [composition.md § Product visual parity](references/composition.md#product-visual-parity) |+| Chart / graph body | **Do not ship** — insight tile ([architecture.md § Charts](references/architecture.md#charts--use-insight-tiles-not-widgets)) |### 2.3 Execute@@ -65,11 +73,11 @@ After spec confirmation → [checklist-new-widget-type.md](references/checklist-1. Read [managing-existing-widgets.md](references/managing-existing-widgets.md) — use the **"What kind of change?"** routing table for primary files.2. Confirm with the engineer: which shipped type, what changes, and whether stored tiles need backward-compatible config migration.-3. Follow linked references from that table (composition, layout, permissions, availability) — do not re-read the new-type checklist.+3. Follow linked references from that table (composition, layout, permissions, availability) — do not re-read the new-type checklist. **Presentation-only** (list/card/empty/skeleton UI): [composition.md § Product visual parity](references/composition.md#product-visual-parity).**Cannot change in place:** `widget_type` string on existing rows; stored `w`/`h` for tiles already on dashboards when catalog defaults change.-**New visualization kind** = ship a new type ([§2](#2-ship-a-new-widget_type)), not an update.+**New list/card visualization** = ship a new type ([§2](#2-ship-a-new-widget_type)), not an update. **Chart-primary** = insight tile, not a widget ([architecture.md § Charts](references/architecture.md#charts--use-insight-tiles-not-widgets)).## 4. Platform invariants@@ -80,6 +88,7 @@ Both paths:3. **Per-type code in product paths** — not in platform shells. [architecture.md § Platform files](references/architecture.md#platform-files--do-not-branch-per-type)4. **WidgetCard compound pattern** — [composition.md](references/composition.md)5. **Config PATCH = JSONField** — typed OpenAPI in `widget_openapi_serializers.py` only.+6. **No chart-primary widgets** — trends/graphs belong on insight tiles, not new `widget_type`s ([architecture.md § Charts](references/architecture.md#charts--use-insight-tiles-not-widgets)).New `widget_type` strings need **no migration** — register registries + catalogs only.@@ -116,14 +125,15 @@ See [managing-existing-widgets.md](references/managing-existing-widgets.md) rout## Reference appendix-| Topic | Doc |-| ----------------------- | ----------------------------------------------------------------------- |-| Intake (new types only) | [widget-intake.md](references/widget-intake.md) |-| New type checklist | [checklist-new-widget-type.md](references/checklist-new-widget-type.md) |-| Update shipped type | [managing-existing-widgets.md](references/managing-existing-widgets.md) |-| Architecture | [architecture.md](references/architecture.md) |-| WidgetCard / edit modal | [composition.md](references/composition.md) |-| Tile min/max | [layout-and-ux.md](references/layout-and-ux.md) |-| RBAC / sharing | [permissions-and-sharing.md](references/permissions-and-sharing.md) |-| Setup gates | [availability-and-gating.md](references/availability-and-gating.md) |-| MCP after ship | [mcp.md](references/mcp.md) |+| Topic | Doc |+| ----------------------- | ----------------------------------------------------------------------------------------- |+| Intake (new types only) | [widget-intake.md](references/widget-intake.md) |+| New type checklist | [checklist-new-widget-type.md](references/checklist-new-widget-type.md) |+| Update shipped type | [managing-existing-widgets.md](references/managing-existing-widgets.md) |+| Architecture | [architecture.md](references/architecture.md) |+| WidgetCard / edit modal | [composition.md](references/composition.md) |+| Match product scene UI | [composition.md § Product visual parity](references/composition.md#product-visual-parity) |+| Tile min/max | [layout-and-ux.md](references/layout-and-ux.md) |+| RBAC / sharing | [permissions-and-sharing.md](references/permissions-and-sharing.md) |+| Setup gates | [availability-and-gating.md](references/availability-and-gating.md) |+| MCP after ship | [mcp.md](references/mcp.md) |diff --git a/.agents/skills/dashboard-widgets/references/architecture.md b/.agents/skills/dashboard-widgets/references/architecture.mdindex 598c8f601584..c69ab63869a2 100644--- a/.agents/skills/dashboard-widgets/references/architecture.md+++ b/.agents/skills/dashboard-widgets/references/architecture.md@@ -50,6 +50,19 @@ CI: `test_run_widgets.py` (registry + catalog + OpenAPI serializer count), `regiDefault pattern: copy `error_tracking_list` end-to-end (`frontend/widgets/error_tracking/`). Use `session_replay_list` when you need catalog `availability`, replay throttles, or session-recording RBAC.+## Charts → use insight tiles, not widgets++**Do not ship chart-based widget types** (trends, time series, funnels, breakdowns, pie/bar/line as the primary tile body).++Dashboards already have **insight tiles** for HogQL/query visualizations — comparisons, formulas, breakdowns, subscriptions, and insight-linked alerts. A chart widget duplicates that stack in a smaller tile with worse ergonomics.++| Need on a dashboard | Use |+| ------------------------------------------ | ------------------------------------------------------------- |+| Trend, funnel, retention, stickiness, etc. | Save or build an **insight** → add as a normal dashboard tile |+| Product-native list/table/card context | **Widget** (`error_tracking_list`, `session_replay_list`, …) |++If intake is chart-only, **stop** — help the engineer add the right insight to the dashboard instead of a new `widget_type`. Lists may include small non-chart metadata (badges, sparklines in a row) when the product scene does; the tile body is still a list, not a chart canvas.+Per-type add flow (ordered checklist): [checklist-new-widget-type.md](checklist-new-widget-type.md).## Backend registry entry shapediff --git a/.agents/skills/dashboard-widgets/references/checklist-new-widget-type.md b/.agents/skills/dashboard-widgets/references/checklist-new-widget-type.mdindex 43778597463c..e106db1567a8 100644--- a/.agents/skills/dashboard-widgets/references/checklist-new-widget-type.md+++ b/.agents/skills/dashboard-widgets/references/checklist-new-widget-type.md@@ -6,7 +6,7 @@2. Work **§1 → §8 below in order**. Do not skip step 2 (permissions).3. **§5b, §9, §10** — after MVP tests green.-Default copy spine: `products/dashboards/frontend/widgets/error_tracking/` (`error_tracking_list`). Use `session_replay_list` when replay throttles, availability, or session RBAC apply.+Default **implementation template:** mirror `products/dashboards/frontend/widgets/error_tracking/` (`error_tracking_list`). Use `session_replay_list` / `widgets/session_replay/` when replay throttles, availability, or session RBAC apply.## 1. Backend registry@@ -60,9 +60,10 @@ No change to `AddWidgetModal` grouping for normal adds — `getDashboardWidgetCa### 4b. Adding a variant to an existing group-Use when the product area already has a widget and you need another visualization (e.g. a chart alongside a list widget in the same group).+Use when the product area already has a widget and you need another **list/table/card** presentation in the same group — not a chart ([architecture.md § Charts → insight tiles](architecture.md#charts--use-insight-tiles-not-widgets)).-- [ ] New **unique** catalog key / `widget_type` (e.g. `error_tracking_trends`) — not a config fork of the existing type+- [ ] Confirmed the ask is **not** chart-primary — trends/graphs → insight tile on the dashboard+- [ ] New **unique** catalog key / `widget_type` (e.g. `error_tracking_top_issues`) — not a config fork of the existing type- [ ] Reuse sibling **`groupId`** exactly; label comes from `DASHBOARD_WIDGET_GROUP_LABELS[groupId]`- [ ] Distinct **`label`**, **`description`**, **`defaultConfig`**, **`defaultLayout`** (and usually `headerTitle`)- [ ] Full backend stack: new `widgets/<widget_type>.py`, `WIDGET_REGISTRY` entry with `required_product_access`, `EXPECTED_WIDGET_TYPES`, extend `DashboardWidgetType`@@ -83,6 +84,7 @@ Use when introducing a new **`groupId`**, not just another variant in an existin| Scenes / posthog helper | Import shared helper (e.g. `posthog.session_recordings…`) | Import from `scenes/<area>/…` when UI still lives there | `session_replay_list` |- [ ] If importing **`products/<product>/frontend/…`**: add **`products.<product>`** to `tach.toml` → `products.dashboards` `depends_on`+- [ ] **Product visual parity** — tile body uses the same list/card/empty/skeleton/setup components as the product scene where they exist; see [composition.md § Product visual parity](composition.md#product-visual-parity)- [ ] RBAC: extend `DashboardWidgetProductAccess`, `WIDGET_PRODUCT_ACCESS_CHECKS`, BE `required_product_access` (+ optional `PRODUCT_ACCESS_DENIED_MESSAGES` / catalog `product_access_denied_message`)- [ ] Availability: new `WidgetAvailabilityRequirementId` in `widgetAvailability.ts` + BE `availability_requirements` string when catalog uses `availability`; optional branch in `WidgetAvailabilitySetupPrompt`- [ ] Optional **`titleHref`** on catalog — product scene route for header "View" link (`urls.*` or scene path)@@ -94,8 +96,9 @@ Directory: `products/dashboards/frontend/widgets/<product>/` (snake_case product- [ ] Implement `Component` with `DashboardWidgetComponentProps` (`tileId`, `config`, `result`, `loading`, `error`, `onRefresh`, `onUpdateConfig`)- [ ] Setup gating: catalog `availability` for simple team-flag checks, or private setup gate inside the widget `Component` for richer rules — do not modify product `SetupPrompt`-- [ ] **Own loading UI** — early-return with `WidgetLoadingState` (typed skeleton as `children` when helpful)-- [ ] Use `WidgetCardContent` for scrollable lists/tables; `WidgetCardBodyMessage` for empty states+- [ ] **Own loading UI** — early-return with `WidgetLoadingState` (typed skeleton as `children` when helpful); prefer the **product's** skeleton component (e.g. `ErrorTrackingIssueListSkeleton`), not a generic placeholder+- [ ] **Product visual parity** — import list/card/empty/setup UI from the product scene ([composition.md § Product visual parity](composition.md#product-visual-parity)); avoid dashboard-only row markup when shared components exist+- [ ] Use `WidgetCardContent` for scrollable lists/tables; `WidgetCardBodyMessage` for empty states only when the product has no shared empty component- [ ] Do **not** render card chrome — `DashboardWidgetItem` + catalog handle headers/menusMinimal skeleton:diff --git a/.agents/skills/dashboard-widgets/references/composition.md b/.agents/skills/dashboard-widgets/references/composition.mdindex fb25c0caff7d..abeae5fdc5d8 100644--- a/.agents/skills/dashboard-widgets/references/composition.md+++ b/.agents/skills/dashboard-widgets/references/composition.md@@ -99,6 +99,44 @@ The widget `Component` receives `loading` from scene logic and must early-return- `gridChildren` is reserved for react-grid-layout resize handles only- Wide tables: horizontal scroll **inside** `WidgetCardContent`, not the dashboard grid+## Product visual parity++When the widget surfaces data from an **existing PostHog product** (variant in an existing `groupId`, or first widget in a product area that already has a scene):++**Default:** Reuse the same presentation the product scene uses — list rows, cards, empty copy, skeletons, setup prompts. A dashboard tile is a smaller viewport; users should still recognize it as the same product data they see in-app (e.g. `ErrorTrackingIssueList` on `/error-tracking`, not a bespoke widget-only table). **Chart-primary bodies do not belong in widgets** — use insight tiles ([architecture.md § Charts → insight tiles](architecture.md#charts--use-insight-tiles-not-widgets)).++### Where to look++Intake should already have run [repo discovery](widget-intake.md#discover-product-ui-in-the-repo) — use those component paths first.++1. Start from intake **product UI reference** when the engineer named a scene path, tab, Storybook story, or sibling widget — do not guess a different screen.+2. Otherwise open the primary scene for that product (list, overview, or detail index).+3. Note which components render the main data block — often under `products/<product>/frontend/components/` or `scenes/<area>/`.+4. Import those into `products/dashboards/frontend/widgets/<product>/` and compose inside `WidgetCardContent` (or the product's setup gate wrapper).++Shipped reference: `ErrorTrackingWidget` imports `ErrorTrackingIssueList`, `ErrorTrackingIssueListSkeleton`, and `ErrorTrackingIngestionPrompt` from `products/error_tracking/frontend/`.++### Platform vs product chrome++| Layer | Owner |+| ---------------------------------------------------- | -------------------------------------------- |+| Tile header, ⋯ menu, resize, edit modal shell | Dashboard (`WidgetCard`, `EditWidgetModal*`) |+| Rows, empty states, loading skeletons, setup prompts | Product (import shared components) |++Do not duplicate product menus, filters, or page-level chrome inside the widget body — config belongs in the widget settings modal ([layout-and-ux.md](layout-and-ux.md)).++### Charts++**Out of scope for widgets.** Time series, funnels, and other graph visualizations belong on **insight tiles**, not a new `widget_type`. Do not embed product chart components as the primary widget body.++### Storybook and review++Populated stories should render through the **same product components** with realistic `run_*` payloads so visual review catches drift from the scene. Compare side-by-side with the product Storybook story or scene when unsure.++### When parity is not feasible++Say so in the PR (e.g. scene is full-page with inline filters and no extracted list). Prefer a thin extract into the product package over a one-off dashboard-only presentation — keeps the next widget variant consistent too.+## StorybookPlatform primitives under **Dashboards/Dashboard Widgets/**:diff --git a/.agents/skills/dashboard-widgets/references/managing-existing-widgets.md b/.agents/skills/dashboard-widgets/references/managing-existing-widgets.mdindex 595333d6132d..a4b626dcf862 100644--- a/.agents/skills/dashboard-widgets/references/managing-existing-widgets.md+++ b/.agents/skills/dashboard-widgets/references/managing-existing-widgets.md@@ -20,6 +20,7 @@ Before finishing, apply [skill-maintenance.md](skill-maintenance.md) for any doc| Widget query / `run_widgets` payload | `backend/widgets/<widget_type>.py`, `widget_registry.py` | `test_run_widgets.py`, frontend `Component` types, preview/overview fixtures, **`dashboard_widget_delivery`** SLO (automatic — no wiring) || Config fields (filters, limits, sort) | `configSchemas.ts`, `<type>WidgetConfigValidation.ts`, `Edit*WidgetModal.tsx`, backend `validate_*_config` | Registry **`parseConfigApiError`**, `widget_openapi_serializers.py`, BE `config_schema_hints`, `hogli build:openapi`, MCP schema snapshots || **`run_*` result shape** | `backend/widgets/<widget_type>.py`, widget `Component` | Story `result` args, `widgets/previews/`, `widgetOverviewStoryFixtures.ts` |+| Widget body / presentation | `widgets/<product>/<Type>Widget.tsx`, `*.stories.tsx` | [composition.md § Product visual parity](composition.md#product-visual-parity) — reuse product scene components, not dashboard-only markup || Tile name / description UX | `Edit*WidgetModal.tsx`, `EditWidgetModalTileDetailsSection.tsx` | Mirror `EditErrorTrackingWidgetModal.tsx` field layout; activity log tests if serializer fields change || Default size when **adding** a tile | `catalog.ts` `defaultLayout.w` / `.h` | `dashboardLogic.addWidgetTiles` (reads catalog defaults) || **Min/max resize** on dashboard grid | `catalog.ts` `defaultLayout.minW` / `.minH` | [layout-and-ux.md](layout-and-ux.md) § Tile min/max size — **`tileLayouts.ts`**, `tileLayouts.test.ts` |diff --git a/.agents/skills/dashboard-widgets/references/skill-maintenance.md b/.agents/skills/dashboard-widgets/references/skill-maintenance.mdindex a614552b856e..c7a4744413c8 100644--- a/.agents/skills/dashboard-widgets/references/skill-maintenance.md+++ b/.agents/skills/dashboard-widgets/references/skill-maintenance.md@@ -6,17 +6,19 @@One canonical home per topic — link elsewhere; do not copy tables or long prose.-| Topic | Canonical doc |-| ---------------------------- | ----------------------------------------------------------------------------------------------------------------- |-| Intake / spec questions | [widget-intake.md](widget-intake.md) |-| Add flow (files + order) | [checklist-new-widget-type.md](checklist-new-widget-type.md) |-| Model, naming, scaling rules | [architecture.md](architecture.md) |-| Product RBAC | [permissions-and-sharing.md § Product RBAC](permissions-and-sharing.md#product-rbac) |-| Tile min/max size | [layout-and-ux.md § Tile min/max size](layout-and-ux.md#tile-minmax-size-grid-rows--columns) |-| Registry entry shapes (code) | [architecture.md](architecture.md) |-| Update flow | [managing-existing-widgets.md](managing-existing-widgets.md) — [SKILL.md §3](../SKILL.md#3-update-a-shipped-type) |-| Verify commands | [SKILL.md §6 Verify](../SKILL.md#6-verify) |-| Human entry / nav | [`products/dashboards/CONTRIBUTING.md`](../../../products/dashboards/CONTRIBUTING.md) |+| Topic | Canonical doc |+| ---------------------------- | -------------------------------------------------------------------------------------------------------------------- |+| Intake / spec questions | [widget-intake.md](widget-intake.md) (incl. [discover product UI](widget-intake.md#discover-product-ui-in-the-repo)) |+| Add flow (files + order) | [checklist-new-widget-type.md](checklist-new-widget-type.md) |+| Model, naming, scaling rules | [architecture.md](architecture.md) |+| Widgets vs insight charts | [architecture.md § Charts → insight tiles](architecture.md#charts--use-insight-tiles-not-widgets) |+| Product RBAC | [permissions-and-sharing.md § Product RBAC](permissions-and-sharing.md#product-rbac) |+| Tile min/max size | [layout-and-ux.md § Tile min/max size](layout-and-ux.md#tile-minmax-size-grid-rows--columns) |+| Registry entry shapes (code) | [architecture.md](architecture.md) |+| Product scene UI in tiles | [composition.md § Product visual parity](composition.md#product-visual-parity) |+| Update flow | [managing-existing-widgets.md](managing-existing-widgets.md) — [SKILL.md §3](../SKILL.md#3-update-a-shipped-type) |+| Verify commands | [SKILL.md §6 Verify](../SKILL.md#6-verify) |+| Human entry / nav | [`products/dashboards/CONTRIBUTING.md`](../../../products/dashboards/CONTRIBUTING.md) |## When this applies@@ -51,6 +53,7 @@ Platform-only refactors with **no** behavior or agent-facing surface change may| Setup / availability gating | [availability-and-gating.md](availability-and-gating.md); BE `availability_requirements` note || Tile layout / mins / add placement | [layout-and-ux.md](layout-and-ux.md); [architecture.md](architecture.md) if REST/MCP add path changed || WidgetCard / edit modal composition | [composition.md](composition.md) |+| Product scene UI parity in widget body | [composition.md § Product visual parity](composition.md#product-visual-parity) || MCP tools or agent flows | [mcp.md](mcp.md) || New product area / tach / UI reuse pattern | [checklist-new-widget-type.md](checklist-new-widget-type.md) §4c || Human contributor entry point | [`products/dashboards/CONTRIBUTING.md`](../../../products/dashboards/CONTRIBUTING.md) registry table / Verify block |diff --git a/.agents/skills/dashboard-widgets/references/widget-intake.md b/.agents/skills/dashboard-widgets/references/widget-intake.mdindex a1c52a6db543..34b52298878f 100644--- a/.agents/skills/dashboard-widgets/references/widget-intake.md+++ b/.agents/skills/dashboard-widgets/references/widget-intake.md@@ -4,64 +4,201 @@ Use when `/dashboard-widgets` **Path: Ship** ([SKILL.md §2](../SKILL.md#2-ship-## Agent workflow-1. Parse the request into [spec fields](#spec-fields-to-lock).-2. Apply [defaults from SKILL.md §2.2](../SKILL.md#22-infer--defaults).-3. Ask **one batched follow-up** for gaps — `AskQuestion` when available, else a numbered list. Max **6** questions; order: placement → query/UI → config → access.-4. Post the spec summary below and get explicit confirmation before checklist §1.+1. Parse the request into [spec fields](#spec-fields-to-lock) (product area, label intent).+2. **[Discover product UI in the repo](#discover-product-ui-in-the-repo)** — before generic "what should the tile show?" questions.+3. Apply [defaults from SKILL.md §2.2](../SKILL.md#22-infer--defaults).+4. **Infer** `groupId` + add-modal placement ([rules](#infer-groupid-add-modal)) — never AskQuestion this.+5. **Infer** `implementation_template` ([rules](#infer-implementation-template)) — never AskQuestion this.+6. **[Resolve ambiguity](#resolve-ambiguity-ask-dont-guess)** — ask plain questions for anything still unclear; do not guess or offload to "pick for me" options.+7. Post the spec summary below and get explicit confirmation before checklist §1.Do not open the checklist until the engineer confirms (or says "defaults fine").+## Discover product UI in the repo++**Mandatory before** inference about placement/template and before AskQuestion about tile body. The engineer names outcomes ("top logs", "recent recordings"); the agent finds **concrete** scene components and query runners already in the codebase.++### How to search++From inferred product area (`logs`, `error_tracking`, `session_replay`, …):++1. **Widget catalog** — `products/dashboards/frontend/widget_types/catalog.ts` (`DASHBOARD_WIDGET_CATALOG`, `DASHBOARD_WIDGET_GROUP_LABELS`) for existing groups and siblings.+2. **Product frontend** — `products/<product>/frontend/components/`, `.../scenes/`, exports like `*List`, `*Table`, `*Preview`, `*Row`.+3. **Legacy scenes** — `frontend/src/scenes/<area>/` when UI still lives outside `products/`.+4. **Existing widgets** — `products/dashboards/frontend/widgets/<product>/` (sibling `Component` imports).+5. **Backend query** — `products/<product>/backend/` for functions the standalone list scene calls; that becomes `run_* delegates to`.+6. **Routes** — `urls.ts` / scene constants for `titleHref` and `product UI reference` (e.g. `/error-tracking`, `/logs`).++Use LSP/grep/glob — do not guess component names.++### Build a short discovery note (for yourself)++```text+product area:+scene(s):+candidate UI components (path + what they render):+candidate run_* / API:+chart-only surfaces found? (if yes → insight redirect, not widget)+```++### Then decide++| Discovery outcome | Action |+| ----------------------------------- | -------------------------------------------------------------------------------------------------- |+| **One clear list/card UI** + runner | Lock for recap; infer `groupId` + template next |+| **Multiple viable UIs** | Ask after inference — [code-grounded options](#askquestion--tile-body-from-code) |+| **Only chart/graph surfaces** | Stop — [insight tile](architecture.md#charts--use-insight-tiles-not-widgets), not widget |+| **Nothing reusable yet** | Ask open-ended: what should the tile show + scene path or mock; do not offer generic "list vs KPI" |++## Infer groupId (add modal)++**Agent-only.** `groupId` is the **Add widget** menu section (e.g. "Error tracking", "Session replay") — not something the engineer should pick from `groupId` / "variant" jargon.++Use `catalog.ts` from [discovery](#discover-product-ui-in-the-repo) step 1.++| Situation | `groupId` | Placement |+| ----------------------------------------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| Same product as an existing catalog entry | Reuse that entry's **`groupId`** | **Variant** — new row under the same section as siblings (e.g. another tile next to "Top issues") |+| New product, no widget in catalog yet | New `snake_case` id (usually product name: `logs`, `feature_flags`) | **First in group** — add label to `DASHBOARD_WIDGET_GROUP_LABELS` + BE `WIDGET_CATALOG` ([checklist §4c](checklist-new-widget-type.md#4c-first-widget-in-a-new-product-area)) |+| Request names recordings / replay | `session_replay` | Variant if `session_replay_list` exists |+| Request names errors / exceptions / ET | `error_tracking` | Variant if `error_tracking_list` exists |++State in the spec recap in **human terms**, e.g. `Add widget section: Error tracking (variant alongside "Top issues")` — not "variant in existing group".++Placement/`groupId` prompts are [banned](#askquestion--do-not-ask). Override only if the engineer explicitly names a different section.++## Infer implementation template++**Agent-only.** Which shipped widget to mirror for platform code (`validate_*`, `run_*`, edit modal, tests, `widgets/<product>/` layout). **Never** put this in AskQuestion — the engineer cares about product and tile behavior, not repo scaffolding.++| Pick | When |+| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| **`session_replay_list`** | Session replay product area; recordings list; replay listing throttles; `session_replay` / replay RBAC; catalog needs `session_replay_enabled` or replay availability pattern |+| **`error_tracking_list`** | **Default** for everything else (error tracking variants, logs, flags, experiments, warehouse, new product areas, generic list widgets) |++Override only if the engineer **explicitly** names a template in chat (e.g. "scaffold like session replay"). Otherwise state the pick in the spec recap; they can correct on confirm.++Folder map: `error_tracking_list` → `widgets/error_tracking/`; `session_replay_list` → `widgets/session_replay/`.++Template prompts are [banned](#askquestion--do-not-ask).++## Resolve ambiguity (ask, don't guess)++After discover + infer, list each [spec field](#spec-fields-to-lock) as **locked** or **open**:++```text+locked: groupId, implementation_template, …+open: which UI component (2 candidates), default sort, …+```++| Status | Action |+| -------------------------------------- | --------------------------------------------------------------------- |+| **Locked** (request + discovery agree) | Put in spec recap; no question |+| **Open / tie / weak signal** | **Ask the engineer** — one clear question per gap |+| **Banned topic** | Infer per rules above; see [banned prompts](#askquestion--do-not-ask) |++### How to ask++- Use **plain chat questions** or `AskQuestion` — whichever fits. Prefer **direct prose** over jargon MCQs.+- **One concern per question** — e.g. "Should the tile use `LogsTable` or the stream view on `/logs`?" not a 6-topic form mixing placement + UI + config.+- If you are unsure, **ask** a specific question — do not offer [agent-deferral options](#askquestion--do-not-ask).+- Tile body with 2+ discovered UIs: [code-grounded AskQuestion](#askquestion--tile-body-from-code); 1 candidate → lock without asking.+- Cap **6 questions per round**; if more gaps remain, ask a second short batch before spec confirm — do not silently default ambiguous fields.++### Infer vs ask (calibration)++| OK to infer silently | Must ask |+| --------------------------------------------------------------------- | ----------------------------------------------------------------------- |+| `groupId` / add-modal section from product + catalog | Product area unknown after reading the request |+| `implementation_template` per [rules](#infer-implementation-template) | Two+ credible `run_*` sources with no default |+| Single discovered list UI + matching runner | Multiple UIs or runners — which one? |+| Sibling `defaultLayout` / RBAC when variant in existing group | Picker label/description not implied by request |+| `titleHref` from scene route in discovery | Config users care about (limit, sort, date range) when request is vague |++Do **not** post the final spec with `TBD` or guessed values on **open** rows — ask first, then recap.++## AskQuestion — tile body from code++When discovery finds **2+** candidates, prompt like:++**Title:** `Which existing product UI should this widget tile reuse?`++**Subtitle:** `Found in the repo — picks drive product UI parity and run_* wiring.`++**Options (examples — replace with your discovery):**++- `ErrorTrackingIssueList` — `/error-tracking` issues list+- `SessionRecordingPreview` — session replay playlist rows+- **Something else** — I'll describe in chat++Always include **Something else / I'll describe** so the engineer is not boxed in.++**Do not** use abstract-only options (e.g. "List/table of entities", "Card grid", "Single KPI") without naming repo components — those are agent inferences, not user choices.++If the request already names a scene or component and discovery confirms it, **skip** this question.++## AskQuestion — do not ask++**Banned prompts** (infer, discover in repo, or defer to spec recap):++- "copy spine", "implementation template", "which shipped widget to mirror"+- **Add-widget modal placement**, **`groupId`**, "variant in existing … group", "sibling of …", "first widget for new product group"+- Registry / `validate_*` / test file layout (unless engineer raised it)+- **Generic tile body taxonomy** without code discovery first — e.g. "List/table", "Card grid", "Single KPI" with no component/scene names+- "What should the tile body show?" with only abstract visualization options+- **Agent-deferral options** — "Not sure — recommend/pick from my answers", "Other…" when you could ask a specific question instead++**Do ask** (after [discovery](#discover-product-ui-in-the-repo)): anything still **open** per [resolve ambiguity](#resolve-ambiguity-ask-dont-guess) — product area, which discovered UI, tile behavior if nothing found, config, RBAC/setup. Chart-only discovery → redirect to insight, not a question.+## Always confirm (even when inferred)Include in the spec recap — engineer signs off:-| Field | Why it matters |-| -------------------------- | ----------------------------------------------------- |-| **`widget_type`** | Immutable registry/DB key |-| **`groupId`** | Add-modal section; variants share group, not type |-| **Copy spine** | `error_tracking_list` vs `session_replay_list` |-| **Query runner** | Exact function `run_*` calls — no parallel query path |-| **Variant vs new product** | New `groupId` → checklist §4c |+| Field | Why it matters |+| ---------------------------------- | ----------------------------------------------------------------------------------------------------- |+| **`widget_type`** | Immutable registry/DB key |+| **`groupId` + Add widget section** | Agent-inferred — recap as human label + variant/first ([rules](#infer-groupid-add-modal)) |+| **Implementation template** | Agent-inferred — state in recap ([rules](#infer-implementation-template)); engineer corrects if wrong |+| **Query runner** | Exact function `run_*` calls — no parallel query path |+| **Product UI reference** | From [repo discovery](#discover-product-ui-in-the-repo) — scene + components |## Ask when not stated-Skip rows already answered. Cap at 6 per round.+Use as a **checklist of what might still be open** after discover + infer — not a form to dump on the user. Skip rows already locked. Work through [resolve ambiguity](#resolve-ambiguity-ask-dont-guess); cap **6 questions per round**.### Product placement-1. **Add-modal group** — Variant in an existing group (which sibling?) or first widget for a new product area?-2. **Label + description** — Picker name and one-line description (not the internal `widget_type`).+1. **Label + description** — Picker name and one-line description (what users see in **Add widget**). Not the internal `widget_type`. Ask only if the request does not imply these.### Data and UI-3. **Visualization** — List/table (default), metric, chart, or custom? (Non-list → cannot fully copy list spine.)-4. **Query source of truth** — Which existing query runner should `run_*` call?-5. **UI reuse** — `products/<product>/frontend/`, `scenes/<area>/`, or net-new in `widgets/<product>/`?-6. **Result shape** — Same as sibling `{ results: [...] }` or different?+2. **Tile body** — Filled by [repo discovery](#discover-product-ui-in-the-repo). Ask only when multiple candidates or nothing found; options must name **components + scene**. Chart-primary discovery → stop ([architecture.md § Charts](architecture.md#charts--use-insight-tiles-not-widgets)).+3. **Query source of truth** — Usually inferred from the same scene as the UI; ask only if discovery surfaces multiple runners.+4. **Result shape** — Same as sibling `{ results: [...] }` or different? (Often infer from chosen UI + runner.)### Config and edit modal-7. **Editable config** — Limit, sort, date range, filter test accounts, product-specific filters?-8. **Defaults** — Default limit, sort, date range when tile is first added?-9. **Hardcoded for v1** — Anything that looks configurable but should stay fixed?+5. **Editable config** — Limit, sort, date range, filter test accounts, product-specific filters?+6. **Defaults** — Default limit, sort, date range when tile is first added?+7. **Hardcoded for v1** — Anything that looks configurable but should stay fixed?### Tile chrome and layout-10. **Default size** — Match sibling `defaultLayout` or different `w`/`h`?-11. **Minimum resize** — Explicit catalog `minH`? (Platform floor is 4 rows.)-12. **Header "View" link** — `titleHref` to a product scene?+8. **Default size** — Match sibling `defaultLayout` or different `w`/`h`?+9. **Minimum resize** — Explicit catalog `minH`? (Platform floor is 4 rows.)+10. **Header "View" link** — `titleHref` to a product scene? (Often infer from discovery.)### Access, setup, limits-13. **Product RBAC** — Same `productAccess` as sibling or different?-14. **Setup before data** — Project prerequisite? Catalog `availability` vs inline gate in `Component` ([availability-and-gating.md](availability-and-gating.md)).-15. **Listing throttles** — Same as standalone product API (replay pattern)?-16. **Denied access copy** — Generic lock or custom message?+11. **Product RBAC** — Same `productAccess` as sibling or different?+12. **Setup before data** — Project prerequisite? Catalog `availability` vs inline gate in `Component` ([availability-and-gating.md](availability-and-gating.md)).+13. **Listing throttles** — Same as standalone product API (replay pattern)?+14. **Denied access copy** — Generic lock or custom message?### Sharing and agents-17. **Public/shared dashboards** — Default placeholder or custom **`sharedPlaceholder`**?-18. **MCP catalog copy** — Extra `config_schema_hints` beyond validate defaults?+15. **Public/shared dashboards** — Default placeholder or custom **`sharedPlaceholder`**?+16. **MCP catalog copy** — Extra `config_schema_hints` beyond validate defaults?### Defer to Phase 2 (mention, do not block v1)@@ -73,11 +210,15 @@ Post this block for confirmation:```textwidget_type:-groupId:-label / description:-copy_from: error_tracking_list | session_replay_list+groupId: # agent-inferred+add widget section: # DASHBOARD_WIDGET_GROUP_LABELS label+placement: variant | first_in_group+label / description: # picker copy+implementation_template: error_tracking_list | session_replay_listrun_* delegates to:UI imports from:+product UI reference (scene/tab/story/screenshot or “match sibling”):+product UI parity (components to reuse):config fields:defaults:defaultLayout (w, h, minW, minH):@@ -92,15 +233,19 @@ throttles: none | same as <product API>Example:```text-widget_type: error_tracking_trends+widget_type: error_tracking_top_by_volumegroupId: error_tracking-label / description: Issue trends / Rolling trend of top issues-copy_from: error_tracking_list-run_* delegates to: products.error_tracking.backend... (same as list)-UI imports from: products/error_tracking/frontend/ (new chart wrapper)-config fields: limit, dateRange, filterTestAccounts-defaults: limit 10, dateRange -7d-defaultLayout: w 6 h 4 minH 3+add widget section: Error tracking+placement: variant (alongside "Top issues")+label / description: Top issues by volume / Highest-volume error issues+implementation_template: error_tracking_list+run_* delegates to: (same runner as error_tracking_list, different default orderBy/limit)+UI imports from: products/error_tracking/frontend/ — ErrorTrackingIssueList+product UI reference: /error-tracking — issues list (default sort: occurrences)+product UI parity: ErrorTrackingIssueList, ErrorTrackingIssueListSkeleton, ErrorTrackingIngestionPrompt+config fields: limit, orderBy, orderDirection, dateRange, filterTestAccounts+defaults: limit 10, orderBy occurrences, dateRange -7d+defaultLayout: w 6 h 5 minH 3productAccess: error_tracking (same as list)setup gating: inline Component gate (match ET)sharedPlaceholder: default@@ -108,12 +253,22 @@ titleHref: /error-trackingthrottles: none```-## When to skip the question batch+**Not a widget** (redirect at intake):++```text+Request: "error tracking trend chart widget"+→ Insight tile (e.g. Trends on $exception events or saved ET insight) — not a new widget_type+```++## When to skip questions++Skip the question batch only when **no open rows** remain in your locked/open list (product, UI, runner, label, config you care about). Still post the full spec recap so the engineer can correct inferences.-Request already specifies product area, visualization, query source, and variant vs new group. Still post the spec recap.+Partial clarity (e.g. product known, UI ambiguous) → ask **only** for the open rows, not the full checklist above.## Red flags — stop and clarify+- **Chart-primary widget** (trend line, funnel viz, breakdown chart as the tile body) → **do not ship**; save/build an **insight** and add it to the dashboard ([architecture.md § Charts → insight tiles](architecture.md#charts--use-insight-tiles-not-widgets))- Same `widget_type`, different config → need a **new** type- Filters in ⋯ menu → settings modal only ([composition.md](composition.md))- Special case in `dashboard.py` → registry-driven ([permissions-and-sharing.md](permissions-and-sharing.md))diff --git a/products/dashboards/CONTRIBUTING.md b/products/dashboards/CONTRIBUTING.mdindex d048a10b7633..04e5c1463219 100644--- a/products/dashboards/CONTRIBUTING.md+++ b/products/dashboards/CONTRIBUTING.md@@ -36,7 +36,10 @@ Layer table, registry shapes, copy/move, analytics, and typing details: [`.agent| MCP / REST | [`references/mcp.md`](../../.agents/skills/dashboard-widgets/references/mcp.md) || Keep skill docs in sync | [`references/skill-maintenance.md`](../../.agents/skills/dashboard-widgets/references/skill-maintenance.md) |-**Critical rule:** product RBAC is registry-driven — see [permissions-and-sharing.md § Product RBAC](../../.agents/skills/dashboard-widgets/references/permissions-and-sharing.md#product-rbac).+**Critical rules:**++- Product RBAC is registry-driven — see [permissions-and-sharing.md § Product RBAC](../../.agents/skills/dashboard-widgets/references/permissions-and-sharing.md#product-rbac).+- **Charts/trends on a dashboard → insight tiles**, not new widget types — [architecture.md § Charts](../../.agents/skills/dashboard-widgets/references/architecture.md#charts--use-insight-tiles-not-widgets).## Frontend / backend parity