Skip to content

Add Query Insights Studio view#1508

Draft
sorenbs wants to merge 3 commits intomainfrom
codex/query-insights-studio-port
Draft

Add Query Insights Studio view#1508
sorenbs wants to merge 3 commits intomainfrom
codex/query-insights-studio-port

Conversation

@sorenbs
Copy link
Copy Markdown
Member

@sorenbs sorenbs commented May 4, 2026

Summary

  • Adds the host-provided Query Insights Studio view, including prisma-log stream ingestion with initial snapshot replay plus live SSE follow, charted latency/QPS metrics, table filtering/sorting, pause buffering, and the right-side AI recommendation sheet.
  • Wires the ppg-dev demo to ensure and append every successful SQL execution into the prisma-log stream, with Studio system queries classified via visibility metadata instead of filtered out.
  • Makes stream event time rendering understand ts epoch fields, so prisma-log rows show real relative/exact times in the Streams view.
  • Adds Query Insights architecture docs, feature docs, changeset, URL state, navigation/command palette integration, and focused coverage.
  • Includes two review fixes needed for local CI signal: current @prisma/dev runtime assets no longer include pglite-seed.tar.gz, and the TanStack DB architecture allowlist now includes the existing stream-events collection boundary.

Validation

  • git diff --check
  • pnpm typecheck
  • pnpm build
  • COREPACK_ENABLE_STRICT=0 pnpm check:exports
  • pnpm test:data
  • pnpm test:demo
  • pnpm test:checkpoint
  • pnpm exec vitest --project release
  • NODE_OPTIONS=--max-old-space-size=8192 pnpm exec vitest --passWithNoTests --project ui --maxWorkers=2 --exclude ui/studio/views/table/ActiveTableView.filtering.test.tsx
  • git ls-files -m -o --exclude-standard | rg '\.(ts|tsx)$' | xargs pnpm exec eslint (warnings only from existing data/query.ts any usage)
  • pnpm test demo/ppg-dev/query-insights.test.ts ui/studio/views/query-insights/codecs.test.ts ui/studio/views/query-insights/rows.test.ts
  • pnpm exec eslint demo/ppg-dev/query-insights.ts demo/ppg-dev/query-insights.test.ts ui/studio/views/query-insights/types.ts ui/studio/views/query-insights/codecs.ts ui/studio/views/query-insights/codecs.test.ts ui/studio/views/query-insights/rows.ts ui/studio/views/query-insights/rows.test.ts
  • pnpm test ui/studio/views/query-insights/use-query-insights-stream.test.tsx ui/studio/views/query-insights/codecs.test.ts ui/studio/views/query-insights/rows.test.ts ui/hooks/use-stream-events.test.tsx demo/ppg-dev/query-insights.test.ts
  • pnpm exec eslint ui/studio/views/query-insights/use-query-insights-stream.ts ui/studio/views/query-insights/use-query-insights-stream.test.tsx ui/hooks/use-stream-events.ts ui/hooks/use-stream-events.test.tsx
  • pnpm test ui/studio/views/query-insights/QueryInsightsView.test.tsx ui/studio/views/query-insights/use-query-insights-stream.test.tsx
  • pnpm demo:ppg, then POST /api/query with meta.visibility = "studio-system" and GET /api/streams/v1/stream/prisma-log?format=json&offset=-1 to verify Studio system executions are appended with visibility: "studio-system".
  • Playwright smoke against http://localhost:4310/#view=query-insights verified Query Insights populates immediately from the existing prisma-log snapshot.
  • Playwright smoke against http://localhost:4310/#stream=prisma-log&view=stream verified ts-backed rows render relative/exact times instead of Unknown time.
  • Playwright smoke was run during implementation for Query Insights stream ingestion, charts, table corner, select font, and AI detail sheet.

Notes

A full all-project pnpm test run was attempted after stopping the demo server. It progressed through the suite but the existing ui/studio/views/table/ActiveTableView.filtering.test.tsx file spins a Vitest worker into high CPU/heap when run as a whole. The changed Query Insights/UI/data/demo/release/checkpoint paths pass with the targeted commands above.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Compute preview deployed.

Branch: codex/query-insights-studio-port
Service: codex-query-insights-studio-port
Preview: https://cmoqqnxr717aj08dung4v9jsv.cdg.prisma.build
Version: https://cv-3b4dac2399b4.cdg.prisma.build

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