Skip to content

feat(taxonomy): add property events list on property detail#7

Open
lordspline wants to merge 1 commit into
masterfrom
capy/property-definition-events-list
Open

feat(taxonomy): add property events list on property detail#7
lordspline wants to merge 1 commit into
masterfrom
capy/property-definition-events-list

Conversation

@lordspline

@lordspline lordspline commented Jun 17, 2026

Copy link
Copy Markdown

Problem

Property detail pages did not show which event definitions currently use a property, forcing users to infer usage elsewhere or run heavier event queries. This fixes PostHog#26463 by exposing ingestion metadata on the property detail view without a live ClickHouse scan.

Changes

  • Adds GET /api/projects/{project_id}/property_definitions/{id}/events/ with typed serializers, property_definition:read permissions, limit/offset pagination, and team-scoped Postgres metadata queries.
  • Uses posthog_eventproperty as the authoritative association source populated asynchronously by ingestion; joins to current EventDefinition rows for navigation and event-level last-seen context, so deleted event definitions are omitted and empty means no current event definition is known to use the property.
  • Adds a Data management property-detail section with loading, error/retry, empty, pagination, count, freshness copy, event last-seen context, and links to each event definition.
  • Regenerates OpenAPI/frontend/MCP artifacts for the new typed endpoint; the MCP scaffolded tool remains disabled.
  • Adds backend and frontend tests for scoping, permissions, pagination, stale/deleted definitions, empty state, query count, loader behavior, and UI rendering.

How did you test this code?

  • Agent-run: hogli test posthog/api/test/test_property_definition.py -k property_definition_events — 7 passed.
  • Agent-run: hogli test frontend/src/scenes/data-management/definition/definitionLogic.test.ts frontend/src/scenes/data-management/definition/DefinitionView.test.tsx — 9 passed.
  • Agent-run: hogli build:openapi -y.
  • Agent-run: pnpm --filter=@posthog/frontend typegen:check -- --files src/scenes/data-management/definition/definitionLogic.ts.
  • Agent-run: pnpm --filter=@posthog/frontend typescript:check.
  • Agent-run: pnpm --filter=@posthog/mcp typecheck.
  • Agent-run: ruff format --check / ruff check on touched Python files and oxfmt --check / oxlint on touched frontend files.
  • Agent-run browser verification against local PostHog: seeded one populated property and one empty property, verified populated count/list/last-seen/link navigation, and verified the empty state.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Docs update

No docs update; this is an in-product Data management detail-page improvement.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Captain Capy implemented this end to end. The main design choice was to use ingestion-maintained posthog_eventproperty metadata joined with current EventDefinition rows, rather than scanning raw event data, because the product need is a current metadata association list with explicit asynchronous freshness semantics. The new endpoint is typed and generated for frontend use; the MCP YAML was synced but left disabled by default.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@lordspline lordspline added the capy Generated by capy.ai label Jun 17, 2026 — with Capy AI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capy Generated by capy.ai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show list of events where a property is used under Data Management

1 participant