Commit Graph
225 Commits
Author SHA1 Message Date
kemal.earth 3aa22f14c8 fix(studio): index advisor recommendation column name (#43601)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Spotted by @kostasb, index advisor was recommending slightly different
column names. Index advisor was running on mismatched queries thus
recommending for the wrong table.
2026-03-11 16:16:31 +00:00
Alaister Young e235798276 [FE-2738] fix(studio): use read replica identifier in table rows keys (#43627)
Previously `connectionString` was passed into the query key for
`table-rows`. Since `connectionString` is unstable, it would cause the
query key to change randomly, often making the user experience brief
random "no rows found" states while data loaded for the new key.

This PR uses `readReplicaIdentifier` as a stable version of
`connectionString`, maintaining the existing functionality while
avoiding the unnecessary data reloads.

Note that there are still quite a few places where `connectionString` is
passed into the query key. We'll fix these as follow up PRs.

I'm opting to also include the fix from
https://github.com/supabase/supabase/pull/43572 in here for consistency.

**To test:**
- Ensure table editor functions normally
- Use the table editor with a read replica selected
2026-03-11 23:09:35 +08:00
Ali Waseem 818cbd36fd fix: new filter updates in table editor better mobile view (#43604)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Right now the new filter bar just does not work on mobile. It fully
collapses and does not appear correctly. This make it stack on smaller
screens and shows it to be visible. Works on smaller tabs

Note: there is a bit of awkwardness on certain screen sizes where its
one long row, will fix that later. This is better than nothing right now
2026-03-10 23:26:58 +01:00
Ali Waseem f7d3d2d3c3 feat: filter by value for simple types on new filter experience (#43579)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

- Added filter by value for the new feature bar experience
- Will follow up with an E2E test later
2026-03-09 14:48:59 -06:00
Ali Waseem 819a9c0fc8 fix: added not found as errors when filter is active (#43497)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

fix: small issue when a filter was active and does not found error
popped up, we didn't allow users to reset the value. This handles the
edge cases where a filter is applied and the column is deleted
2026-03-08 13:43:28 -04:00
Ali Waseem 6cd3857d70 fix: added support for is and is not null (#43404)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

- For the new filters experience, we are missing null changes for dates
and also no support for isNull
- Updated E2E tests to account for new null cases
2026-03-05 07:07:54 -07:00
Joshen Lim dfd5461ef9 Opt to use connection string of read replica if available to power the table editor (#42856)
## Context

Part of dashboard scalability project

Opting to use the connection string of the project's read replica (if
available) for read queries on the database.

Trialing with the Table Editor as a first pass - changes involved will
opt to use replica connection string for `useTableRowsQuery`,
`useTableRowsCountQuery`, and `useForeignKeyConstraintsQuery`

There's definitely optimizations to be done for deciding which replica
to use - but am starting off with a rather naive logic to prioritize
replicas in the same region as the project.

## Changes involved

- We're no longer passing `connectionString` as a param into the
affected hooks, the `connectionString` is derived from within those
hooks instead
- Change is feature flagged, so things should be status quo if flag is
off (use primary database's connection string)
- Added `useConnectionStringForReadOps` hook which returns the replica's
connection string if (Otherwise defaults to primary database connection
string)
  - Feature flag is on
  - Project has a replica available

## To test

- [ ] Verify that the table editor works as expected for a project that
has read replicas (There shouldn't be any change really)
- [ ] Also just double check that updating cells in the table editor
works as well (There's no change there, we're using the primary DB's
connection string for mutation ops)
- [ ] ^ Same thing for a project that doesn't have read replicas
- [ ] ^ Same thing for local / self-host
2026-03-04 16:34:36 +08:00
Gildas Garcia 23fa351fe0 fix: time editor erases value as you type (#43348)
## Problem

When using chrome, it's impossible to enter a time value

## Solution

Avoid controlling the input value and only bubble up the change when the
value is a valid time or is empty

## How to test

- Create a table with a `time` column
- Add a new row and start entering a value using the keyboard
2026-03-03 16:51:14 +01:00
Gildas Garcia eda3490e5d Add a context menu item to copy a column name (#43101)
Small QOL improvement: a new context menu that allows to copy a column
name.
2026-02-23 19:04:39 +01:00
Ali Waseem 41a7b34985 fix: Better error handling for filters (#43027)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES/NO

## What kind of change does this PR introduce?

Update error handling for filter related errors on the table editor
2026-02-20 07:23:38 -07:00
Ivan VasilovandJoshen Lim 75644f8396 chore: Bump react-data-grid to fix a Sentry issue (#42934)
This pull request updates the `react-data-grid` dependency and refactors
code throughout the codebase to use the new import structure and updated
APIs. The changes improve compatibility with the latest version of
`react-data-grid`, simplify imports, and update row selection logic to
match new hook signatures. Additionally, some code is reorganized to use
absolute imports for internal components.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-02-20 14:10:13 +01:00
Joshen Lim 3f05963630 Joshen/fe 2573 table editor user still wants to run the query if it causing (#43004)
## Context

Related to this previous PR
[here](https://github.com/supabase/supabase/pull/42321)

Table Editor: Adding a CTA to the `HighQueryCost` UI to allow users to
proceed with fetching data despite the high query cost warning, to
prevent completely blocking the users from their workflows (realised
that certain heavy queries are required and this safeguard shouldn't be
creating dead-ends for users)

<img width="1159" height="264" alt="image"
src="https://github.com/user-attachments/assets/5fa01f7f-4442-4349-91f2-f4275e177f89"
/>

Clicking "Load more" will open a confirmation dialog, in which
proceeding to load the data will thereafter suppress this preflight
check for the table, for the rest of the browser session

<img width="450" height="305" alt="image"
src="https://github.com/user-attachments/assets/d3197a5d-a861-47a8-95da-e157972ce092"
/>

## Other changes

- Also bumped the query cost threshold from 100,000 to 200,000 - the
former might have been too aggressive 😓
- (Unrelated) Added query cost tooltip for cron jobs high query cost
warning
<img width="450" height="230" alt="image"
src="https://github.com/user-attachments/assets/d2c66972-7c4c-4f99-818c-e90a0991c2f5"
/>
2026-02-19 16:02:59 +08:00
Joshen Lim 4651480f28 Joshen/fe 2540 fix safari csv drag drop typeerror in table editor (#42852)
## Context

Addresses an error when drag and dropping a CSV in the Table Editor when
the table is empty, specifically on Safari leading to a `undefined is
not an object (evaluating 'n.type')` error

For context, Safari obscures the item data from the drag event and only
exposes it on the drop event
([ref](https://github.com/mdn/browser-compat-data/issues/24898)) hence
why this issue

## Changes involved

Am opting to change the UX instead of fixing this browser specific
behaviour
- Ignore file validity when dragging, let the on drop handle validate
the type and reject unsupported files instead
- This is better either way as currently our Table Editor shows "CSV
files only", when we actually also support TSV files
- Also made a slight adjustment to the drag over UI - border around the
grid empty area, rather than the whole grid
  - Before:
<img width="1151" height="911" alt="image"
src="https://github.com/user-attachments/assets/049199aa-86bc-4e88-8444-5a7ee236c8d0"
/>
  - After:
<img width="1150" height="912" alt="image"
src="https://github.com/user-attachments/assets/698ca8f3-a326-4a82-b1b4-4448aa8d777a"
/>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Refactor**
* Simplified the empty-table display and CSV import interface for a more
consistent user experience.
* Import button and drag-and-drop hints now remain visible when the
table is empty, removing prior conditional hiding during drag.
* Streamlined empty-state styling and messaging for a cleaner, more
predictable appearance.

* **Tests**
* Updated end-to-end test expectations to reflect the persistent
empty-state message during drag-over.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-16 07:06:01 -07:00
Joshen Lim 7fba97517c Fix grid error not clickable (#42780)
## Context

As per PR title - currently the error CTA here is not clickable

<img width="467" height="145" alt="image"
src="https://github.com/user-attachments/assets/596e4f16-0fd9-4fc4-bcfd-3b3e99d96e41"
/>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved error message display styling and layout in the grid
component.

* **New Features**
  * Enhanced query identification during SQL execution preflight checks.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-13 23:55:21 +08:00
Ali Waseem 765f95ce9f chore: update filters with new animations based on feedback (#42704)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

- Updated placeholder logic to be more context aware on tables
- Added AI loader
- more tests for utils

## Demo 


https://github.com/user-attachments/assets/0ea75037-3cd2-4394-9f99-ee5b3bff87c8



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Enhanced loading indicator with animated AI icon during AI-powered
operations.
* Dynamic filter placeholder text that displays available filter
options.

* **Style**
* Simplified filter item selection UI by removing visual selection
checkmarks.
  * Improved label display formatting for filter actions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-12 09:21:54 -07:00
Ali Waseem 29c158490f chore: Update filters in the new experience to use grouping (#42661)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

- Filters are now grouped so it easier to navigate
- Cleaned up types
- Cleaned up default command line component, it was a bit messy with all
the new changes
- Added unit tests on new util method

## Demo


https://github.com/user-attachments/assets/1e75ebcc-177d-4fed-b316-a9824c74b01a



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Operators are grouped (comparison, pattern, set-null) with labeled
sections and preselected operator highlighting.
* New command-list UI: selectable items with optional icons, operator
symbol badges, group headers/separators, and an empty-state message.

* **Refactor**
* Internal operator definitions reworked for stronger typing and
consistent grouping.

* **Tests**
  * Added coverage for grouping behavior and menu item ordering.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-11 08:18:02 -07:00
Ali Waseem 37748b5078 chore: add E2E tests for simulating a drag and drop CSV (#42658)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Chore: test drag and drop on table editor 

follow up for https://github.com/supabase/supabase/issues/42655

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Tests**
* Added comprehensive end-to-end test for CSV drag-and-drop import
functionality that validates the complete import workflow: drag-drop
detection on empty tables, import dialog display with accurate row
counts, and successful data import to the grid.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-10 20:39:06 +00:00
Vaibhav 997d2c365a fix: CSV drag and drop (#42656)
## Problem

Drag-and-drop CSV import functionality is broken in the Table Editor
when tables are empty. The `pointer-events-none` CSS class on the empty
state overlay blocks all pointer events, including drag events,
preventing users from dropping CSV files onto empty tables.

## Solution

Move drag event handlers (`onDragOver`, `onDragLeave`, `onDrop`) from
the inner overlay div to the parent container div.
This allows:
- Drag events to be captured by the parent container
- The overlay to retain `pointer-events-none` for proper horizontal
scrolling
-  (as intended in #42618)
- Interactive elements inside to use `pointer-events-auto`

This follows the existing pattern used in `FileExplorerColumn.tsx` where
drag handlers are on the parent container while visual overlays have
`pointer-events-none`.

 ## Related 
- Closes https://github.com/supabase/supabase/issues/42655  
- Extends https://github.com/supabase/supabase/pull/42618


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
  * Improved drag-and-drop event detection scope in the grid component.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-10 17:34:35 +00:00
Joshen Lim 0962bccdff Remove default freeze on PK column in table editor (#42636)
## Context

Just removes the default column freeze behaviour on primary key columns
in the table editor. Behaviour should still persist if freezing
manually.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Updates**
  * Grid columns are no longer frozen based on primary key designation.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-10 11:49:18 +08:00
Ali Waseem d9e0f01bf5 fix: pointer events on empty view (#42618)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Minor bug fix: update table editor views
2026-02-09 10:42:57 -07:00
Jordi Enric 3f6843a6b1 bug: fix refetch loop (#42613)
Problem:
- new filters are creating an infinite fetch loop of ph.supabase.io 

#  Before:
  snap.filters change → effect → setParams() → router.push()
  → URL updates → filters/sorts recalc → setParams recreated
  → effect re-runs → INFINITE LOOP 🔄

 # After:
snap.filters change → effect → comparison shows change → timeout
scheduled
  → setParams() → router.push(shallow: true) → URL updates
  → filters/sorts recalc → setParams recreated → effect runs
  → comparison check: no content change → early return → LOOP BROKEN ✓

The deep comparison prevents the effect from re-executing when only the
dependency references change
(due to URL updates), not the actual filter content. Test it out and the
PostHog spam should stop!

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Bug Fixes

* **Prevented unnecessary URL updates** when filter state remains
unchanged, improving application responsiveness.
* **Optimized filter and sort parameter handling** with enhanced
callback efficiency and routing behavior.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-09 16:58:11 +01:00
Joshen Lim 608481cfd7 Prevent double click action in ReferenceRecordPeak (#42606)
## Context

Tiny UX behaviour that we came across - just prevents the double click
action when peeking a foreign row in the table editor

Feels odd that double clicking the `ReferenceRecordPeek` opens the side
panel to select a new foreign row to reference

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Enhanced double-click handling to prevent unintended actions in the
foreign key selection popover.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-09 16:43:35 +08:00
Joshen Lim ddc687bd64 Fix missing loader in table grid editor while rows are loading (#42605)
## Context

Fix missing loader in table grid editor while the rows are loading - the
loading UI was rendering, but its width was 0 hence not showing up

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Style**
* Improved grid layout styling to utilize full-width display
configuration.
* Enhanced loading skeleton container styling with better absolute
positioning and spacing.
* Refined empty state container layout for improved visual presentation.

* **Refactor**
  * Removed unused internal dependencies.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-09 16:30:02 +08:00
Alaister Young 0628f2f07d [FE-2495] fix(studio): ReferenceRecordPeek breaking with JSONB ARRAY data (#42602)
Issue:
- When opening the peek record foreign key viewer, a full screen React
error would happen

Change:
- Uses the preexisting formatters for the `<ReferenceRecordPeek />`
component

To test:
- Create two tables with a foreign key reference. I did `posts <-
comments`
- On your "posts" table, create a column with a jsonb array column and
**add at least one item to the array**
- On your "comments" table, open the foreign row peek and make sure no
errors occur

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Refactor**
* Optimized grid component performance through improved column rendering
and enhanced caching mechanisms.
* Added specialized formatters for binary and JSON data types to improve
display quality.
* Improved memory efficiency and rendering speed, particularly when
working with large datasets.
  * Streamlined cell rendering logic for more responsive data grids.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-09 16:04:39 +08:00
Danny WhiteandAli Waseem e8bb51ec84 chore(studio): queue operations UI improvements (#42272)
## What kind of change does this PR introduce?

UI improvements

## What is the current behavior?

@awaseem added a schmick new “Queue table operations” feature in
https://github.com/supabase/supabase/pull/42120

## What is the new behavior?

This adds some UI polish to that feature.

## Additional context


https://github.com/user-attachments/assets/0b823bc9-44bd-42d1-8042-162084d058c7

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **UI/UX Improvements**
* Repositioned and animated floating save/review bar for smoother
entrance and centered alignment
* Card-based redesign of operation items with clearer old/new value
badges and improved action controls
* Updated side panel text, button labels ("Review", "Save/Revert" with
"all" when applicable), and focus behavior
* Refined empty-state layout and amber background highlighting for
modified cells
* Improved spacing, padding, and visual polish across the operation
queue UI

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Ali Waseem <waseema393@gmail.com>
2026-02-09 10:25:06 +11:00
Ali Waseem 32817d2e74 fix: centered messages table editor (#42571) 2026-02-07 15:24:07 -07:00
Ali Waseem 11d4da6c4b feat: added new filter bar as feature preview (#42458)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Move away from our feature flag service and expose this to users through
the feature preview. Once approved will create discussion and link to
this and the new queue operations

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **New Features**
* Added a new table filter bar option to the feature preview settings,
allowing users to test and enable the updated table filtering interface.

* **Chores**
* Refactored feature flag infrastructure to improve table filter bar
configuration management.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-04 14:25:32 -07:00
Ali Waseem 48d894243f fix: update loading state for filter bars (#42457)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Update loading state for filter bars when using the new experience

## Demo


https://github.com/user-attachments/assets/a243a6b2-2060-47b3-9c6c-6e9f7ceb1eb7


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added a loading indicator in the filter UI that displays a spinning
icon when data is being refetched.
* Header now surfaces refetching state to the filter controls so the
loading indicator appears during refreshes.
* Filter bar supports a customizable icon prop to enable the new loading
overlay behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-04 14:20:53 -07:00
Ali WaseemandAlaister Young 1696262088 Feat: Insert and delete rows for batch operations on table editor (#42288)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Completion of batch edits on the table editor

## Demo


https://github.com/user-attachments/assets/ab5a7112-3dcc-456a-a5fc-1c9a99fccf34







<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Queued add/edit/delete operations with optimistic UI, conflict
resolution, and queue-based flows
  * Side-panel items showing queued add/delete row previews

* **UI**
* Pending-add placeholders plus a visible "DEFAULT" marker in grid cells
* Visual row states: green for pending adds, red with strike-through for
pending deletes
* Queue-based deletes can bypass confirmation when queue mode is enabled

* **Tests**
* Expanded tests covering queue conflict resolution and queue utilities
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2026-02-04 11:15:55 -07:00
Ali Waseem e1f37312d2 fix: Keyboard interactions with the new filter experience in the table editor (#42431)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Fix: 
- Better keyboard support for cycling through filters
- Better deletion for dropdowns 
- Tabbing and enter support for selection
- small bug fixes

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **New Features**
  * Added AI-assisted help text in filter input placeholders
* Enhanced keyboard navigation: Backspace removes conditions, Tab/Enter
navigate filter controls, Escape blurs focused elements
* Operator selections now display labels alongside symbols (e.g.,
"Equals (=)")
  * Improved filter workflow with smarter input focus transitions

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-04 09:51:39 -07:00
Ali Waseem b279601d09 fix: AI filter re-render by seperating URL logic syncing and local state (#42396)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

For the new AI filters we should take a totally different approach.
Rather than using the URL as the source of truth, it should rather act
as a secondary state store. The first being local state in Snap that
gets loaded from the URL. By forcing this clear line we can always make
sure the URL is backed up with the right values and ensure state is
updated quickly.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Toggleable next‑gen filter bar with lifecycle that initializes and
syncs filters to the URL.
* Centralized filter API in table state for setting, clearing, and
sharing filters across components.

* **Improvements**
* Grid queries are project‑scoped, use placeholder previous data, and
reapply optimistic updates on refresh.
* Added MS SQL sorting warning and feature‑flag controls for
queue/operation behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

## Testing
- Make sure the old filters still work as expected
- Enable the new Headers, test out new filters approach (count is still
broken FYI, will fix that later)
2026-02-03 17:34:22 +00:00
Joshen LimandAli Waseem f0fbcbd2a3 Add preflight EXPLAIN check to table editor rows (#42321)
## Context

Part of an investigation to see how we can make the dashboard more
resilient for large databases by ensuring that the dashboard never
becomes the reason for taking down the database accidentally.

Am proposing that for interfaces that rely heavily on queries to the
database for data to render, we add preflight checks to ensure that we
never run queries that exceed a certain cost threshold (and also have UI
handlers to communicate this) - this can be done by running an EXPLAIN
query before running the actual query, and if the cost from the EXPLAIN
exceeds a specified threshold, the UI throws an error then and skips
calling the actual query.

## Demo
Am piloting this with the Table Editor, and got an example here in which
my table has 500K+ rows, and I'm trying to sort on an unindexed column:


https://github.com/user-attachments/assets/ccad2ea9-d62c-4106-8295-2a6df5941474

With this UX, the pros are that
- It's relatively seamless and not too invasive, most users won't notice
this unless they run into this specific scenario
- We can incrementally apply this to other parts of the dashboard, next
will probably be Auth Users for example

However there are some considerations:
- The additional EXPLAIN query adds a bit more latency to the query
since its a separate API request to the query endpoint
- ^ On a similar note, it will hammer the API a bit more, which may
result in higher probability of 429s
- However, I reckon that the preflight checks are meant to be used
sparingly and only for certain parts of the dashboard that we believe
may cause high load.
- e.g for the Table Editor, reckon we only need this for fetching rows?
The count query is largely optimized already (although we could just add
a preflight check there too)
- It's just meant to be a safeguard to prevent running heavy queries on
the database



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Query preflight with cost checks and a user-facing high-cost dialog
showing cost details and remediation suggestions.
* Grid exposes an explicit error flag and surfaces richer error
metadata.

* **Bug Fixes**
* Standardized error handling and more consistent error displays across
the app.
* Explain analysis now reports an additional max-cost metric for
queries.

* **UI**
* Tweaked empty-state interaction/layout and slightly wider header
delete control.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Ali Waseem <waseema393@gmail.com>
2026-02-03 17:55:54 +08:00
Joshen Lim f90f3b4d14 Revert "Revert "Fix queue operations stale state + refactor to reuse existing…" (#42291)
TBD

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* OS-aware modifier-key label shown in UI (⌘ on macOS, Ctrl+ on others)
  * Tooltips added to operation queue actions for improved usability

* **Bug Fixes**
  * Warns before applying non-primary-key sorts on large tables
  * Clarified access error messages for organizations and projects

* **Refactor**
  * Redesigned hotkey handling and operation-queue shortcuts
* Operation queue view toggle and save flow refined (panel auto-closes
after save)

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-30 10:44:42 +08:00
Ali Waseem 8b2dcaa352 Revert "Fix queue operations stale state + refactor to reuse existing… (#42290)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Reverting commit due to high error rates
2026-01-29 16:26:54 +00:00
Joshen Lim 0c1bc80b89 Fix queue operations stale state + refactor to reuse existing methods (#42283)
## Context

Related to this PR
[here](https://github.com/supabase/supabase/pull/42265)

If you were to update a cell twice, then save, the value that get's
saved is the first edited value.

There's a number of changes in this PR but the main thing is just
`useOperationQueueActions` to declare `operations` outside of
`handleSave` since `snap` wouldn't trigger the re-render of that
function in the dependency array.

## Other changes

- Refactored `useOperationQueueShortcuts.ts`
  - Reuse an existing `useHotKey` method to handle the event listeners
- Remove unnecessary prop drilling, call the necessary hooks within it
instead
- Simplify its calling by only calling this hook within
`SaveQueueActionBar` (removed calling from `OperationQueueSidePanel`
- Add tooltip for OperatioItem "Remove operation"
- (Unrelated) Fix Table Editor sort "Apply sort" CTA not working for
large tables when applying sort on an indexed column (e.g primary key)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **New Features**
* Operation queue view now toggles open and closed with a single action
* Simplified keyboard shortcuts: press **S** to save operations, **.**
to toggle the queue view

* **Bug Fixes**
* Sort operations on large tables with non-primary-key sorting now show
a confirmation warning and require explicit user approval before
applying

* **Improvements**
* Operation queue panel automatically closes after successfully saving
operations
* Enhanced UI with improved delete action feedback and refined visual
separators

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-29 07:35:59 -07:00
Ali Waseem ea1b95d29b feature: batch and save operations for cell content updates (#42120)
* added initial queue operations and feature flag

* updated types

* added dirty state tracking on columns

* updated queue operations

* updated operation types and queue

* updated spacing

* removed on cancel

* updated to support saving

* updated to include eye details

* updated spacing for orders

* updated to support shortcuts

* added feature preview

* updated to unify queue methods

* added key generation

* used unique keys rather than random uuid

* updated based on code review

* operation key

* updated handle cancel

* updated remove operation button

* updated views for toast

* updated logic to support optimistic updates

* updated types

* code cleanup: remove LLM slop

* updated PR bug

* updated preview for logout

* updated based on code review

* removed use effect as it was causing problems

* fixed toast mounting away from sql editor

* removed toast for dedicated action bar

* cleaned up logic

* updated queue operations

* renamed method

* updated name for types

* updated comment

* fixed code rabbit solution

* added check for changed column

* added tests
2026-01-28 06:54:30 -07:00
Ali WaseemandJoshen Lim 78e0f19d6a fix: add description of column on header name (#42082)
* fix: add description of column on header name

* Simplify

* Attempt to fix test

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-01-23 07:23:07 -07:00
Joshen Lim c6b2fe6fee Popover ui component to use portal by default, remove all manual declaration of portal for PopoverContent in dashboard (#41818)
* Popover ui component to use portal by default, remove all manual declaration of portal for PopoverContent in dashboard

* Forgot to add ui changes lol

* Clean uop
2026-01-20 11:58:31 +08:00
kemal.earth d19385a138 fix(studio): remove wrongly semicolon from export cli command (#41898)
* fix: remove semicolon from export cli

* fix: bump up contrast of string on light mode

* chore: update lightmode green to danny suggestion

* fix: actual suggestion
2026-01-15 09:28:54 +00:00
Saxon Fletcher d2f4e808e5 Filter pattern refactor (#41545)
* filter refactor

* update tests

* prettier

* fix ts

* remove filter preview

* Filter bar in table editor behind flag (#41546)

filter bar in table editor behind flag

* fixes

* ts fix

* filter v1 refactor

* rename helpers

* unmount timeout

* fixes

* fix

* more
2026-01-06 08:04:28 +10:00
Ali Waseem d89c409c81 fix: added portal property for date and time editor (#41649)
added portal property
2026-01-05 06:46:33 -07:00
Ivan VasilovandJoshen Lim a36b65e7a3 fix: Refactor all Table Editor links to include sorts and filters (#41075)
* Possible solution with building the URL from local storage.

* Refactor the local storage for tabs to use table ids.

* Fix the saving table state to local storage.

* Minor fixes.

* Open the correct schema when following the link.

* Minor fixes from CodeRabbit.

* Address charis' feedbacks

* Clean

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-12-18 10:21:09 +01:00
Ivan Vasilov cc47bcfa6d chore: Migrate studio to use ui-patterns/shimmeringLoader (#41405)
* Add shimmering-loader CSS to ui-patterns.

* Import the shimmering-loader classes from the ui-patterns component.

* Remove ShimmeringLoader from studio.

* Migrate studio to use ui-patterns/ShimmeringLoader.

* Migrate away from using default import for ShimmeringLoader.

* Fix the css imports in docs and studio.
2025-12-17 14:54:07 +01:00
Joshen Lim d3d8331cae Use totalRows if available from params to validate MAX_EXPORT_ROW_COUNT (#41384)
* Use totalRows if available from params to validate MAX_EXPORT_ROW_COUNT

* Clean
2025-12-16 08:18:51 -07:00
Ali WaseemandCharis e7a4ca9b74 Feature: show index advisor in table editor (#41166)
* added table advisor query

* updated to include table editor performance

* updated JSON B

* added side panel

* updated query indexes to show highlights context

* show index advisor in table editor

* updated invalidation logic

* added color updates

* added query indexes

* updated query performance type

* updated overflow and title

* put behind flag

* remove gap

* added on close

* Update apps/studio/data/database/table-index-advisor-query.ts

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* updated styling

---------

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2025-12-10 09:28:45 -07:00
Ivan Vasilov 0d5be306ef chore: Bump React Query to v5 (#40174)
* Bump the deps, refactor deprecated code.

* Migrate keepPreviousData usage.

* Migrate all uses of InfiniteQuery.

* Fix refetchInterval in queries.

* Migrate all use of isLoading to isPending in mutations.

* Fix accessing location in claim-project.

* Fix a bug in duplicate query keys.

* Migrate all queries to use isPending.

* Revert "Fix accessing location in claim-project."

This reverts commit 2a07df64b5.

* Revert the rss.xml file to master.
2025-12-10 10:10:29 +01:00
8e705ecdbc fix(export all rows): use cursor pagination if possible (#40536)
Exporting all rows (in CSV, SQL, or JSON format) currently uses offset pagination, which can cause performance problems if the table is large. There is also a correctness problem if the table is being actively updated as the export happens, because the relative row offsets could shift between queries.

Now that composite filters are available in postgres-meta, we can change to using cursor pagination on the primary key (or any non-null unique keys) wherever possible. Where this is not possible, the user will be shown a confirmation dialog explaining the possible performance impact.

---------

Co-authored-by: Ali Waseem <waseema393@gmail.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-12-08 13:39:10 -05:00
Ali Waseem 86b1e03658 fix: sentry type errors (#41073)
* fix SUPABASE-APP-AV8

* fix SUPABASE-APP-AV0

* fix: SUPABASE-APP-ATK
2025-12-04 10:36:44 -07:00
Joshen Lim 1692393e09 Joshen/fe 2187 disable default sorting in table editor for large tables (#40976)
* Add confirmation modal in table editor when applying sorts if table has many rows

* nit
2025-12-03 15:06:48 +08:00
Alaister Young 4804642b18 fix(studio): boolean editor in table editor (#40947) 2025-12-01 12:18:19 +00:00