This PR migrates the whole monorepo to use Tailwind v4:
- Removed `@tailwindcss/container-queries` plugin since it's included by
default in v4,
- Bump all instances of Tailwind to v4. Made minimal changes to the
shared config to remove non-supported features (`alpha` mentions),
- Migrate all apps to be compatible with v4 configs,
- Fix the `typography.css` import in 3 apps,
- Add missing rules which were included by default in v3,
- Run `pnpm dlx @tailwindcss/upgrade` on all apps, which renames a lot
of classes
- Rename all misnamed classes according to
https://tailwindcss.com/docs/upgrade-guide#renamed-utilities in all
apps.
---------
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
This PR preps the monorepo for a migration to Tailwind v4:
- Bump all Tailwind dependencies and libraries to the latest possible
version, while still compatible with Tailwind 3.
- Cleans up obsolete Tailwind 3 specific options and configs.
- Cleans up unused CSS files and fixes the CSS imports.
- Migrates all `important` uses in `@apply` lines to using the `!`
prefix.
- Move `typography.css` to the `config` package and import it from the
apps.
- Migrated all occurrences of `flex-grow`, `flex-shrink`,
`overflow-clip` and `overflow-ellipsis` since they're deprecated and
will be removed in Tailwind 4.
- Make the default theme object typesafe in the `ui` package.
- Migrate all `bg-opacity`, `border-opacity`, `ring-opacity` and
`divider-opacity` to the new format where they're declared as part of
the property color.
- Bump and unify all imports of `postcss` dependency.
This PR moves several components which rely on `next` out of the `ui`
package to the `ui-patterns` package.
`ui-patterns` package is intented to be imported with specific imports
so it's ok if there are components reliant on `next` in there.
The `SonnerToaster` component has removed its dependency by requiring a
prop for `theme`.
## Problem
The Query Performance page loaded all results in a single query with a
fixed limit of 20 rows, giving users no way to browse beyond the first
page. There was also no way to control how many rows were shown at once.
## Fix
adds pagination
## How to test
- Navigate to `/observability/query-performance` in Studio
- scroll to bottom
- should automatically load more results
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This PR fixes some prettier issues:
- Bump and unify all prettier versions to 3.7.3 across teh whole repo
- Bump the SQL prettier plugin
- When running `test:prettier`, check `mdx` files also
- Run the new prettier format on all files
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Add a Query Performance page implementation powered by
[supamonitor](https://github.com/supabase/supamonitor).
[Context](https://linear.app/supabase/project/build-extension-for-supabase-query-insights-df4fb145352c/overview)
This looks largely the same as the pg_stat_monitor implementation:
<img width="2556" height="960" alt="Screenshot 2026-02-12 at 7 35 47 PM"
src="https://github.com/user-attachments/assets/bf37466e-f7af-41f2-b4f2-cf8eb6a8c76f"
/>
Only available on projects on custom AMI - existing users are unaffected
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Supamonitor-based query performance view: charts, aggregated metrics,
date-range controls, and export/download.
* Added "Application" column for per-application tracking.
* Interactive Supamonitor grid: sorting, filtering, keyboard navigation,
selection, retry/error handling.
* Automatic per-project Supamonitor detection with toggleable UI
integration.
* **Bug Fixes**
* Chart latency calculation prefers histogram data for more accurate
p95.
* **Documentation**
* Minor blog formatting fix.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: kemal <hello@kemal.earth>
Co-authored-by: Ali Waseem <waseema393@gmail.com>
* feature: add explain with AI in query performance
* updated comment
* updated to send message right away
* updated prompt
* added event tracking for button
* updated prompt
* updated to use track
* updated event name
* added flag for explain with AI
* updated to remove optional
* feat: change the check to show index advisor tab at all times
* fix: hide add to log drains on export menu in query perf
* fix: small fallback for pathname check
* fix: query perf header block responsiveness
* feat: admonition for index advisor
* fix: add aria-describedby to query perf sheet
* feat: proper way to do sheet description
* chore: better title spacing in panel
* fix: indexes in use empty state
* fix: key in observability menu
* feat: better highlighting of index advisor issues
* feat: add docs button to empty indexes tab
* feat: remove unused code
* feat: use button tooltips for reset and refresh to gain space
* feat: add dismiss to index advisor banner
* feat: add warnings filter to query perf
* feat: filter all queries for warnings
* fix: selected state for warning rows
* fix: fallback for isLogs check
* fix: other instance of download button
---------
Co-authored-by: Ali Waseem <waseema393@gmail.com>
* Use the "eslint" command instead of built-in next lint since it's getting obsolete.
* Bump all deps to support eslint 9+.
* Convert the rules in eslint-config-supabase to be flat-config compatible.
* Migrate all apps to use the new eslint config rules.
* Fix all errors found in the new setup.
* Fix the no default exports ignores.
* Scan all files for linting in studio.
* Fix all lint errors.
* Make the reportUnusedDisableDirectives a warning.
* feat: setup chart area and tabs
This sets up the area where we can expect the insights chart as well as the tabs mechanism.
* feat: parse pg_stat_monitor logs as json
* feat: create query perf chart utils and move transfrom function
Created a utils file for our QueryPerformanceChart component. This moves the logs to JSON transform function there.
* feat: add timerange to chart
* feat: add date selector to query perf overview
This adds the selector to the top right of the page allowing the user to switch between last hour, 3 hours and 24 hours
* feat: modify chart component to accomodate hiding bits
* feat: add metrics to each tab
* chore: update to 60 min by default and some css
* feat: centralise data parsing for logs
* feat: clean up filters bar
This rewires the export to give you the aggregate pg_stat_monitor data. Also removes unused buttons and filters.
* feat: percentiles for query latency chart
* feat: filter out non evenets from pg_stat_monitor logs
* feat: utils for cache misses and hits
* feat: add selected query to chart on click
* feat: add click through to query panel
* chore: tidy up files
* chore: distinction between selected and open panel
* feat: move query performance fully into reports area
* fix: preserve query params on reports link
* fix: remove right icon syntax in report menu
* chore: remove cache misses from cache chart
* refactor: backwards compatibility for statements if right db version isnt available
* chore: delete randomly generated empty file
* chore: tidy up unused imports and vars
* chore: remove console logs
* chore: remove isMounted from query perf
* fix: cmd k query perf path
* feat: simplify query latency only p50 and p95
This seems to give us a more accurate reading as we can calculate these two
* fix: cache hit rate not showing inside query details
* chore: chart bg colour adjust
So it contrasts a little better on light mode.
* feat: show selected query on other verticals
* feat: bring back symlink in advisors
* fix: human readable formatting for total consumed times
* chore: accidental turkish spelling of performance
* fix: imports for renamed utils file
* feat: add tests for formatDuration util
* feat: move query details to sheet
This moves the click through on Query Performance to a sheet as opposed to a resizable area. This gives us more space to play with and sets us up for the Query details revamp.
* fix: tabs font size
* style: expand size of sheet
* feat: hasOverlay prop for sheets
* feat: add optional overlay for sheets
* fix: closing only when clicking outside of rows
* style: width of panel on different viewports
* fix: horizontal scroll for table
* fix: query queries label check in metrics
* feat: change calls label to count
This changes the column title for calls to count for clarity
* feat: add cache hit rate col and number formatting
Adds a cache hit rate column for each query as well as tidies up some number formatting.
* feat: add styling for 0 numbers
This makes anything marked as 0 feint in the table for easier parsing.
* chore: remove debug console log
* fix: silly next-env again
* nit: remove avg rows col
* nit: add toFixed to cache hit rate
* feat: add tooltip for role column
* feat: remove tabs and unify columns
This removes the tabs from Query Performance with unified columns in the table.
* chore: remove unused imports
* chore: small adjustment to min max and mean time col size
* feat: original experiment with metric cards
* fix: height of table container on load
* feat: add percentage background for time consumed col
Adds a percentage based background colour for time consumed column and reshuffles some columns.
* feat: working metrics above rows
* feat: simplify stats + go back full width
* style: bring up percentage bar opacity
* chore: remove reportType again
* feat: add metric queries to reset function
* fix: type error for passing query metrics
* fix: query queries plural thing
* chore: remove next-env weirdness
* feat: remove tabs and unify columns
This removes the tabs from Query Performance with unified columns in the table.
* chore: remove unused imports
* chore: small adjustment to min max and mean time col size
* chore: remove unused prop
* feat: tidy up query perf column headers
* feat: update col widths and which ones are sortable
This gives a reasonable column width to all cols as well as adds an option for us to filter out which columns we dont want to make the table sortable by.
* feat: column order and word wrapping for query
* feat: column data text align for numbers
* fix: pointer event was preventing index advisor icon popover
* feat: use code block instead of editor
Swapped Editor out for Code block as its less expensive and modified it to add pgsql syntax highlighting
* fix: small truncation issue
* chore: remove unused sort function
* fix: sort menu closing on first click
Sort menu of a column no longer disappears on first click
* feat: move sorting and ordering over to nuqs
This removes the usage of Next Router params and uses Nuqs instead for managing the QP table sorting and ordering.
* feat: add clear sorting button to filter bar
* chore: remove unused files
* fix: add highlighting for selected sort
* Nit update sort
* nit: smol styling update for direction
* feat: inian feedback on time based numbers
* fix: return number instead of string for total time
We were returning a string for total time percentage which meant the sorting was a little bit off
* Shift roles to nuqs
* chore: clean up
* fix: smaller viewport filter bar
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
* feat: remove redundant sort by
We had conflicting sort by dropdown which clashed with the individual column sorting itself. Either we do something similar to our table editor or leave it out for now. Opting to leave it out for now.
* fix: alignment of download dropdown
This aligns the download dropdown on the Query Performance page to look visually correct.
* feat: improved query search
This improves our query search in the Query Performance area. Now it does a local search through the available queries in the table. I removed it requesting the string from server for now. Simple
:x
q
* fix: increased width of filter popover
The roles filter popover is was too narrow for its contents. Increased teh size slightly.
* chore: remove commented out component
* chore: update placeholder for query filter
* fix: leftover prop on query performance page
* feat: reintroduce sql based query for search
Bringing back a hybrid approach - seems to work fine but also returns items that are not in your visible queries.
* feat: use debounce on search query
* feat: use nuqs instead of next router for roles
* Tiny optimization for debounced search to immediately run query if clearing input
* Add clear search CTA
* Remove client side searching
* Revert changes in useIndexInvalidation
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
* Add CodeBlock for SQL query display to add syntax highlight
* use monaco editor for better highlighting
* create `SqlMonacoBlock` component for SQL in detail panel
* add mean_time to most_time_comsuming queries
* make outline transparent
* Add keyboard navigation for query performance grid
* Stop default RDG behavior on arrow key navigation
* Update column minWidth values to remove horizontal scrollbar
* Load SqlMonacoBlock and Editor client-side only
- following a pattern in `SQLEditor.tsx`
fix: query performance empty columns
The role and total time columns were not rendering the results that were there. Added a check to make sure they render.
* init
* hovercard
* adds button to install index advisor
* hover card now now insert indexes
* update
* moved hook
* align alert dialog to design syste,
* Update index-advisor.utils.ts
* shows all index statements now
* Update query-performance.tsx
* Some refactors
* Clean up
* Fix
* One last nit refactor
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
* Switch all top-level imports for ui-patterns components to use specific components when importing.
* Remove the @ui-patterns shorthand since it works exactly the same without the @.
* More import fixes.
* Fix the ui-patterns tests.
* Add lucide-react to docs (to make the autocomplete work).
* Migrate the docs app icons.
* Migrate the ui-patterns.
* Remove the old icons from ui package.
* Migrate the www app from react-feather icons.
* Migrate all of studio icons.
* Migrate the only component in design-system.
* Fix an old import in ui package. Revert an import in docs app.
* Fix some pages in www.
* Remove unneeded files used in generation of icons.
* Fix a prettier error.
* Fix more issues in www.
* Fix an issue in Log Date picker.
* Replace all string sizes with number sizes because the icons grew in some cases.
* Fix more imports in security page.
* Fix an extra import.
* Remove the size prop from all icons if they're in a button and they match the button size.
* Minor fixes for docs and www.
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
* UpgradeToPro remove project ref and org slug props
* Add check in Docs/ResourceContent
* Add conditional for accessing query property in QueryPerformanceGrid
* Add fallback value for lastPage in notifications-v2-query
* Simplify logic for finding api key in TerminalInstructions, EdgeFunctionDetails, [ref]/api/index
* Minor fixes and refactors
* Fix type issues