Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/query-insights-studio.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@prisma/studio-core": minor
---

Add an optional Studio Queries view backed by query-insights snapshots from the Studio BFF bridge.
Render SQL result visualizations with Studio-owned Bklit chart configs instead of Chart.js configs.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ dist
!.agents/skills/shadcn/
.agents/skills/shadcn/*
!.agents/skills/shadcn/SKILL.md
!.agents/skills/impeccable/
!.agents/skills/impeccable/**
.playwright-cli/
.env
.env.local
Expand Down
3 changes: 2 additions & 1 deletion Architecture/compute-preview-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ publishes it into the dedicated Compute project named `studio-preview`.
- If the service already exists, the helper MUST deploy a new version to that
same service.
- Deployments MUST use the published CLI entrypoint:
`bunx @prisma/compute-cli@latest deploy --skip-build --path deploy --entrypoint bundle/server.bundle.js --http-port 8080 --env STUDIO_DEMO_PORT=8080`.
- `bunx @prisma/compute-cli@latest deploy --skip-build --path deploy --entrypoint bundle/compute-entrypoint.js --http-port 8080`.
- The Compute artifact MUST include `bundle/compute-entrypoint.js`, which defaults `STUDIO_DEMO_PORT` to `8080` before importing `bundle/server.bundle.js`. Preview deploys MUST NOT pass runtime environment variables through the Compute CLI while its deploy API rejects the CLI's `envVars` request key.

## PR Feedback

Expand Down
6 changes: 4 additions & 2 deletions Architecture/navigation-url-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Navigation state MUST be URL-driven and managed through `useNavigation` + Nuqs.

This architecture governs:

- active Studio view (`table`, `schema`, `console`, `sql`, `stream`)
- active Studio view (`table`, `schema`, `console`, `sql`, `stream`, `queries`)
- active schema/table/stream
- active stream follow mode
- active stream aggregation-panel visibility
Expand Down Expand Up @@ -78,6 +78,7 @@ Adding a new URL key requires updating `StateKey` in `nuqs.ts` first.
- `search`: `""`
- `searchScope`: `"table"` (legacy default)
- `view`: `"table"`
- `queries`: no standalone default; only meaningful when the current adapter provides query insights
- `stream`: no default; only meaningful when `view=stream`
- `streamFollow`: no global default in `useNavigation`; the active stream view MUST resolve an absent value to `tail` and materialize that into the hash
- `aggregations`: no global default in `useNavigation`; the active stream view MUST treat an absent flag as closed and MUST NOT materialize that closed state into the hash
Expand All @@ -86,9 +87,10 @@ Adding a new URL key requires updating `StateKey` in `nuqs.ts` first.
When Studio is running without a database connection but with Streams enabled:

- the resolved default `view` MUST become `"stream"` instead of `"table"`
- stale database-oriented views such as `table`, `schema`, `console`, and `sql` MUST resolve back to the stream view instead of trying to render database-only UI against a disabled database session
- stale database-oriented views such as `table`, `schema`, `console`, `sql`, and `queries` MUST resolve back to the stream view instead of trying to render database-only UI against a disabled database session

When URL params are stale from a previous DB, invalid `schema`/`table` values MUST be resolved to valid current defaults.
When URL params contain `view=queries` but the current adapter does not provide query insights, `useNavigation` MUST resolve back to the default view and the sidebar MUST hide the Queries link.
Shared table page size and infinite-scroll mode are not derived from URL defaults; they are restored through Studio UI state and then mirrored into query behavior by `usePagination`.

## Hash Adapter Contract
Expand Down
23 changes: 21 additions & 2 deletions Architecture/non-standard-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,24 @@ It deliberately excludes:
- The storage breakdowns also need collapsible ledger-style accounting boxes whose headers surface the section totals when folded shut, plus faint shared-cap annotations that sit beside right-aligned byte values and one shared cap marker spanning both Routing and Exact cache rows, which is not a stock ShadCN pattern.
- No stock ShadCN pattern covers that descriptor-driven observability layout, especially when the UI must distinguish logical bytes from physical storage signals, separate search coverage from historical run indexes, hide unconfigured routing rows, and keep the remaining cost caveats explicit instead of inventing unavailable totals.

### Queries Live Table And Detail Sheet

- Canonical component:
- [`ui/studio/views/queries/QueriesView.tsx`](ui/studio/views/queries/QueriesView.tsx)
- Closest standard ShadCN alternatives:
- `Table`
- `Card`
- `Sheet`
- `Select`
- `ToggleGroup`
- `Badge`
- `Skeleton`
- Why it stays non-standard:
- Query insights need a live operational table with provider-driven polling, a live activity chart, table filtering, sort controls, row selection, and previous/next navigation inside a detail sheet.
- The activity chart is a Studio-specific SVG timeline that derives throughput and latency from snapshot deltas, supports a bounded time-window switcher, and exposes point-level hover readings. No standard ShadCN chart primitive covers that observability display.
- The same surface conditionally embeds AI recommendations when Studio's shared `llm` hook is available, while disappearing entirely when the embedder does not provide query-insights data.
- No stock ShadCN component models that combined observability workflow, so Studio keeps a custom composite built from standard ShadCN primitives.

## Standardization Candidates

These are the current high-signal places where Studio is bypassing a plausible standard ShadCN component or composition pattern.
Expand Down Expand Up @@ -250,11 +268,12 @@ These are the current high-signal places where Studio is bypassing a plausible s
- Files:
- [`ui/studio/views/sql/SqlResultVisualization.tsx`](ui/studio/views/sql/SqlResultVisualization.tsx)
- [`ui/studio/views/sql/SqlView.tsx`](ui/studio/views/sql/SqlView.tsx)
- [`ui/components/charts`](ui/components/charts)
- Current UI:
- Borderless Chart.js canvas injected into a `DataGrid` header row, wrapped in a custom sticky white band with centered/clamped sizing, plus a custom text-and-icon visualization trigger placed on the SQL result summary line.
- Bklit ShadCN chart primitives injected into a `DataGrid` header row, wrapped in a custom sticky background band with centered/clamped sizing, plus a custom text-and-icon visualization trigger placed on the SQL result summary line.
- Plausible standard ShadCN alternative:
- `Card`
- `Button`
- No standard ShadCN chart primitive exists; the chart body must remain custom.
- The Bklit registry components provide the chart primitives, but the SQL result surface still needs a custom `DataGrid.getBeforeHeaderRows(...)` composition so the chart scrolls with the result grid.
- Confidence:
- High
Loading