: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: stop pointing agents at quill for main-app UI (#75914)
Michael Matloka066e4e2fc1c3
diff --git a/AGENTS.md b/AGENTS.mdindex b28d5d396903..065ab73f5164 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -179,7 +179,7 @@ See [.agents/security.md](.agents/security.md) for security guidelines — least- Frontend: TypeScript required, explicit return types- Frontend: If there is a kea logic file, write all business logic there, avoid React hooks at all costs.- Frontend (quill design system): before writing UI that imports `@posthog/quill` / `lib/ui/quill`, read [packages/quill/packages/primitives/AGENTS.md](packages/quill/packages/primitives/AGENTS.md) — component choice (dropdown vs select vs combobox, accordion vs collapsible, etc.), composition, and spacing rules. Charts: [packages/quill/packages/charts/AGENTS.md](packages/quill/packages/charts/AGENTS.md); DataTable/DateTimePicker: [packages/quill/packages/components/AGENTS.md](packages/quill/packages/components/AGENTS.md)-- Frontend (quill vs LemonUI): LemonUI is the default in the main app. Use quill for menus, comboboxes, and autocompletes (`DropdownMenu`, `Combobox`, `Autocomplete` from `@posthog/quill`), with the trigger styled to match the surrounding scene's existing UI (LemonButton / ButtonPrimitive). Don't add new `LemonMenu` or `lib/ui/DropdownMenu` (Radix) menus — those are legacy. Don't mix quill and Lemon components within one component's internals. Quill uses Base UI's `render` prop, not Radix's `asChild` — don't carry `asChild` over when converting+- Frontend (quill vs LemonUI): quill is for MCP apps and the desktop app. It is deliberately more compact than LemonUI, so its components look out of place in the main app, and there is no active migration of the main app onto it. In `frontend/src/` and `products/*/frontend/`, use LemonUI, including for menus — `LemonMenu` with a `LemonButton` trigger is the default there. `lib/ui/DropdownMenu` (Radix) is legacy; don't add new ones. Where quill is the right library, don't mix quill and Lemon components within one component's internals, and note that quill uses Base UI's `render` prop rather than Radix's `asChild`, so don't carry `asChild` over when converting- Frontend: Any button or form submit that triggers a network request must guard against double-submission — disable the button and show a loading state (`loading` / `disabledReason` on `LemonButton`, or equivalent) while the request is in flight. Never leave a submit button clickable during an active mutation; reset the state in both success and error paths. This applies to `<form onSubmit>` handlers, `onClick` handlers that call `api.*`, and any kea `listener` that issues a request — wire the in-flight state (loader `*Loading` selectors, local `useState`, or a reducer) into the trigger's disabled/loading props.- Imports: Use oxfmt import sorting (automatically runs on format), avoid direct dayjs imports (use lib/dayjs)- CSS: Use tailwind utility classes instead of inline stylesdiff --git a/frontend/src/AGENTS.md b/frontend/src/AGENTS.mdindex 0027adb41d29..17ca50887a37 100644--- a/frontend/src/AGENTS.md+++ b/frontend/src/AGENTS.md@@ -8,25 +8,27 @@ Applies to any change under `frontend/src`. This is a **discovery + cadence** guWhere to look, in order:-1. `frontend/src/lib/lemon-ui/` — the main-app default (~50 `Lemon*` components). Grep here first.-2. `@posthog/quill` (`packages/quill/`) — preferred for menus, comboboxes, autocompletes, and new charts. Read `packages/quill/packages/primitives/AGENTS.md` for component choice **before** importing.-3. `frontend/src/lib/ui/` and `frontend/src/lib/components/` — older / app-specific shared pieces.+1. `frontend/src/lib/lemon-ui/` — the main-app default (~50 `Lemon*` components). Grep here first, and in most cases stop here.+2. `frontend/src/lib/ui/` and `frontend/src/lib/components/` — older / app-specific shared pieces.++`@posthog/quill` is **not** for this tree. It targets MCP apps and the desktop app, it's deliberately more compact than LemonUI, and the main app isn't being migrated onto it, so quill components read as out of place here. A handful of files already import it; treat those as exceptions rather than a pattern to copy.Common reinventions and what to use instead:-| You're about to build… | Use instead |-| ------------------------------------ | ----------------------------------------------------------------------------------------- |-| a `<table>` | `LemonTable` (`lib/lemon-ui/LemonTable`) — has sorting, pagination, loading, empty states |-| a colored status pill / count badge | `LemonBadge` |-| a small removable chip | `LemonSnack` or `LemonTag` |-| a form field label | `LemonLabel` |-| a dropdown / combobox / autocomplete | quill `DropdownMenu` / `Combobox` / `Autocomplete` (not a new `LemonMenu`) |-| a card / panel | `LemonCard` |-| a modal / confirm dialog | `LemonModal` / `LemonDialog` |+| You're about to build… | Use instead |+| ----------------------------------- | ----------------------------------------------------------------------------------------- |+| a `<table>` | `LemonTable` (`lib/lemon-ui/LemonTable`) — has sorting, pagination, loading, empty states |+| a colored status pill / count badge | `LemonBadge` |+| a small removable chip | `LemonSnack` or `LemonTag` |+| a form field label | `LemonLabel` |+| a dropdown menu of actions | `LemonMenu` with a `LemonButton` trigger (not a new `lib/ui/DropdownMenu`) |+| a select / combobox / autocomplete | `LemonSelect`, `LemonInputSelect` |+| a card / panel | `LemonCard` |+| a modal / confirm dialog | `LemonModal` / `LemonDialog` |If nothing fits, say so and propose extending the existing component before adding a new one. Don't silently fork.-> LemonUI vs quill, and the quill spacing/composition rules, live in the root `AGENTS.md` ("Code Style → Frontend (quill …)") and `packages/quill/packages/primitives/AGENTS.md`. Follow those — don't mix quill and Lemon inside one component's internals.+> LemonUI vs quill lives in the root `AGENTS.md` ("Code Style → Frontend (quill vs LemonUI)"). If you're working somewhere quill genuinely applies (an MCP app, the desktop app), `packages/quill/packages/primitives/AGENTS.md` has its component-choice and spacing rules, and the two libraries must not be mixed inside one component's internals.## Rule 2 — Don't handwrite API types; use the generated ones