mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
docs/reference-template
161
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ec1b9dae02 |
fix(studio): drop deleted route-mock from table menu test (#54471)
The Studio typecheck fails on master: `TableEditorMenu.test.tsx` (added in #53960) imports `@/tests/lib/route-mock`, which #54426 removed a few hours earlier. Each PR passed on its own, so the break only showed once both were merged, and every PR based on current master now fails `typecheck`. I removed the import and its `routerMock.setCurrentUrl` call, and passed the same URL through `customRender`'s `initialUrl` option, the way #54426 migrated the other tests that used the mock. ## Linear - fixes GROWTH-1602 |
||
|
|
217b9ca3f3 |
[FE-5024] feat(studio): track Table Editor sidebar and side panels (#53960)
Adds PostHog telemetry events across the Table Editor sidebar, new-tab page, and column/table/row/cell side panels so we can measure schema usage, entity-list search/filtering, entity menu actions, and panel saves without logging schema, table, column, or search names. **Added:** - Event definitions in `packages/common/telemetry-constants.ts` (added to `TelemetryEvent`): - `table_editor_schema_selector_updated` (`schemaType: 'public' | 'protected' | 'custom'`) when switching schemas in `TableEditorMenu`. It uses the same `schemaType` property and derivation as the existing `database_schema_selector_updated` (now shared through `getDatabaseSchemaType`), so the two selectors can be compared in one insight - `table_editor_new_item_clicked` (`itemType: 'schema'` or `itemType: 'table'` with `trigger: 'sidebar' | 'new_tab_card'`) from the sidebar and `NewTab` card - `table_editor_table_search_submitted` (debounced 500ms, cancelled on clear, schema switch via selector or URL/tab change, and unmount) - `table_editor_entity_filter_updated` (`visibleTypeCount`) on entity-type checkbox toggle, "Select only", and filter reset - `table_editor_entity_action_clicked` (`action`, `entityType`) across dropdown and context menus in `useEntityActionHandlers` (excluding the `View policies` link, which is covered by pageviews) - `table_column_created` / `table_column_updated` (`hasForeignKey`, `isArray`) on column side-panel saves via `SidePanelEditor.utils.tsx`, with `hasForeignKey` scoped to the saved column and no-op saves skipped - `table_updated` (`columnCountChanged`) on existing table edits in `SidePanelEditor.tsx` once table, column, primary key, foreign key, Realtime, and Data API updates succeed and at least one change was persisted; no-op saves and saves where any step fails are skipped - `table_editor_row_updated` (`editMethod: 'side_panel'`) when an existing row edit from the row side panel is persisted. Saves from the expanded cell editors and the foreign row selector don't count, and neither do edits queued with queue operations enabled. The grid ticket (FE-5023) can add more `editMethod` values when it tracks inline edits - `table_editor_cell_editor_opened` (`editorType: 'json' | 'text'`) when expanding JSON or text cell editors from the grid cell editors (`JsonEditor` / `TextEditor`) or `RowEditor` - Column, table and row save events are attributed to the project the save ran against (third `track()` argument), and fire only after the save succeeds - Focused MSW-backed tests for non-obvious telemetry edge cases (search debounce + cancellation on clear and selector/external schema switches, schema switch single-fire + PII checks, column-scoped FK/array derivation and no-op gating in `createColumn`/`updateColumn`, change/error reporting in `updateTable` without double-firing column events) ## To test Watch `POST /platform/telemetry/event` in DevTools (and confirm arrival in staging PostHog): - Switch schemas (`public` -> `auth` -> custom schema -> `public`): fires `table_editor_schema_selector_updated` with `schemaType` `protected` -> `custom` -> `public` and no schema name; re-selecting the active schema fires nothing - On the Database > Schemas visualizer, switching schemas still fires `database_schema_selector_updated` with the same `schemaType` values as before - Click **Create a new schema** and **New table** in the sidebar, plus **Create a table** on `/project/[ref]/editor/new`: fires `table_editor_new_item_clicked` with the expected `itemType` and `trigger` - Type in **Search tables...** and pause >500ms: fires one `table_editor_table_search_submitted` with no query text; clearing or switching schemas (via the selector or clicking a tab in another schema) before 500ms fires nothing - Toggle entity-type checkboxes, click **Select only**, or reset filters: fires `table_editor_entity_filter_updated` with the new `visibleTypeCount` - Trigger actions from a table/view menu (both ⋮ and right-click): fires `table_editor_entity_action_clicked` with `action` and `entityType` (**View policies** does not fire it) - Create and edit a column via the column panel: fires `table_column_created` / `table_column_updated` with `hasForeignKey` (scoped to that column) and `isArray`; clicking **Save** with no changes fires nothing - Edit an existing table (with and without adding/removing a column, or toggling Realtime alone): fires `table_updated` with `columnCountChanged`, without firing `table_column_*`; clicking **Save** with no changes fires nothing - Edit an existing row in the row side panel: fires `table_editor_row_updated` with `editMethod: 'side_panel'`. Inserting a new row, saving from an expanded JSON/text cell editor, picking a foreign row, or saving with queue operations enabled does not fire it - Edit an existing table so that adding a column (or updating Realtime/Data API) fails: `table_updated` does not fire - Expand JSON and text cell editors from both the grid and inside the row panel: fires `table_editor_cell_editor_opened` with `editorType: 'json' | 'text'` Notes for review: - No `data-attr`s were added. Autocapture is off, so each tracked interaction gets an explicit `track()` call instead. - `table_editor_cell_editor_opened` counts the expand buttons in both the grid cell editors and the row side panel fields. It's the same click on both surfaces. - `table_editor_row_updated` only has `editMethod: 'side_panel'` for now. The grid toolbar ticket (FE-5023) can add values when it tracks inline edits. --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
0cf8b266ff |
fix(studio): tables not showing on mobile (#54412)
## Problem On a mobile device the list of tables in the table editor are not showing: <img width="403" height="702" alt="Screenshot 2026-12-01 at 15 27 07" src="https://github.com/user-attachments/assets/cfb23739-50c8-4997-9d7b-f86ef5375e7d" /> ## Solution Tables are now showing: <img width="403" height="702" alt="Screenshot 2026-12-01 at 15 27 28" src="https://github.com/user-attachments/assets/8bc8c909-b866-4351-83bd-4bee4631cdd8" /> Closes #54400 |
||
|
|
6dd7062496 |
[FE-5108] (part 2) refactor(studio): migrate layouts & shell off next/link (#54305)
Part 2 of a 6-PR stack migrating all `next/link` imports in `apps/studio` onto TanStack Router's `Link` (or plain `<a>` for known external URLs) and removing `compat/next/link.tsx`. | Part | PR | Scope | | --- | --- | --- | | 1 | #54304 | `data/prefetchers/PrefetchableLink.tsx` and `components/ui/**` | | **2** | **#54305 ← this PR** | **`components/layouts/**` and top-level shell components** | | 3 | #54306 | Database, TableGridEditor, Storage, SQLEditor, BranchManagement, Branching, Functions, Realtime | | 4 | #54307 | Integrations, Settings, Observability, LogDrains, Issues, Linter, Reports, QueryPerformance, QuerySources, ConfigDrift, DiskManagement, Compute | | 5 | #54308 | Remaining `components/interfaces/**` (Org, Billing, Auth, Support, Home, SignIn, ConnectSheet, etc.) | | 6 | #54309 | Remove `compat/next/link.tsx` shim, Vite alias, and update basePath tests/docs | Migrates all `apps/studio/components/layouts/**` files and top-level navigation shell components off `next/link`. **Changed:** - Replaced `next/link` across `components/layouts/**` (`AccountLayout`, `AppLayout`, `AuthLayout`, `BranchLayout`, `DatabaseLayout`, `EdgeFunctionsLayout`, `ExplorerLayout`, `IssuesLayout`, `LogsLayout`, `Navigation`, `ObservabilityLayout`, `ProjectLayout`, `ProjectNeedsSecuring`, `SQLEditorLayout`, `SignInLayout`, `TableEditorLayout`, `Tabs`) and top-level shell components (`Sidebar.tsx`, `UserDropdown.tsx`, `LocalDropdown.tsx`, `HomePageActions.tsx`) - Removed `vi.mock('next/link', ...)` from `LocalDropdown.test.tsx` and `ProjectNeedsSecuring.test.tsx` - Added accessible labels where external icon/logo links switched from `<Link>` to plain `<a>` (`AdminStudioButton.tsx`, `ForgotPasswordLayout.tsx`) Addresses [FE-5108](https://linear.app/supabase/issue/FE-5108/replace-the-nextlink-shim-with-tanstack-link) ## To test - [ ] Navigate across top header, left sidebar, user/local dropdown, and project/org/branch switchers - [ ] Verify mobile navigation menu items and recent-tab links navigate with expected query params - [ ] Verify sign-in and forgot-password layout links work cleanly --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
df6eafef7c |
Joshenlim/fe 5116 support editduplicatedelete tables from (#53662)
## Context We previously introduced context menus to the table editor [here](https://github.com/supabase/supabase/pull/53506), but prevented edit, delete, and duplicate actions as those actions were coupled to the router. Hence this PR decouples that by making those actions target a table by a provided ID "More options" action now also shows on every row, just visibly shown only if its active or the user hovers over the row <img width="335" height="183" alt="image" src="https://github.com/user-attachments/assets/9897945d-37f4-4658-9420-29b948173208" /> ## To test Can test edit / delete / duplicate table on a table that you're not currently actively on, via both context menu and dropdown menu |
||
|
|
68cdbc991c |
Joshenlim/fe 4994 add tableeditormenu context menu (#53506)
## Context Table Editor supports actions on tables via the "..." while the table is active in view as such: <img width="350" alt="image" src="https://github.com/user-attachments/assets/3fbf7b08-1156-403e-ae89-ada7f56e7270" /> Am opting to add support for making these actions available behind a context menu as well, which would align the UX with the SQL Editor, Storage, Explorer, etc. Makes it much more easier to reach these actions without having to first open the table in view and having to click the "..." button. Doing so in a similar way with how it's done in the Storage Explorer where we declare the the available actions in a single place, then render both DropdownMenu + ContextMenu with that set of actions. <img width="350" alt="image" src="https://github.com/user-attachments/assets/862e0a71-4d60-4a5b-8c98-f0812c0e6bf4" /> Note that for now, we're preventing selection of Edit, Duplicate, and Delete actions from the context menu as this requires a bit more refactoring which I'm planning to do as a separate PR. For context - those 3 actions are currently coupled with the router, as they depend on the table ID that's present in the URL, so we'll need to decouple them first before making these actions available. <img width="350" alt="image" src="https://github.com/user-attachments/assets/edc8af5c-b9b7-4e02-805c-90ad0a24d8dc" /> Also added E2E test coverage since this would affect local CLI / self-hosted |
||
|
|
f7f27aac78 |
fix(studio): escape json and jsonb values in SQL copy and export (#53372)
## What Fixes invalid or corrupted SQL from "Copy rows as SQL" and "Export table as SQL" for json/jsonb columns (FE-4860, closes #49196). ## Why The SQL formatter built json literals by rewriting `JSON.stringify` output with regexes. That corrupted values containing double quotes or backslashes, and produced invalid SQL for jsonb columns holding plain strings or other non-object values. ## How - `formatTableRowsToSQL` now serializes the parsed value and only escapes single quotes. - Grid rows carry json columns as text (the grid query casts them to `::text`), so a new `parseGridJsonColumns` helper parses untruncated json cells before formatting. It is used by "Copy rows as SQL" and the selected-rows export. Truncated cells are left alone so they are still fetched in full. - The SQL export keeps json columns unstringified (`preserveJsonValues`), so a jsonb string like `"hello"` stays distinguishable from JSON text. CSV and JSON exports are unchanged. No `::text` cast was added to the export query: the API already returns json values parsed. ## Testing - Unit tests for values with `"`, `\`, `'`, plain-string jsonb, arrays, numbers, booleans and null, plus `parseGridJsonColumns`. - Ran the formatter output against a local Postgres: both the parsed (fetch-all) and grid-text (copy / selected rows) shapes loaded and round-tripped identically for jsonb and json columns. The old formatter's output failed with `invalid input syntax for type json` on the same data. - Not exercised end to end in the Studio UI, and the truncated-cell path is covered by unit tests only. ## Not in scope The JSON export still stringifies objects before `JSON.stringify`, so json columns come out as nested strings. That is separate pre-existing behavior. |
||
|
|
4ed3627d72 |
Joshenlim/fe 3891 improve handling of partition tables in (#53268)
## Context The Table Editor doesn't really handle partitioned tables well given the following issues: - Partitioned tables are rendered as a flat list in the Table Editor side menu, so the menu could get very long and noisy - this was the primary motivation for this PR - Child partitioned tables are not indicated with a proper icon, they're treated as regular tables in the Table Editor which is incorrect ## Changes involved - Table Editor side menu now only lists parent partitioned tables, omits all child partitioned tables - Child partitioned tables can be viewed by clicking on the button tooltip here or drilling down via "View partitions" <img width="300" alt="image" src="https://github.com/user-attachments/assets/e3cfbe4b-21ff-47df-8fcd-81d0c9f68d94" /><br /> <img width="400" alt="image" src="https://github.com/user-attachments/assets/5d0747cb-fb52-4301-ad9e-c7be504f43c9" /> - Selecting that will then render a nested nav as such <img width="291" height="323" alt="image" src="https://github.com/user-attachments/assets/bff0a42b-4265-4317-8299-537d82544388" /> - Sub partitioned tables can be drilled into the same way, and the back CTA steps up one level <img width="485" height="306" alt="image" src="https://github.com/user-attachments/assets/66f6f6cb-8b7d-46c5-8ea3-4ee4fd57aa84" /> - Parent partition tables have the following actions (Previously was only copy name and schema) <img width="465" height="257" alt="image" src="https://github.com/user-attachments/assets/2aa90995-7c30-4bcf-a446-d01ab52c1ede" /> - Deleting a parent partition table will also delete the child partition table, and that's highlighted in the confirmation modal <img width="418" height="316" alt="image" src="https://github.com/user-attachments/assets/0d61984b-f85e-4c93-84d0-549d300838c9" /> - Child partition tables have the following actions (Edit + duplicate removed since they aren't supported via the UI) <img width="482" height="229" alt="image" src="https://github.com/user-attachments/assets/e028b13d-2e92-4491-b05c-7a6cb0a129d6" /> ## To test In general, just verify the viewing UX of partitioned tables to see if it all feels alright, can use the following SQL to quickly set up partitioned tables ```sql create schema if not exists tint; create table public.nest_demo (id int, hue int not null, primary key (id, hue)) partition by range (hue); create table public.nest_demo_blue partition of public.nest_demo for values from (200) to (300) partition by range (hue); create table public.nest_demo_blue_light partition of public.nest_demo_blue for values from (200) to (250); create table tint.nest_demo_blue_deep partition of public.nest_demo_blue for values from (250) to (300); create table public.nest_demo_other partition of public.nest_demo for values from (0) to (200); ``` |
||
|
|
53ffdf75c9 |
Joshenlim/fe 4945 cmd k support searching for all table (#53262)
## Context Probably the final piece for this series of changes towards resource aware Cmd K. We currently only present results for tables when searching in Cmd K, this PR adds in other entity types like views, materialized views, foreign tables, and partitioned tables (only the parent) Note that the results excludes entities created from database extensions to reduce the chance of noise <img width="500" alt="image" src="https://github.com/user-attachments/assets/27bf5026-937a-4883-b365-75694d551a39" /> ## Related changes - Tweaked the entity icon for partitioned tables a little to be blue (previously gray) and - Added an entity icon for child partition tables in the table editor that's slightly lighter than the partition table icon, currently child partition tables just render with the same icon as tables which can be confusing <img width="286" height="128" alt="image" src="https://github.com/user-attachments/assets/638af7c3-512d-4264-bfae-0a8827b3ef94" /> - Note that i'm planning to look into this separately RE how to better render child partition tables so this might go away subsequently ## Performance As always, ran a claude benchmarking session - this runs on debounced keystrokes against a live catalog, so it's benchmarked at scale: **45,653 `pg_class` rows** - 12k tables - 3,143 views - 3,002 matviews - 3,001 foreign tables) Taking a median of 15 runs, all variants measured against the same catalog in one process. | scenario | query | master | this PR | worst | |---|---|---|---|---| | exact table name | `t_500` | 19.5ms | 24.3ms | 29.1ms | | view name | `v_10` | 19.3ms | 23.7ms | 25.8ms | | foreign table name | `ft_10` | 18.9ms | 24.1ms | 26.9ms | | no match | `zzz_nothing` | 19.4ms | 24.0ms | 27.5ms | | broad prefix (~3k matches) | `t_1` | 30.8ms | 38.7ms | 45.1ms | | broad matview prefix | `mv_1` | 26.6ms | 37.5ms | 41.7ms | |
||
|
|
5eb68c5df2 |
Add indexes to cmd k related resources in table editor (#53204)
## Context We previously added a "Related resources" section in Cmd+K if you're on the Table Editor with a table opened, this included resources pertaining to the table such as policies, triggers, and functions. We're adding indexes as well in this PR - thinking that might also be appropriate to have in this context <img width="500" alt="image" src="https://github.com/user-attachments/assets/5cd383ff-6617-49ba-bdb8-6f65d8fd0680" /> ## Performance Benchmarked with Claude against the stress catalog (`PG_META_STRESS_TABLES=12000`), with master and this branch timed in the same run on the same database, median of 9. | Table | master | This PR | Worst of 9 | |---|---|---|---| | Hub table — 8 indexes, policy, many FK triggers | 1.6 ms | 2.3 ms | 2.8 ms | | Policy + user trigger | 1.0 ms | 1.3 ms | 2.0 ms | | Mid-chain table | 1.1 ms | 1.5 ms | 1.7 ms | | Deliberately over-indexed table — 20 indexes | 0.8 ms | 2.0 ms | 4.6 ms | | Table that doesn't exist | 1.1 ms | 1.5 ms | 4.5 ms | |
||
|
|
c8aad267cb |
fix(studio): use read grant variant for table related resources queries (#53231)
Fixes the Studio typecheck failure on \`master\`. ## What Two PRs merged close together and conflict at the type level. #53079 added the table related resources queries with a plain \`POST /platform/pg-meta/{ref}/query\` grant. #53185 then made a variant required for that endpoint. Both queries only read data, so they now request and accept the \`read\` variant. ## Testing - \`tsc --noEmit\` in \`apps/studio\` passes. |
||
|
|
f87de2f0d0 |
Joshenlim/fe 4593 cmd k related resources while in table editor (#53079)
## Context Building on towards resource-aware Cmd K, the changes done up so far have all been to allow users to search for database resources from anywhere in the project, with the intention to get you to the resource quickly without having to go through the navigation hierarchy of the dashboard. This PR explores a way to quickly glance related resources for a table in the Table Editor through Cmd K for that same intention, but listing out the policies, triggers or functions that run on the table that you're currently viewing in the Table Editor. E.g here we've got the `blog_authors` table opened: <img width="500" alt="image" src="https://github.com/user-attachments/assets/78c9b85f-cd30-4564-a264-c1a2a596d5c2" /> Policies and triggers are fairly straight forward since we can determine what's related by their target table. Functions are a bit more fuzzy as we're trying to find what's related by checking the function definition, if it does anything to the table. For e.g based on the screenshot above, `blog_handle_new_user` has this definition which was why it was flagged <img width="500" alt="image" src="https://github.com/user-attachments/assets/fb8f3be4-05df-4d87-8440-8b75d95546ae" /> We're also deliberately decoupling loading of policies + triggers and functions since searching functions takes slightly longer, so opting to load results of policies + triggers first, then lazy load functions subsequently once results are ready ## Performance As usual, ran a benchmarking session with Claude just to make sure that the added SQL doesn't cause any performance issues, these are aggregates of 4–5 runs. **Catalog size (stress catalog)** | Query | 2,000 tables | 10,000 tables | |---|---|---| | Policies and triggers, hub table (many FKs) | 0.1 ms | 0.5–1.3 ms | | Policies and triggers, ordinary table | ~0 ms | ~0 ms | | Functions, every body matches | 1.4 ms | 4–8 ms | | Functions, no match (full scan) | 1.8 ms | 7.3–7.7 ms | | Functions, table not visible | 0 ms | 0 ms | **Large function bodies** (random text, 2,000 tables plus 2,000 small functions, plus the large ones added) | Function source | Largest function | Functions: no match (full scan) | Functions: every body matches | |---|---|---|---| | 56 MB (600 functions) | 94 KB | ~50 ms | 2 ms | | 103 MB (+10 multi-MB) | 4.7 MB | ~92 ms | 2 ms | ## To test Use a project with a table that has at least one policy, one trigger, and a function that mentions the table in its body. - [ ] Open that table in the Table Editor and press Cmd+K. A **Related resources** section appears at the top with its policies, triggers, and functions. - [ ] Click a policy, a trigger, and a function. Each opens its editor on the right resource. - [ ] A trigger's function does not also appear under the functions rows. - [ ] Type part of one of those names. The section narrows to matching rows and the project-wide entity results appear below. A resource can appear in both. - [ ] Type something that matches nothing in the table. The section disappears rather than showing empty. - [ ] Clear the input. The full section comes back without a loading flicker, since the data is cached. - [ ] Open the table editor on a table with no policies, triggers, or referencing functions. Cmd+K shows no empty **Related resources** section. - [ ] Switch to a different table and press Cmd+K. The section shows that table's resources, not the previous table's. - [ ] Open Cmd+K from a non-Table Editor page, such as the SQL Editor. The section is not shown. - [ ] In the network tab, check that opening the menu sends one query for policies and triggers and one for functions. Typing sends no additional ones for this section. |
||
|
|
5d8499b6f1 |
chore(eslint): allowlist grant and connectionString in query exhaustive-deps (#52334)
## Problem `@tanstack/query/exhaustive-deps` flags every variable used in a `queryFn` that isn't in the `queryKey`. Some variables are intentionally left out because they don't change the returned data, and keeping them out of the key avoids splitting the cache: * **`connectionString`** in queries that run SQL against the user's database. These currently need `eslint-disable` comments or count against the ratchet. * **`grant`**, the FGA grants that Studio data hooks now take (see #52331). Every migrated query would otherwise need a disable comment. The installed plugin (5.91.2) has no way to configure this. ## Solution * Upgrade `@tanstack/eslint-plugin-query` from `^5.0.0` (resolving 5.91.2) to `^5.104.5`. The rule's `allowlist` option arrived in 5.95.0. 5.105.0 is newer than our pnpm minimum release age allows. * Allowlist `grant` and `connectionString` for `exhaustive-deps` in `eslint-config-supabase/next.js`. * Remove the 11 disable comments in Studio that only suppressed `connectionString`. * Six disable comments stay, because they suppress other dependencies: * `ReportBlock.tsx` * `UserJourneys.queries.ts` * `github-config-query.ts` * `bucket-objects-infinite-query.ts` * `table-rows-query.ts` * `useSingleLog.tsx` * Lower Studio's `@tanstack/query/exhaustive-deps` baseline from 87 to 28. The upgraded rule is stricter than 5.91.2: without the allowlist it adds about 18 warnings. With the allowlist, the total drops well below the old baseline, because many existing warnings were unsuppressed `connectionString` omissions. The lockfile changes are the plugin and its `@typescript-eslint` dependencies. The graphiql entries are re-keyed by pnpm's peer resolution; their versions are unchanged. ## Testing * `pnpm --filter studio run lint:ratchet` passes. * ESLint is clean on each file where a disable comment was removed. * Other apps' ratchets only track `shadcn/*` rules, so they're unaffected. |
||
|
|
fffb1e23ca |
feat: implement profile permissions v2 api (#50966)
## Problem Migrating Studio's permission checks from the old RLS json logic to openfga backed permissions. ### New hooks and helpers - `usePermissionsQueryV2` fetches the new profile openfga permisisons - `useAsyncCheckPermissionsV2` the replacement for the old check hook; takes an FGA permission string (or a list) - `FGA_PERMISSIONS` permission constants derived from `@supabase/shared-types`. At the moment, the hook also accepts plain strings for permissions not yet published in the package - `useAsyncCheckUserContentPermissions` new hook for permission checks on user content (SQL snippets, reports, log snippets). This wraps ``useAsyncCheckPermissionsV2` and adds existing content level rules on top of the fga permission check ### Notes - ~~Need api to support new permissions: project_operations_write, billing_read/write, audit_logs_read~~ [DONE] - ~~Still need to support: organization_config_read/write, auth hooks and users permissions~~ [DONE] --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com> |
||
|
|
e42f4ec612 |
chore: remove pgMetaScopedIntrospection feature flag (#52019)
## 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? Cleanup: remove a fully rolled-out Studio feature flag. Resolves CLI-2759. Supersedes #50260 and #47931 (rebuilt on current master). ## What is the new behavior? Scoped introspection is the only path. - Studio: delete `data/scoped-introspection.ts` and `PG_META_SCOPED_INTROSPECTION_FLAG`; stop threading `scoped` through table editor, rows/counts, privileges, enumerated types, table definition, retrieve, prefetcher, `EntityListItem`, `SidePanelEditor`, `EditHookPanel`, `DefaultLayout`. - pg-meta: drop `scoped?: boolean` from public builders and delete the frozen unscoped SQL. `tables.list` keeps its full-catalog `TABLES_SQL` (never flag-gated). ## Test plan - [x] pg-meta + Studio typecheck - [x] pg-meta suite against Docker DB (521/521) - [x] Studio vitest for touched areas - [x] Open Table Editor, row counts, privileges, and enumerated types on a project (dogfooded on the preview deploy) - [ ] After merge, retire `pgMetaScopedIntrospection` in the flag dashboard 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
4507b20370 |
fix(studio): stop table editor filters leaking across tables on Back (#51391)
On TanStack, the URL moves to the next table before the route params and rendered table do. Two places in the Table Editor read the table from one and its filters from the other, so one table's filters got applied to another during Back navigation. Reproduces on master (TanStack only); reported while testing #51067. **Changed:** - `useSyncTableEditorStateFromLocalStorageWithUrl` skips saving while the URL's table id doesn't match the rendered table, so a table no longer reopens (from tabs/sidebar) with another table's filter. - The sidebar's row count (`EntityListItem`) only uses URL filters when the URL belongs to that table (`useUrlTableFilters`), so it no longer runs `count(B) where <A's filter>` (which 400s when the column doesn't exist). **Added:** - Real-TanStack-router regression tests for both, with a delayed route load (each fails without its fix). ## To test - Add a filter on table A, switch to table B and back a few times via the sidebar, then hit browser Back repeatedly - Open B from its tab/sidebar – it shouldn't pick up A's filter - Watch network: no `table-rows-count` for B should include A's filter - A's own filter (and its filtered sidebar count) should still work when on A --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
09a1f431bc |
Mass update for all lucide icon imports to use the component with Icon suffix (#51659)
## Context This is largely just a mechanical change here: Opting to use lucide icons with the `Icon` suffix across all icon imports within `studio` - so that it’s clearer which components are icons + reduces the possibility of name collision with our own components - e.g <User /> vs <UserIcon /> Also added a eslint rule for this: <img width="1069" height="167" alt="image" src="https://github.com/user-attachments/assets/7f36f443-5ca2-4bf6-8d22-86e774513bfc" /> And updated `AGENTS.md` as such: ``` Icons come from `lucide-react`, always imported with the `Icon` suffix (`import { CheckIcon, Trash2Icon } from 'lucide-react'`) — never the bare names (`Check`) or `Check as CheckIcon` aliases (lint-enforced). ``` |
||
|
|
eb20a4674d |
getTableDefinitionSql to escape SQL identifiers (#51258)
## Context Similar to domain to https://github.com/supabase/supabase/pull/51256 - `getTableDefinitionSql` doesn't escape SQL identifiers, which generates invalid SQL on the dashboard's table editor for the "Copy table schema" CTA, or the table definition tab. Also fixes the "Copy table schema" CTA which was missing the `scoped` parameter when calling `getTableDefinition` Changes here addresses this issue, can test with a table named like `test"table` |
||
|
|
476d4a5851 |
refactor(ui): drop redundant Button variant="default" props (#50161)
## What kind of change does this PR introduce? Mechanical cleanup on top of the Button default-variant change (#50160). ## What is the current behavior? Many callsites still pass `variant="default"` even though that is now the component default. ## What is the new behavior? Removes redundant static `variant="default"` from legacy `Button` and `ButtonTooltip` callsites. Keeps explicit defaults where they document the API: - `button-default.tsx` and `button-sizes.tsx` demos - `DocsButton`, which pins neutral styling at the wrapper boundary ## To test Studio: - [Auth → Rate Limits](https://studio-staging-2s957kwc4-supabase.vercel.app/dashboard/project/_/auth/rate-limits): dirty the form so Cancel appears; Cancel stays neutral, Save stays green - [Project Settings → API Keys](https://studio-staging-2s957kwc4-supabase.vercel.app/dashboard/project/_/settings/api-keys): `DocsButton` in the header actions stays neutral Design system: - [Design system → Button](https://design-system-git-dnywh-dc924ac1-supabase.vercel.app/design-system/docs/components/button): `button-default` / `button-sizes` still show explicit default styling; Primary (green) is restricted to the Primary section (and `asChild`) WWW: - [www → Brand assets](https://zone-www-dot-com-git-dnywh-dc924ac1-supabase.vercel.app/brand-assets): Download logo kit / Download button kit stay neutral |
||
|
|
0e35cbf4a4 |
Security definer materialized view (#40800)
Fixes #40799 Now, the correct error will be shown for materialized views accessible to `anon` and `authenticated` roles via Data API, instead of the unrelated "Security Definer view" error. For convenience, users can immediately fix the issue by running the correct SQL query to revoke select from `anon` and `authenticated`, just by clicking on "confirm" on the confirmation modal I just created. https://github.com/user-attachments/assets/f3ce9353-4ad0-4063-bf33-0b403f5fa87a Before <img width="958" height="440" alt="materialized" src="https://github.com/user-attachments/assets/89047c91-da35-4b9f-b7e3-82e877bcf2c6" /> Edit: Thanks to the review by @saltcod, I now realise that revoking access from `anon` and `authenticated` users might not be the optimal solution since it would break many projects relying on the access to materialized views. After pondering on the possible solutions, I figured there isn't an easy one, so I did away with the autofix button, and instead created a dialog explaining three possible options for the user, with a sample query under each one for convenience. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added clearer warnings when materialized views are accessible through the API. * Added a dialog explaining how to review and revoke API access for materialized views. * Added guidance and code examples for restricting access to API roles. * Added a link to the Security Advisor for additional information. * **Improvements** * Updated materialized view tooltips to accurately describe API accessibility. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com> |
||
|
|
a66dae48f2 |
fix(studio): restart action for table editor load errors FE-4054 (#48687)
## Problem When the table editor showed a "Failed to load tables" or "Failed to load schemas" error (for example, when the underlying database or API gateway is unhealthy), there was no working way to restart the project from that error state. Restarting only worked by navigating to Project Settings. ## Fix "Failed to load tables" goes through the existing `ErrorMatcher` classification system, which only showed troubleshooting steps (including a restart action) for connection-timeout errors. Added an `ERROR_MAPPINGS` entry for the unclassified/generic API error case, reusing the existing `RestartDatabaseTroubleshootingSection` and `RestartProjectDialog` components already used for connection timeouts. "Failed to load schemas" (in the shared `SchemaSelector`, used across the table editor and several Database pages) only offered a retry. Added a "Restart database" button next to it, wired to the same `RestartProjectDialog`. ## How to test - In the table editor, trigger a table-load failure that isn't a connection timeout (any generic API error). The error card should now show a "Try restarting your project" step with a working restart action. - Open the schema selector while schemas fail to load (e.g. mock a 503 from the schemas query). A "Restart database" button should appear next to "Reload schemas" and open the restart confirmation dialog. - `apps/studio/components/interfaces/ErrorHandling/ErrorMatcher.test.tsx` and `apps/studio/components/ui/SchemaSelector.test.tsx` cover both cases. FE-4054 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added database restart guidance when schema loading fails. * Added options to reload schemas or restart the database, including a confirmation prompt. * Added troubleshooting guidance for unclassified table-loading errors. * **Bug Fixes** * Improved error handling by displaying relevant fallback guidance for unknown errors while preserving classified troubleshooting instructions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
cea246d195 |
Fix: improve accessibility for icon buttons (Table Editor menu) (#47639)
## 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? Bug fix (accessibility improvement) ## What is the current behavior? Icon-only buttons do not have explicit accessible names for screen readers or tooltips. ## What is the new behavior? All icon-only buttons now have explicit accessible names using visually hidden text (sr-only), ensuring proper screen reader support. ## Additional context Tooltip text is preserved or added for visual users. No visual changes were introduced. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Accessibility Improvements** * Updated table editor action controls with clearer, context-aware `aria-label`s (e.g., “Add new column”, “More options for …”, “New table”). * **UI Refinements** * Added hover tooltips to key table editor actions, including add-column, more-options dropdown triggers, and create-new-table button, improving discoverability and guidance. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
e3d7267845 |
fix(studio): chip away explicit-tabindex ratchet debt (#48040)
## What kind of change does this PR introduce? A11y cleanup follow-up to #47984 / [DEPR-626](https://linear.app/supabase/issue/DEPR-626). ## What is the current behavior? Studio had 82 ratcheted `supabase/require-explicit-tabindex` violations (raw `<button>` / `role="button"` without explicit `tabIndex`). ## What is the new behavior? - Explicit `tabIndex={0}` (or disabled → `-1`) on those Studio call sites across nav, `components/ui`, Database, Storage, and the remainder - Ratchet baseline cleared (**82 → 0**) and the rule **removed from the Studio ratchet** (debt is gone; ratchet is temporary) - Rule remains a shared **`warn`** for now — promoting to `error` (and sweeping www/docs/design-system) is a follow-up - Also fixed the learn/ui-library call sites that surfaced while experimenting with error promotion - Small follow-ups where making controls focusable exposed gaps: accessible names, disabled/focus consistency, focus-ring polish on To-test surfaces, home section `KeyboardSensor`, and an E2E locator tightened after `aria-label="Remove column"` Prefer migrating to `Button` from `ui` in future touch-ups; this PR takes the minimal path so Studio debt can stay at zero. ## Additional context Batches landed together so baseline conflicts stayed simple while chipping away: - Hotspots / nav (FirstLevelNav, Marketplace, AttachmentUpload, Column, Tabs, …) - `components/ui` shared - Database + Storage - Remainder **Out of scope / intentional deferrals** - Promoting `supabase/require-explicit-tabindex` to a lint **error** (follow-up after www/docs/design-system sweeps) - Tabs/Radio roving, tooltips, context menus, in-menu items - Full keyboard-accessible tab-close UX (close stays hover + `tabIndex={-1}`; context menu still closes tabs) - Data API docs links (`/project/<ref>/api` redirect) **Reviewer notes** - Rule only flags raw `<button>` / `role="button"` without a `tabIndex` prop. `Button` from `ui` already bakes this in - `tabIndex={-1}` is intentional for disabled controls, in-menu / roving-focus children, and hover-only tab close - For dnd-kit grips, put `tabIndex` **after** `{...attributes}` so it isn’t overwritten (TS2783) ### To test Use **Safari** with macOS Keyboard navigation **off** (System Settings → Keyboard). Chrome once for a sanity pass. For each surface below: Tab until the control is focused, then activate with Enter/Space where relevant. 1. **API Docs side panel** (Table Editor → open a table → **API docs**) - Floating API Docs panel — **not** `/project/<ref>/api` (that redirects to Data API docs; language ToggleGroup uses arrow keys; links are out of scope) - Left nav buttons — Tab through several and activate one; active highlight / navigation still works 2. **Integrations → Marketplace** - Enable **Integrations layout** feature preview first (avatar menu → Feature previews) - `/org/<slug>/integrations` or project integrations marketplace - “Clear all”, grid/list toggles — Tab + activate 3. **Table Editor → create a table → Columns** - Drag handles only appear while **creating** (not when editing an existing table) - Tab to grip / remove (X) / sensitive-data eye if shown 4. **Project Home** — section drag handles - Tab to a grip (visible focus ring) - Optional: Space to pick up, arrows to move, Space/Esc to drop (KeyboardSensor added) - Mouse dnd still works 5. **Storage → Policies** — expand/collapse bucket list chevron (design-system focus ring, no stuck grey open bg) 6. **Support form** (Help → Support) — attachment remove (×) and add-attachment control when visible Disabled controls should be **skipped** by Tab. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Accessibility Improvements** * Improved keyboard navigation throughout Studio by explicitly managing focus (`tabIndex`) across many interactive controls (menus, tabs, tables, charts, dialogs, navigation, and form actions). * Disabled or non-interactive controls are now removed from the tab order (or made unfocusable), while available actions remain reachable. * Ensured `type="button"` on relevant controls to prevent unintended submissions, and refined keyboard focus behavior for various toggles and copy/remove actions. * **Chores** * Updated the ESLint rule baseline configuration to match the new focus behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
+4 |
503bdb5a6f |
Fix filter button in table editor (#47867)
## Context Realised that the filter button in the table editor is broken so this PR fixes it <img width="385" height="393" alt="image" src="https://github.com/user-attachments/assets/94332f1b-cd69-4a8c-a822-3b9096d06ee3" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **UI Improvements** * Updated the entity-type filter to use a clearer, labeled “Filter entity types” button with revised popover trigger and sizing. * Refreshed the table header filter controls, including the entity-type dropdown behavior and updated styling when filters are applied. * Improved handling when no entity types are currently visible by showing a dedicated empty-state within the filter menu. * **New Features** * Added a “No results based on filters” empty panel with a “Reset filters” action to restore all entity types. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Alaister Young <alaister@users.noreply.github.com> Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> Co-authored-by: kanad <github@kanad.dev> Co-authored-by: supabase-supabase-autofixer[bot] <248690971+supabase-supabase-autofixer[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Jeremias Menichelli <jmenichelli@gmail.com> Co-authored-by: Miranda Limonczenko <miranda.limonczenko@supabase.io> Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> Co-authored-by: Gildas Garcia <1122076+djhi@users.noreply.github.com> Co-authored-by: David_C <110653663+YuDavidCao@users.noreply.github.com> Co-authored-by: Ali Waseem <waseema393@gmail.com> Co-authored-by: Nik Richers <nrichers@gmail.com> Co-authored-by: Nik Richers <nik@validmind.ai> |
||
|
|
7f8fb85caf |
Joshen/fe 3879 schema not exposed warning is unnecessarily repeated in (#47868)
Just a tiny nit i came across - realised that if the schema is not exposed via the API, the warning that we show on the policies page RE data not being selectable is repeated for each table which imo seems unnecessary. Opting for a single admonition at the top instead ## Before <img width="1085" height="744" alt="image" src="https://github.com/user-attachments/assets/7bd8cf7b-f5a8-47d6-b41f-13fc4782ed8b" /> ### After <img width="1080" height="673" alt="image" src="https://github.com/user-attachments/assets/c839f502-42ff-4184-ad07-0ff2fd2d2676" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added an on-screen warning for tables whose schemas aren’t exposed via the project Data APIs, including a link to Data API settings. * **UI Improvements** * Refined the “filter entity types” control’s tooltip behavior and updated the popover header text. * **Bug Fixes** * Improved Data API/RLS status messaging by removing the prior “schema not exposed” outcome and showing “unknown” when access can’t be determined. * Consolidated policy warning rendering to avoid duplicated or inconsistent messages. * **Tests** * Updated policy/admonition helper tests to match the revised status and message behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
1de298ff31 |
Reinstate https://github.com/supabase/supabase/pull/45143 into latest master (#47433)
## Context Previous PR was [here](https://github.com/supabase/supabase/pull/45143) but it got stale with lots of conflicts so figured it'll be easier redo it off the latest master Moves policies page from Auth to Database under an Access Control section along with Roles. This moves all existing files, applies redirects, and updates urls to point to the new route <img width="274" height="412" alt="image" src="https://github.com/user-attachments/assets/7952c185-64ae-4355-ba36-45397efe1787" /> <img width="453" height="471" alt="image" src="https://github.com/user-attachments/assets/04b3dcb3-48a5-4049-9893-d01109fb46a9" /> ## To test - [ ] Verify that policies now live under Database correctly <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a quick navigation shortcut to open **Database > Policies (RLS)**. * **Bug Fixes** * Updated Policies and RLS-related links across the product to open the **Database policies** area (menus, command palette, context actions, alerts, and link-outs). * Added a permanent redirect from the old **auth policies** URL to the new **database policies** URL. * **Documentation** * Updated RLS Dashboard and security checklist instructions to reference **Database > Policies**. * **Tests** * Adjusted automated tests to validate the new Policies route. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
c6fc456910 |
chore: cleanup duplicate exports studio (#47387)
## Problem Knip reports many duplicate exports (both named and default). Besides, we're moving away from default exports and even have an eslint rule to enforce it on new code. ## Solution - Cleanup those exports - Update imports when necessary No functional changes. If it builds, it's fine |
||
|
|
b1b29ad011 |
Fix: improve accessibility for icon buttons (#47214)
## 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? Bug fix (accessibility improvement) ## What is the current behavior? Icon-only buttons do not have explicit accessible names for screen readers. ## What is the new behavior? All icon-only buttons now have explicit accessible names using visually hidden text (sr-only), ensuring proper screen reader support. ## Additional context Tooltip text is preserved or added for visual users. No visual changes were introduced. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Added hover tooltips across the database editor and SQL editor, including “More options” menus, table filter controls, and the “Create a new query” action. * **Accessibility** * Improved button accessibility by adding/expanding `aria-label`s for Intellisense, favorites (add/remove), and “Prettify SQL.” <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
96d43099bb |
chore: refactor Button API so that it can be used a standard button (#46880)
## Problem Our `<Button>` component breaks the default `button` contract by redefining the `type` prop to set its variant (`primary`, `default`, etc) instead of the button type (`submit`, `button`, etc). This is confusing and forces to write more code when using it with shadcn components that expect/inject the standard button props. ## Solution - rename the `type` prop to `variant` - rename the `htmlType` prop to `type` - propagate the changes where necessary - format code ## How to test As this is just prop renaming, if it builds it's ok --------- Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com> |
||
|
|
fc6b42ea1a |
fix: added schema switching shortcut (#46753)
## 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 a small shortcut to make it easier to switch schemas in the table editor <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a keyboard shortcut (S+S) to open the schema selector in the table editor for faster navigation and accessibility. * Schema selector now supports keyboard/shortcut-driven control and tooltip guidance. * Selector automatically closes when a schema is chosen or after creating a new schema. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
02422bed2c |
fix: keep role view (#46426)
## TL;DR fixes export hydration so it stays under the active impersonated role in table Editor ## Example: while viewing as `anon` | Before | After | | --- | --- | | <img width="653" height="234" alt="before: hydration query wrapped with anon impersonation" src="https://github.com/user-attachments/assets/0a7b9b21-b5b5-4eac-94f4-1bffe7238eee" /> | <img width="518" height="226" alt="after: plain select without impersonation wrapper" src="https://github.com/user-attachments/assets/b4228a1a-2972-4ed6-87c7-85f85f61f8ca" /> | PS: The `Export` path was skipping the active impersonation context and issuing the query without the `anon` role wrapper ## ref - closes #46423 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Export functionality now includes role impersonation context for both full dataset and selected row exports, ensuring consistent behavior across all export operations. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46426?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
108f99f5fc |
fix: table menu empty state design (#46494)
## Problem <img width="500" height="470" alt="image" src="https://github.com/user-attachments/assets/17536208-9b7b-4a05-bd04-03def662dd28" /> ## Solution <img width="244" height="244" alt="image" src="https://github.com/user-attachments/assets/f6d3ea4f-f36c-45a3-b4aa-ea37bb6a6e22" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Style** * Adjusted the empty-state illustration layout by removing explicit height constraint classes from the wrapper elements. The component's vertical sizing is now managed through alternative approaches while preserving existing positioning, scale transformations, and pointer-event configurations. These refinements maintain visual consistency while improving the overall layout behavior for the empty state display. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46494?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
c39bb96d74 |
feat: Context view actions for views and material views (#46383)
## 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 material views and views don't have any options on the context menu, they only have a copy name. This adds copy schema, export CSV, export SQL and delete table to that list Added E2E tests to cover the use cases <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Delete views and materialized views via confirmation dialogs with optional cascade * Copy SQL definitions for views and materialized views * Export views and materialized views as CSV and SQL from the entity menu * Confirmation modals now show dependency warnings and cascade toggle consistently * **Tests** * End-to-end tests covering copy, export, and delete flows for views and materialized views in the table editor <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46383?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
7e9badc6b8 |
chore(studio): migrate useStaticEffectEvent to React 19 useEffectEvent (#46415)
Studio is on `react@^19.2.6`, and `useEffectEvent` shipped stable in React 19.2 with the same signature as the userland polyfill. This drops the local hook in `apps/studio` and `apps/www` in favor of the built-in. **Removed:** - `apps/studio/hooks/useStaticEffectEvent.ts` - `apps/www/hooks/useStaticEffectEvent.ts` - `.claude/skills/use-static-effect-event/` — skill is obsolete **Changed:** - 26 call sites: dropped the `useStaticEffectEvent` import, added `useEffectEvent` to the existing `react` import, renamed call sites - `.claude/CLAUDE.md`: `apps/studio` row updated React 18 → React 19 - `.claude/skills/vercel-composition-patterns/SKILL.md`: removed stale "Studio uses React 18, skip these patterns" warning ## To test - `pnpm typecheck --filter=studio` — passes locally - `pnpm typecheck --filter=www` — passes locally - `grep -rn "useStaticEffectEvent"` returns nothing outside `node_modules` - Smoke-test areas that use the hook: schema visualizer edges (intersection check), spreadsheet import, sign-in/CLI login flows, side panels with unsaved-changes prompts **Out of scope:** pre-existing Tailwind lint warning on `DefaultEdge.tsx:141` (`outline` + `outline-1` conflict) — unrelated to this migration <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Internal event handling migrated to React’s built-in event hooks across the Studio app; no user-facing changes. * **Documentation** * Clarified React 19 compatibility and noted Studio now targets React 19. * Removed obsolete documentation for a deprecated internal hook. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46415?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
65c570e85b |
Fix copy / export large values in table editor (#46268)
## Context There's an issue with copying / exporting rows from the table editor with the following conditions: - Row has a column value that exceeds 10,240 and hence is truncated for performance reasons <img width="300" alt="image" src="https://github.com/user-attachments/assets/4639edbb-ece6-4028-89b6-769ac314c3f3" /> - User is trying to copy/export selected rows (not all rows in the table) <img width="300" alt="image" src="https://github.com/user-attachments/assets/e7c0da77-051c-4c46-af0d-f9510e0b37c4" /> The copy/export action will return the truncated data which is incorrect (Should return the full data) ## Problem This is happening as if we're only copying/exporting selected rows, we're just using what's been loaded in the table editor to export (as opposed to if the user is copying/exporting all rows in the table, we'd be fetching the data from the database first before doing so) Hence am opting to add a data hydration logic, such that if there's a selected row that's been truncated, we'd fetch them on demand first before copying/exporting. There's limitations to this though - e.g if the table doesn't have a primary key we can't do this (since we need to run a query to fetch the data). This is already an existing behaviour when trying to load the column value in the table editor in the grid so no issues I believe. We'll just show this toast: <img width="300" alt="image" src="https://github.com/user-attachments/assets/442637bb-4b9b-492d-b202-bbf6e5ae7512" /> ## To test You'll need a column with a really large value - the way I do it is to load the data directly into the DB via TablePlus - [ ] Verify that copying / exporting selected rows with really large column values copies/exports all the data correctly (there shouldn't be any truncated value) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Improved handling of truncated cell values during copy and export operations * **Bug Fixes** * Copy and export operations now require an active project selection * Fixed data export for tables without primary keys * **Style** * Updated grid header copy and export control layout <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46268?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
c721e8fa8f |
chore(studio): rename SQL Editor sidebar items (#46241)
## What kind of change does this PR introduce? Chore. Rename / UX copy update in Studio's SQL Editor. ## What is the current behavior? The SQL Editor sidebar has a **Community** section containing two pages: - **Templates**: reusable SQL snippets for common tasks - **Quickstarts**: end-to-end examples and starter projects The section label "Community" is misleading because these are first-party presets maintained by the Supabase team, not user-contributed content. "Quickstarts" also doesn't clearly convey "end-to-end example". ## What is the new behavior? - **Community** → **Reference** (sidebar section header) - **Quickstarts** → **Examples** (route: `/sql/quickstarts` → `/sql/examples`) - Templates keeps its name and route (`/sql/templates`), description updated to "Reusable SQL snippets for common tasks" Taxonomy: - **Templates** = reusable SQL patterns you adapt - **Examples** = end-to-end walkthroughs you run as-is A permanent redirect is added so `/sql/quickstarts` gracefully forwards to `/sql/examples`. The existing `/sql/templates` route is unchanged. | Before | After | | --- | --- | | <img width="1024" height="759" alt="Quickstarts SQL Editor Pickles Pantry Supabase-644881A5-6396-43AA-9AC4-61FFFFF18831" src="https://github.com/user-attachments/assets/ff876c78-c499-4bac-b1ae-91e31817511d" /> | <img width="1024" height="759" alt="Examples SQL Editor Pickles Pantry Supabase-573775FA-E38F-4F8D-92E3-114237410C36" src="https://github.com/user-attachments/assets/bdb8910f-94e9-4c21-bb3a-f6513008d8bc" /> | ## Additional context - `CommunitySnippetsSection.tsx`: header label + route keys updated; the underlying `community` localStorage key is intentionally unchanged to avoid resetting stored collapsed/expanded state for existing users. - ESLint rule baselines and a docs troubleshooting link updated to reflect the new filenames/routes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Updated troubleshooting guide to reference the correct SQL examples location. * **New Features** * Renamed "Quickstarts" to "Examples" throughout the SQL editor for improved clarity. * Updated SQL template and examples section descriptions and labels to better reflect their purpose. * Reorganized SQL editor navigation to streamline access to templates and examples. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46241?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Joshen Lim <joshenlimek@gmail.com> |
||
|
|
f8f948a2a4 |
fix: policy urls (#46064)
## TL;DR fixes `Table Editor -> View policies` for schema names with special characters tested with schema `sales&ops` : ## ex: | b4 url: `schema=sales&ops` | after url: `schema=sales%26ops` | | --- | --- | | <img width="394" height="63" alt="image" src="https://github.com/user-attachments/assets/fe5bea94-e364-493e-a2de-e9493bf17ef2" /> | <img width="544" height="67" alt="image" src="https://github.com/user-attachments/assets/23f5d648-d7f0-49b9-95de-ef0207d5839c" /> | ## ref - closes #46061 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved URL handling for the "View policies" link to ensure proper encoding and reliability. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46064?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
8c6d5036ea |
chore: remove <Label> _Shadcn_ suffix (#45986)
## Problem The `_Shadcn_` suffix isn't needed anymore on label component ## Solution Remove it. No other changes <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Standardized Label usage across the codebase by removing the legacy alias and using the direct Label export from the UI package consistently. * **Documentation** * Updated component examples and docs to use the standardized Label component in usage snippets and demos. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/45986) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
d0fd4478c0 |
chore: migrate Popover usages to Shadcn components (#45980)
## Problem We have multiple Popover components ## Solution - [x] migrate Popover usages to Shadcn components - Migrated JSON and text editor in the `TableEditor` (inline row edition) - Migrated the template popover in the logs explorer templates page - [x] remove `_Shadcn_` suffix from Popover components (renaming + prettier) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Unified popover implementation across the app and design system; dropdowns, calendars, menus and tooltips now use a consistent popover API with no visual or interaction changes. * **Chores** * Minor prop typing update for the logs date-picker to align with the consolidated popover content type. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/45980) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
56de26fe22 |
chore: Migrate the monorepo to use Tailwind v4 (#45318)
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> |
||
|
|
42b431a270 |
feat(studio): add keyboard shortcuts to the table editor (#45178)
## 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? Feature — a set of new keyboard shortcuts for the table editor, along with infrastructure to register, gate, and surface them. ## What is the current behavior? Clicking into the grid "traps" the keyboard: Escape doesn't pop out, there are no shortcuts for row selection / deletion / navigation, and the search-tables input grabs focus on page load. ## What is the new behavior? ### New shortcuts (all scoped to the table editor) | Keybind | Action | Surface | |---|---|---| | `Esc` | Exit grid selection — clears the highlighted cell and drops focus back to the page | hotkey | | `↑` / `↓` | Start grid navigation from the first cell when no cell is selected | hotkey | | `Shift+Space` | Toggle selection on the current row | hotkey + checkbox tooltip | | `Mod+A` | Toggle selection on all displayed rows (matches Excel) | hotkey + header-checkbox tooltip + Cmd+K | | `Mod+Shift+A` | Toggle selection on all rows in the table | hotkey + "Select all rows in table" button tooltip + Cmd+K | | `Mod+Backspace` | Delete selected rows | hotkey + delete-button tooltip + Cmd+K | ### Infrastructure - **Split registry** — table-editor shortcuts moved to `state/shortcuts/registry/table-editor.ts`, spread into `SHORTCUT_IDS`. Makes it easy to scope a runtime check to a specific surface. - **`eventMatchesAnyShortcut`** (`state/shortcuts/matchEvent.ts`) — queries the hotkey library's live `SequenceManager` so gated shortcuts (`enabled: false`) are correctly excluded. Covered by `matchEvent.test.ts`. - **`handleCellKeyDown`** now calls `event.preventGridDefault()` whenever the keystroke matches an active table-editor shortcut, so rdg's "start editing on key press" default doesn't compete with shortcut actions (e.g. typing `Shift+X` no longer opens edit mode with `X` as input). - **`<Shortcut>` / `<ShortcutTooltip>`** used on the header checkbox, the per-row checkbox, the "Select all rows in table" button, and the delete button — keybinds show up on hover (Linear-style) so users can discover them without reading docs. - **CSS** — `.rdg:not(:focus-within) .rdg-cell[aria-selected='true']` drops the selected-cell outline whenever focus leaves the grid, reinforcing the "you're out" feedback after `Esc`. - **`useShortcut`** wraps the Cmd+K-registered action to close the command menu after firing (previously menu stayed open after selecting an action). - **Search-tables input** no longer auto-focuses on load, so arrow shortcuts work immediately without clicking out first. ## Additional context Linear: FE-3057 ### Test plan - [x] Open any table → `↓` selects the first cell; subsequent arrows navigate rows - [x] `Esc` drops focus out of the grid and re-enables `↓` to re-enter - [x] Click a cell → `Shift+Space` toggles that row's selection (checkbox) - [x] `Mod+A` toggles all displayed rows - [x] With pagination + some rows selected → `Mod+Shift+A` toggles "Select all rows in table" - [x] With rows selected → `Mod+Backspace` deletes them (existing confirmation flow) - [x] Hover the header checkbox / per-row checkbox / delete button → keybind tooltip after ~500ms - [x] Cmd+K with selection → the relevant action shows up; selecting it closes the palette and runs <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added table editor keyboard shortcuts for navigation, row selection, and cell actions, with command-menu integration and visible shortcut tooltips. * **Improvements** * Better keyboard handling in grid cells allowing external shortcuts to override default behavior. * Select-all/deselect-all toggle and improved select-row UX; selected-cell styling no longer shows when grid loses focus. * Command menu now reliably closes before executing shortcut actions. * Removed autofocus on the table editor search input for consistent focus behavior. * **Tests** * Added unit tests covering shortcut matching and command-menu shortcut behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
308cd791a2 |
chore: Prep work for migrating to Tailwind v4 (#45285)
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. |
||
|
|
7f5865872a |
Enforce noUnusedLocals and noUnusedParameters in tsconfig.json + fix all related issues (#45264)
## Context Enforce `noUnusedLocals` and `noUnusedParameters` in tsconfig.json + fix all related issues |
||
|
|
416210d666 |
chore: remove _Shadcn_ suffix for Checkbox and Radio components (#45263)
## Problem With #45211 and #45218 merged, we don't need the `_Shadcn_` suffix anymore ## Solution - [x] Remove the `_Shadcn_` suffix - [x] Update exports and imports <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Standardized UI component exports by removing legacy naming conventions and providing direct imports for checkbox and radio group components throughout the design system. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
6be596ea34 |
feat: add user preference to enable queue operations (#44366)
## 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? - Remove queue operations from feature preview into settings - Refactor dashboard settings - Resolves DEPR-434 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Dashboard settings panel in Account preferences with toggles for Inline Editor and Queue Operations; “Dashboard” added to project Configuration. * **Removed** * Old Inline Editor settings UI and the Queue Operations feature-preview UI removed. * **Refactor** * Consolidated dashboard preferences into a single settings surface; banners and actions now navigate to preferences; account/preferences layouts and back-navigation behavior adjusted for platform vs self-hosted. * **Tests** * Added tests for settings UI, menu generation, redirects, and local-storage. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com> |
||
|
|
4a0bb36ca8 |
style: require sorted imports in studio/components (#44408)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com> |
||
|
|
18ddfadf86 |
Add banner for queue operations (#43918)
## Context Similar to how we added a banner for the new table filter bar - mainly to improve visibility for this feature preview as we'd like some feedback from usage <img width="313" height="314" alt="image" src="https://github.com/user-attachments/assets/4cea6383-483a-42cf-b4a5-bb8c3918c00d" /> ## Other changes - Also adding some typing to the `addBanner` and `dismissBanner` - Removed banner for table editor filter bar |
||
|
|
ec26943390 |
feat: improve db overload debugging UX (#43564)
When the dashboard hits a DB connection timeout, users currently see a
raw error message with no
path forward. This PR adds an inline troubleshooting system that detects
known error types and
surfaces contextual next steps — restart the DB, read the docs, or debug
with AI.
## Changes
- New ErrorDisplay component (packages/ui-patterns) — styled error card
with a title, monospace error
block, optional troubleshooting slot, and a "Contact support" link that
always renders. Accepts
typed supportFormParams to pre-fill the support form.
- Error classification in handleError (data/fetchers.ts) — on every API
error, the message is tested
against ERROR_PATTERNS. If matched, handleError throws a typed subclass
(ConnectionTimeoutError
extends ResponseError) instead of a plain ResponseError. Stack traces
now show the exact error
class. All existing instanceof ResponseError checks continue to work.
- ErrorMatcher component — reads errorType from the thrown class
instance, does an O(1) lookup into
ERROR_MAPPINGS, and renders the matching troubleshooting accordion as
children of ErrorDisplay.
Falls back to plain ErrorDisplay for unclassified errors.
- Connection timeout mapping — first error type wired up, with three
troubleshooting steps: restart
the database, link to the docs, and "Debug with AI" (opens the AI
assistant sidebar with a
pre-filled prompt).
- Telemetry — three new typed events track when the troubleshooter is
shown, when accordion steps are
toggled, and which CTAs are clicked.
## Adding a new error type
1. Add a class to types/api-errors.ts
2. Add { pattern, ErrorClass } to data/error-patterns.ts
3. Create a troubleshooting component in errorMappings/
4. Add an entry to error-mappings.tsx
|
||
|
|
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 |
||
|
|
f363d69bc3 |
Persist dismissal of table filter bar banner if already enabled or enabling feature preview (#43323)
## Context Persists the dismissal of the table filter banner promo if - Already enabled - After enabling feature preview <img width="588" height="512" alt="image" src="https://github.com/user-attachments/assets/97433c5a-cb9e-47b1-9971-f368f9c1688d" /> |