473 Commits
Author SHA1 Message Date
Alaister YoungandAlaister Young df798783e1 [FE-5108] (part 4) refactor(studio): migrate integrations, settings & observability off next/link (#54307)
Part 4 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 | `components/layouts/**` and top-level shell components |
| 3 | #54306 | Database, TableGridEditor, Storage, SQLEditor,
BranchManagement, Branching, Functions, Realtime |
| **4** | **#54307 ← this PR** | **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
`components/interfaces/{Integrations,Settings,Observability,LogDrains,Issues,Linter,Reports,QueryPerformance,QuerySources,ConfigDrift,DiskManagement,Compute}/`
off `next/link`.

**Changed:**

- Replaced `next/link` across all 72 files in Integrations, Settings,
Observability, LogDrains, Issues, Linter, Reports, QueryPerformance,
QuerySources, ConfigDrift, DiskManagement, and Compute interfaces
- Updated legacy permanent-redirect hrefs (`/settings/database` →
`/database/settings`, `/settings/vault/secrets` →
`/integrations/vault/secrets`, `/reports/database#database-size-report`
→ `/observability/database#database-size-report`) to canonical routes
- Flattened legacy nested `<Link><a>...</a></Link>` markup in
`DatabaseReadOnlyAlert.tsx` and dropped `passHref` in
`Integrations/Queues/QueueTab.tsx`
- Standardized external `target="_blank"` anchors with `rel="noreferrer
noopener"`, switched `ObservabilityOverviewFooter.tsx` to `InlineLink` +
`DOCS_URL`, and applied `InlineLinkClassName` to the typed billing links
in `DatabaseReadOnlyAlert.tsx` per review feedback
- Removed `vi.mock('next/link', ...)` from
`Settings/General/Project.test.tsx` and
`MobileIssuesNavigation.platform.test.tsx`

Addresses
[FE-5108](https://linear.app/supabase/issue/FE-5108/replace-the-nextlink-shim-with-tanstack-link)

## To test

- [ ] Navigate across Integrations (marketplace, cron, queues, wrappers,
Vercel/GitHub), Settings (database, infrastructure, read replicas,
logs), Observability, Issues, and Compute pages
- [ ] Verify Logs Preview → Logs Explorer links preserve multi-line SQL
queries in search params
- [ ] Verify billing and database-size links preserve query parameters
and hash fragments

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-12-01 17:02:11 +08:00
Alaister YoungandAlaister Young 477e2c136f [FE-5109] (part 6) chore(studio): remove next/router shims, aliases, and test mocks (#54058)
Part 6 (final) of a 6-PR stack migrating all `next/router` and
`next/compat/router` imports in `apps/studio` onto TanStack Router hooks
and removing the router shims.

| Part | PR | Scope |
| --- | --- | --- |
| 1 | #54053 | Core navigation helpers, `hooks/**`, `lib/**`,
`data/prefetchers/**` |
| 2 | #54054 | `components/ui/**` |
| 3 | #54055 | `components/layouts/**` and `state/tabs.tsx` |
| 4 | #54056 | Database, Branching, Compute, Edge Functions, Explorer,
SQL Editor, Storage, Table Editor |
| 5 | #54057 | Remaining `components/interfaces/**` and
`QueryInsightsTable` router events |
| **6** | **#54058 ← this PR** | **Remove `next/router` &
`next/compat/router` shims, `_router-events.ts`, Vite aliases, and test
mocks** |

Now that no files in `apps/studio` (or `packages/**`) import
`next/router` or `next/compat/router`, deletes the router shims,
`_router-events.ts`, their Vite aliases, and the obsolete router test
mocks. `RouteValidationWrapper` is intentionally left for FE-3107.

**Removed:**

- `apps/studio/compat/next/router.ts`,
`apps/studio/compat/next/compat/router.ts`, and
`apps/studio/compat/next/_router-events.ts`
- `'next/router'` and `'next/compat/router'` entries from `nextShims` in
`apps/studio/vite.config.ts`
- Global `vi.mock('next/router', ...)` and
`vi.mock('next/compat/router', ...)` in
`apps/studio/tests/vitestSetup.ts`, `mockNextRouter` in
`apps/studio/tests/lib/route-aware-hooks.ts`, and the unused
`vi.mock('next/router')` in `tests/features/logs/LogTable.test.tsx`
- Obsolete shim tests and test helpers: `compat/next/router.test.ts`,
`compat/next/router-navigation.test.tsx`, `tests/config/router.tsx`, and
`tests/config/router.test.tsx`

**Changed:**

- Simplified `createNavigationHandler` in
`apps/studio/lib/navigation.ts` (and `navigation.test.ts`) to accept
TanStack's `UseNavigateResult<string>` only, dropping the `NextRouter`
union branch
- Updated `compat/next/link-basepath-navigation.test.tsx` (renamed from
`router-basepath-navigation.test.tsx`), `lib/router-url-shape.test.tsx`,
and `tests/lib/route-render.test.tsx` to exercise TanStack Router hooks
directly instead of the removed router shim
- Cleaned up stale `next/router` comments in `compat/next/link.tsx`,
`lib/internal-url.ts`, `router.tsx`, and `tests/lib/route-mock.ts`

**Simplified:**

- Removed `routerMock` setup from about 19 tests that no longer read it.
`next-router-mock` stays for now, because the test `FrameworkProvider`
still feeds `useParams` from it.
- `AGENTS.md` and the `vite.config.ts` error text now say only
`next/link` and `next/script` are shimmed
- Renamed `compat/next/router-basepath-navigation.test.tsx` to
`link-basepath-navigation.test.tsx`, and removed stale router-shim
references from comments

Addresses
[FE-5109](https://linear.app/supabase/issue/FE-5109/replace-the-nextrouter-shims-with-tanstack-router-hooks)

## To test

- [ ] Confirm `git grep -E "next/(compat/)?router|_router-events"
apps/studio` returns no code or config imports (only the prose guideline
in `apps/studio/AGENTS.md`)
- [ ] Confirm `pnpm --filter studio run typecheck`, `pnpm --filter
studio run lint`, `pnpm --filter studio run build`, Knip, and the full
Studio Vitest suite pass
- [ ] Spot-check basePath navigation (`next/link` + `navigateToUrl`) and
multi-line query param URLs in Studio

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-12-01 15:04:27 +08:00
Alaister YoungandAlaister Young 0f14ef4d67 [FE-5109] (part 5) refactor(studio): migrate remaining interfaces and router events off next/router (#54057)
Part 5 of a 6-PR stack migrating all `next/router` and
`next/compat/router` imports in `apps/studio` onto TanStack Router hooks
and removing the router shims.

| Part | PR | Scope |
| --- | --- | --- |
| 1 | #54053 | Core navigation helpers, `hooks/**`, `lib/**`,
`data/prefetchers/**` |
| 2 | #54054 | `components/ui/**` |
| 3 | #54055 | `components/layouts/**` and `state/tabs.tsx` |
| 4 | #54056 | Database, Branching, Compute, Edge Functions, Explorer,
SQL Editor, Storage, Table Editor |
| **5** | **#54057 ← this PR** | **Remaining `components/interfaces/**`
and `QueryInsightsTable` router events** |
| 6 | #54058 | Remove `next/router` & `next/compat/router` shims,
`_router-events.ts`, Vite aliases, and test mocks |

Migrates all remaining `apps/studio/components/interfaces/**`
directories off `next/router`, including the last production
`router.events` consumer (`QueryInsightsTable`) and the only default
`next/router` import (`DiscordCTACard`). After this PR, zero files under
`apps/studio/components/**` import `next/router` or
`next/compat/router`.

**Added:**

-
`apps/studio/components/interfaces/QueryInsights/QueryInsightsTable/QueryInsightsTable.test.tsx`:
verifies that pathname changes clear selected query state without
mutating destination or history search params, while same-pathname
search updates preserve selection

**Changed:**

- Replaced the sole production `router.events.on('routeChangeStart',
...)` consumer in `QueryInsightsTable.tsx` with a `pathname` effect that
clears `onCurrentSelectQuery` on pathname changes, and derived
`searchQuery` directly from `nuqs` (`urlSearch`) instead of mirroring it
in local state. Drops the legacy `setQueryStates({ search: null })` call
on leave, which ran after `history.push` on TanStack Router (targeting
the destination URL rather than the previous history entry, while
browser Back is expected to restore previous search params).
- Removed the `router: NextRouter` prop from `ReportWidgetRendererProps`
in `Reports/ReportWidget.tsx` and updated its callers (`ChartBlock`,
`ReportHeader`, `CreateReportModal`)
- Updated `LOG_ROUTES_WITH_REPLICA_SUPPORT` in
`Settings/Logs/Logs.constants.ts` from `[ref]` to `$ref` for TanStack
route patterns
- Replaced the default `import router from 'next/router'` in
`Support/DiscordCTACard.tsx` with `useNavigate`
- Replaced `useRouter` across `Account`, `Advisors`, `App`, `Auth`,
`ErrorHandling`, `Home`, `HomePageActions`, `Integrations`, `Linter`,
`LocalDropdown`, `Observability`, `Organization`, `OrganizationInvite`,
`Platform/Webhooks`, `Project`, `ProjectCreation`, `ProjectHome`,
`QueryPerformance`, `RedeemCredits`, `Settings`, `Sidebar`, `SignIn`,
`Support`, `UnifiedLogs`, and `UserDropdown`
- Updated affected tests (`Auth/Users/UserPanel`, `Home/ProjectList`,
`LocalDropdown`, `Organization/*`, `OrganizationInvite`,
`RedeemCredits`, `Settings/General/*`, `SignIn/SignInRecoveryCodeForm`,
`UnifiedLogs/*`)

**Simplified:**

- `LocalDropdown`, `UserDropdown` and `RedeemCredits` build the current
route from `location.href`, so the hash keeps its leading `#`
- `NewOrgForm` navigates to the `returnTo` path instead of an absolute
URL, which was being treated as external. It also uses a typed
`/new/$slug` navigate.
- Read search params from `useParams()` instead of `location.search`
casts (`CronJobPage`, `QueuePage`, `LogsPreviewer`,
`LinkSupportTicketPage`, `MarketplaceSidebar`, `PlanCards`,
`SignUpForm`)
- Dropped the dead `isReady`/`isRouterReady` constants and the
`navigate<AnyRouter, string>` casts where typed routes work
(`ForgotPasswordWizard`, `SignInPartner`, `ReportWidget`,
`ProjectUpgradeAlert`)
- Linter, `ReportHeader` and `LogsPreviewer` use `to: '.'` instead of a
separate pathname subscription. `CreateReportModal` builds the preserved
query params in `onSuccess` instead of a `useMemo`.
- Tests use the shared `createTestRouter` and `customRender` router.
`LocalDropdown` now tests that the hash is kept.

Addresses
[FE-5109](https://linear.app/supabase/issue/FE-5109/replace-the-nextrouter-shims-with-tanstack-router-hooks)

## To test

- [x] Query Insights: select a query and confirm search/filter updates
keep selection while switching projects/routes clears it; navigating to
Logs keeps Logs' query params intact and pressing Back restores Query
Insights' `?search=` param cleanly
- [x] Auth / Sign-in flows: sign in, sign up, MFA, recovery code,
forgot/reset password, and partner sign-in preserve `returnTo` and
redirect as expected
- [x] Organization & Project flows: creating an org/project, accepting
an org invite, claiming a project, redeeming credits, and
deleting/pausing/restarting a project or branch navigate cleanly
- [ ] Logs & Reports: replica selector appears on supported log routes
(`LOG_ROUTES_WITH_REPLICA_SUPPORT`), saved log queries open, and custom
reports create/navigate properly
- [ ] Sidebar, LocalDropdown, UserDropdown, Integrations
(Cron/Queues/Marketplace), Advisors/Linter, and Unified Logs navigate
cleanly

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-12-01 14:53:27 +08:00
Coenen Benjamin 23424bec35 fix(studio): use Databow for Warehouse connections (#54147) 2026-11-27 10:50:10 +01:00
Coenen Benjamin aebdd909ce fix(studio): allow Warehouse table selection for empty publications (#54185) 2026-11-27 10:33:07 +01:00
Joshen Lim 434c00cb14 Joshenlim/fe 5196 move off scaffold components for remaining (#53911)
## Context

Final clean up of deprecated Scaffold components, just touches
- Account audit logs
- Project home page
- Database -> Column privileges
- Storage -> Analytics bucket details
- Storage -> Vector bucket details
- Settings -> Infrastructure -> Disk management
- Settings -> Infrastructure -> Read replica details
- Integrations -> Wrappers overview (Only for non supported integration
UI)
- Edge functions -> Empty state
- Auth -> Performance

Also replaces usage of `ScaffoldDivider` with just the `Separator`
component
And also adjusts the page container sizes of database pages from large
to default - these only have visual differences on viewport widths
larger than a laptop

Testing just needs a quick sweep of all these surfaces to make sure
nothing looks weird - will do so on my end too once the builds go
through!

For @supabase/security's review - review requirement was triggered as
`Documents.tsx` was updated in the organization settings page. But it
was just to change the Divider component 🙏
2026-11-26 21:28:17 +07:00
Alaister YoungandAlaister Young 01d4d4d430 [FE-5113] refactor(studio): replace next/dynamic shim with React.lazy (#54022)
## Problem

Now that Studio runs on TanStack Start, `apps/studio` still routes 13
`next/dynamic` imports through a local compatibility shim
(`apps/studio/compat/next/dynamic.tsx` aliased in
`apps/studio/vite.config.ts`). Keeping the shim adds unnecessary
indirection during the Next.js teardown (FE-5113).

## Solution

Replaces every `next/dynamic` import in `apps/studio` with `React.lazy`
+ `Suspense` (or static imports where already inside a lazy chunk), then
deletes `compat/next/dynamic.tsx` and its Vite alias.

None of the previously `ssr: false` call sites need `ClientOnly`: Studio
runs TanStack Start with `spa: { enabled: true }` and only prerenders
the signed-out auth routes (`/sign-in`, `/sign-up`, `/sign-in-sso`,
`/forgot-password`), `__root.tsx` gates `<Outlet />` behind
`canRenderPage`, and `StudioCommandMenu` is already gated by
`useCommandMenuInitiated()` (which starts `false` per render).

**Removed:**

- `apps/studio/compat/next/dynamic.tsx` and the `'next/dynamic'` entry
in `nextShims` in `apps/studio/vite.config.ts`

**Changed:**

- Migrated all `next/dynamic` call sites to `React.lazy` + `Suspense`:
- `StudioCommandMenu`, `ContextSearchResults`,
`Marketplace/OverviewTab`, `QueryDetail` (`SqlMonacoBlock`),
`SQLEditorEditorPanel` (`MonacoEditor`, `DiffEditor`),
`SupportAssistantSuccessCard`, `LayoutSidebarProvider`,
`MessageMarkdown` (`Streamdown`), and
`SupportAssistantSuccessCardContent` (`Streamdown`)
- `ConnectStepsSection`: hoisted the lazy component cache out of
`useMemo` to module scope (also clears its
`react/no-unstable-nested-components` warning)
- `Integrations.constants.tsx` and `useAvailableIntegrations.tsx`:
hoisted all lazy integration tab/page definitions (including
`GraphiQLTab`) to module scope so `navigate()` returns stable component
references, added `Suspense` boundaries with `<Loading />` at both
render points (`MarketplaceDetail` and the integration child route), and
keyed integration tab/creation sheet instances (`integration.id` in
`MarketplaceDetail` and `wrapperMeta.name` in `WrappersTab`) so state
cannot leak when switching between wrappers or OAuth integrations;
preserves `umdAmdShortCircuit`, `ssrStubGraphiql`, and
`graphiqlViteWorkers` in `vite.config.ts`
- Replaced `dynamic()` calls for `AiIconAnimation`, `Badge`, and 4
`icons` in `CreateCommands.tsx` with static imports (already inside the
lazy `CommandMenu` chunk)
- Removed the stale `next/dynamic` mention from the
`lib/chunk-load-error.ts` doc comment (`React.lazy` chunk failures
continue bubbling to the root `ErrorBoundary` reload handler)

**Added:**

- Reference-stability tests for `INTEGRATIONS.navigate` in
`Integrations.constants.test.ts` (running in Vitest's Node environment)

## Review instructions

1. Open the SQL Editor and Query Performance query detail panel, and
confirm the Monaco editor and diff view load cleanly.
2. Open the GraphQL integration's GraphiQL tab, and confirm the loading
skeleton displays while the chunk loads and GraphiQL mounts with working
autocomplete/workers.
3. Open a Wrapper integration's Wrappers tab, open the create sheet,
then navigate via history to a different wrapper's create sheet and
confirm the form resets to the new wrapper's defaults.
4. Open the Command Menu (`Cmd+K`), navigate to context search (for
example, Search Database Tables) and Create commands, and confirm icons,
badges, and search results load without flicker.
5. Open the Connect sheet and switch between frameworks/steps,
confirming step content loads with the skeleton fallback.
6. Toggle sidebars (AI Assistant, Inline SQL Editor, Advisor, Help) and
verify markdown streaming in AI Assistant.
7. Confirm CI passes `pnpm --filter studio run build` (including
prerendering and chunk-cycle checks), typecheck, lint ratchet, and
Studio tests.

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-11-26 08:46:55 +00:00
Alaister YoungandAlaister Young 87b9d0562e [FE-5111] refactor(studio): replace next/image shims with plain img (#54011)
Replaces all remaining `next/image` and `next/legacy/image` imports in
`apps/studio` with plain `<img>` elements and deletes both compat shims
and their Vite aliases (following #53906, which removed the last
`next/image` import from `packages/ui-patterns`).

**Changed:**

- Replaced 26 `next/image` and 3 `next/legacy/image` call sites across
`apps/studio` with plain `<img>` elements (every local `src` already
prepends `BASE_PATH` / `router.basePath`, and none used `loader`,
`priority`, `placeholder`, `quality`, or `onLoadingComplete`)
- Converted `fill` / `layout="fill"` usages in `IntegrationCard`,
`MarketplaceFeaturedHeroGrid`, `Integrations.constants`,
`useAvailableIntegrations`, and `IntegrationPanels` to Tailwind sizing
classes, and dropped no-op `layout="fixed"` props in `FormContents` and
`HookList`
- Replaced invalid `layout="fill" objectFit="cover"` props passed to
`next/image` in `HelpPanel` with `absolute inset-0 h-full w-full
object-cover`
- Cleaned up image accessibility across the touched call sites (accurate
alt text on feature preview screenshots and `HookList`, `alt=""` +
`aria-hidden="true"` on decorative icons/illustrations next to visible
labels)

**Removed:**

- `apps/studio/compat/next/image.tsx`
- `apps/studio/compat/next/legacy/image.tsx`
- `'next/image'` and `'next/legacy/image'` aliases from
`apps/studio/vite.config.ts`

## To test

- Confirm `git grep -E "next/(legacy/)?image" apps/studio/` has no
remaining imports
- Check images render as expected across the updated surfaces:
- **Integrations marketplace** (`/project/_/integrations`): featured
hero covers (`MarketplaceFeaturedHeroGrid`), integration icons in cards,
sidebar, and wrapper rows (`Integrations.constants`,
`useAvailableIntegrations`)
  - **Help panel**: Discord card background illustration
- **Account & settings**: Account Connections GitHub icon, Add-ons cards
(IPv4 / PITR / Custom Domain), Spend Cap card & side panel, user profile
avatars (`ProfileImage`), and Feature Previews modal images
- **Database Webhooks** (`FormContents`, `HookList`) and Third-Party
Auth provider dropdown/cards

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-11-26 16:23:41 +08:00
623d08c7ff changing pgmq repo address to current repo (#38921)
## 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?

docs update
## What is the current behavior?

referenced old pgmq repo from tembo

## What is the new behavior?

now points to [pgmq](https://github.com/pgmq/pgmq)

---------

Co-authored-by: hallidayo <22655069+Hallidayo@users.noreply.github.com>
Co-authored-by: Nik Richers <nrichers@gmail.com>
2026-11-23 13:20:26 +00:00
Joshen Lim c9a25cf11f Joshenlim/fe 5172 deprecate old table component (#53728)
## Context

More housekeeping - deprecates the old Table component in favor of the
Table component under `ui`

JFYI also realised as part of this that the following 2 routes are
unreachable from the dashboard and hence am opting to deprecate them
with a redirect
- /logs/explorer/recent
- /logs/explorer/saved

## Areas affected to check
- [ ] Integrations -> Webhooks
<img width="600" alt="image"
src="https://github.com/user-attachments/assets/58523cdb-6219-49be-9d2f-5bc26ae03d7f"
/>
- [ ] Database -> Column Privileges
<img width="600" alt="image"
src="https://github.com/user-attachments/assets/98bea654-24ac-4646-9c65-5bc4f18565e9"
/>
- [ ] Observability -> API  
<img width="600" alt="image"
src="https://github.com/user-attachments/assets/a6512c6f-bd04-4d25-8e3c-99c85883434a"
/>
- [ ] Observability -> Storage
  - Its a table under "Request caching" which I don't have data for 😅 🙏 
- [ ] Observability -> Database
<img width="600" alt="image"
src="https://github.com/user-attachments/assets/4f0ba203-64b3-41f7-971e-974e232bdedd"
/>
- [ ] Table Editor -> Project API Docs -> Column list
<img width="600" alt="image"
src="https://github.com/user-attachments/assets/6358e7a8-5770-46f9-a5a2-4851855ae97f"
/>
- [ ] Table Editor -> Project API Docs -> RPC parameters list
<img width="600" alt="image"
src="https://github.com/user-attachments/assets/5e45a1d6-cd29-451c-bf00-5d806ef37cec"
/>
2026-11-23 10:59:28 +07:00
Danny WhiteandJoshen Lim 0ce2a96c53 feat(studio): show Warehouse workload on the integration overview (#53575)
## Problem

The Warehouse integration overview shows replication status but gives no
view of query activity.

## Solution

Add last-hour query rate and p95 duration charts, with refresh and a
link to Observability. Metrics failures appear beside the replication
information.

| Before | After |
| --- | --- |
| <img width="1292" height="1288" alt="CleanShot 2026-11-18 at 13 44
48@2x"
src="https://github.com/user-attachments/assets/f06314bb-8322-448b-a86b-6821a3427a52"
/> | <img width="1314" height="1930" alt="CleanShot 2026-11-18 at 13 45
10@2x"
src="https://github.com/user-attachments/assets/0cbaab85-b7bb-445d-8547-3c772010a0d1"
/> |
| _No “Workload” section._ | _A new “Workload” section._ |

Depends on #53574.

## Review instructions

1. Open the [Studio staging
preview](https://studio-staging-git-dnywh-warehouse-overview-workload-supabase.vercel.app)
with a staging project that has Warehouse configured.
2. Go to **Integrations > Warehouse > Overview**. Check the **Workload**
charts below replication status.
3. Refresh the charts, then use **Observability** to open the full
report.
4. Check a period without query activity. The empty message should name
the last 60 minutes.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-11-20 15:46:03 +11:00
Drew McLellan 9aed3bcb6e fix(studio): load more query performance rows when the grid isn't scrollable (#53457)
## Problem

On the Query Performance page, more rows only load when the grid fires a
scroll event. The first page is 20 rows at 44px each, so on a tall
viewport the rows don't overflow the grid. The user can't scroll, and
the remaining rows never load. Zooming in works around it. The same dead
end happens whenever a client-side filter leaves too few loaded rows to
fill the grid.

Fixes part of FE-5092. The `calls >= N` filter returning no results is a
separate cause and will follow in its own PR.

## Solution

`useInfiniteScroll` now takes an optional `containerRef` (the `DataGrid`
ref) and `rowCount`. When the ref is passed, the hook also requests the
next page whenever the grid's content doesn't overflow its container and
there is another page, and it re-checks when the container resizes.
Existing callers that don't pass it behave as before.

The three `react-data-grid` consumers of the hook share the same dead
end, so all three now pass the ref: Query Performance, Cron Jobs and
Cron Job runs. For Query Performance, the hook call moved from
`WithStatements` into `QueryPerformanceGrid`, which owns the grid ref.

## Review instructions

1. Open Observability → Query Performance on a project with more than 20
statements.
2. Make the browser window tall (or zoom out) so 20 rows don't fill the
grid.
3. Confirm more rows load automatically until the grid scrolls, and that
scrolling to the bottom still loads further pages.
4. Resize the window taller and confirm more rows load.
5. Repeat on Integrations → Cron (the jobs list and a job's previous
runs) if the project has enough jobs or runs to need more than one page.

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-11-17 15:15:33 +00:00
Danny White 1ddfdfc7bb fix(studio): prevent Warehouse connection status extending page height (#53442)
## Problem

The Warehouse overview can acquire extra document height, allowing the
header and sidebars to move when scrolling past the content. The
connection card’s absolutely positioned screen-reader status has no
local containing block in the default card layout.

| Before |
| --- |
| <img width="1187" height="1034" alt="Integrations
warehouse-cuf-browser-20261028 ETL Staging Supabase"
src="https://github.com/user-attachments/assets/6bf0279d-c644-4834-9a6d-f6b634037b72"
/> |
| _Note the entire bottom area has shifted up, including sidebar
contents._ |

## Solution

Position the connection card relatively in both layouts, keeping the
live status announcement inside its card. This fixes the source without
changing root layouts or scroll containment.

## Review instructions

1. Open **Integrations > Warehouse > Overview** on a configured project
such as [this
one](https://supabase.green/dashboard/project/yirnfrgkxmnqgexikhfc/integrations/warehouse/overview).
2. Scroll past the bottom. Only the content pane should scroll; the
header and sidebars should stay in place.
3. Check connection details still work in the Connect sheet.
2026-11-16 18:58:36 +11:00
Joshen Lim 8f3f680d73 Use NoSearchResults for no search results in integrations (#53354)
## Context

Just swaps out to use `NoSearchResult` for empty search state in project
integrations for consistency

### Before
<img width="1146" height="422" alt="image"
src="https://github.com/user-attachments/assets/d66c1714-be55-4cbf-9de1-f5c8a2464649"
/>


### After
<img width="1145" height="333" alt="image"
src="https://github.com/user-attachments/assets/761624f4-f827-41d7-bd53-d6bcb11df4f8"
/>
2026-11-13 17:50:14 +07:00
Charis ed6d1b4c63 feat(studio): show error details in AlertError and attribute user faults in SQL errors (#53242)
## Problem

`AlertError` gives users and support no way to correlate a failure with
Sentry or platform logs. It also treats every failure the same: a bad
table editor filter or an offline browser gets "try refreshing, contact
support".

On the reporting side, SQL errors were attributed by who wrote the whole
statement. That made errors in the user's part of mixed SQL Studio's
fault: policy expressions, function bodies, cron schedules, table editor
filters and row edits. Marking them as user SQL instead would drop them
from Sentry entirely.

Part of FE-4772.

## Solution

**`AlertError`**
- Platform and Studio faults show the request ID, the Sentry event ID
(labeled "before sampling", since the event may be sampled out) and a
"Copy details" button.
- The copied text never includes `formattedError`, metadata, the cause
or SQL.
- SQL errors copy the SQLSTATE, position and query name instead of the
message.
- User faults (`isUserError`) show their message with "Please try again.
If the issue persists, try refreshing your browser." There is no support
link, no IDs and no copy button.
- Offline shows only "You may be temporarily offline. Check your
internet connection and try again."
- Defaults come from `getErrorPresentation`, and props the caller passes
still win. The table editor passes a filter-specific description when
filters are set.

**SQL error classification**
- `executeSql` takes an optional `isUserFaultSqlState` predicate for
Studio SQL. When it matches, the error is a `StudioSqlError` with reason
`user_input` and fault `user`, and is still redacted to SQLSTATE plus
query name.
- `isUserFaultForValues` (classes 22, 23 and P0, plus 42501 and 57014)
is for typed values: table editor filters and row edits, cron name and
schedule.
- `isUserFaultForSql` (any SQLSTATE except server classes 08, 53, 57
other than 57014, 58 and XX) is for embedded user SQL: policies,
functions, the custom access token hook.
- `isUserFaultForStatsStatement` is for `pg_stat_statements` text (Query
Insights `EXPLAIN`, index advisor). It treats 42P02 (`$1` placeholders)
as Studio's fault.
- `UserSqlError` is now only SQL the user wrote in full, and it is still
never sent.
- The policy, function and cron mutation hooks no longer take
`sqlOrigin`.

**Routing and types**
- `ERROR_ROUTING` is one table keyed by tag, then by fault. Its type
requires exactly the faults each class can produce.
- User faults get `SAMPLE_USER_FAULT` (default 0.01, set with
`NEXT_PUBLIC_SENTRY_SAMPLE_RATE_USER_FAULT`) to catch misclassification.
- The error class decides privacy (`isNeverReportedError`), separately
from the rate.
- Sentry events get a `reason` tag.
- Each class declares its `reasons`, so a mistyped reason fails
typecheck.

## Review instructions

1. Open the table editor, add a filter with a wrong-typed value (text on
an integer column). The alert shows the Postgres error, the filter hint,
and no support link, IDs or copy button.
2. Make a query fail with a platform error (e.g. block a `/platform/`
request in DevTools). The alert shows the request ID, the event ID and
"Copy details". Paste the copied text and check it has no SQL or
`formattedError`.
3. Go offline in DevTools and trigger a query. Only the offline message
shows.
4. Create a policy with an invalid `USING` expression. The toast shows
the Postgres error. In Sentry it is a `StudioSqlError` with reason
`user_input`, sampled at the user-fault rate.
5. Review `lib/errors/error-routing.ts` and
`data/error-classification.ts` for the routing table and the SQLSTATE
predicates.
2026-11-12 15:19:25 -05:00
Charis 115a2ffeef feat(studio): gate database functions, triggers, and webhooks on sql grants (#53269)
Resolves FE-4744. Part of the grants rollout; builds on the read/write
SQL variants from #53185.

## What

- **Data layer:** the database functions, triggers, database webhooks,
and event triggers queries now take a `read` grant (exposed as
`queryOptions` factories). All 8 create/update/delete mutations take a
`write` grant and mark their SQL with `asWriteSql`.
- **Guards:** the hand-written FGA checks in the functions, triggers,
event triggers, and database webhooks lists, the functions page, the
triggers layout/route, and the webhooks integration tab now derive from
grants, with denied and error states.
- **Other consumers** updated to pass grants: `CreateFunction`,
`TriggerSheet`, `EditHookPanel`, `DeleteHookModal`,
`ChooseFunctionForm`, `FunctionSelector`, `AutoEnableRLSNotice`, and SQL
editor definition/autocomplete hooks.

## Behavior changes

- **Webhooks integration tab:** was gated on
`database_webhooks_config_read`; now gated on `database_read`, which is
what the backend checks for the pg-meta query it uses. Both permissions
are granted to the same built-in roles, so there is no change for
built-in roles. A permissions-load failure now shows an error alert
instead of the content.
- **`AutoEnableRLSNotice`:** hidden unless the user has read access,
since it can't tell whether the trigger already exists without it.

## Out of scope

- User-authored SQL execution in `QueryEditor` / `useSqlEditorExecution`
stays `unguarded.migrating` (FE-4750).

## Testing

- New tests: query factories and write mutations
(`data/database-sql-grants.test.ts`), webhooks tab granted/denied/error,
functions list read/write granted/denied/error.
- Typecheck, Prettier, lint ratchet, and Studio vitest suites for
affected areas pass.
2026-11-12 14:58:01 -05:00
Danny White c9d8a17b75 fix(studio): align integration navigation and remove duplicate status (#53301)
## Problem

Integration pages repeat the Installed state in the breadcrumb and
action button. Their sidebar spacing also differs from other Studio
product menus below the extra-large breakpoint.

## Solution

Remove the breadcrumb badge and retain the action button. Match the
shared product menu spacing: 12 px inside items, with a 12 px outer
inset from the medium breakpoint upwards.

| Before | After |
| --- | --- |
| <img width="608" height="706" alt="CleanShot 2026-11-12 at 17 29
29@2x"
src="https://github.com/user-attachments/assets/e6954807-2509-4310-a9ae-f12e0b5a4e17"
/> | <img width="608" height="698" alt="CleanShot 2026-11-12 at 17 35
15@2x"
src="https://github.com/user-attachments/assets/736cb935-5df2-49c6-ac02-789a19a3f2ec"
/> |
| <img width="1448" height="274" alt="CleanShot 2026-11-12 at 17 40
08@2x"
src="https://github.com/user-attachments/assets/4ae20a2d-69e4-488e-9fb8-7790478c209b"
/> | <img width="1446" height="284" alt="CleanShot 2026-11-12 at 17 40
34@2x"
src="https://github.com/user-attachments/assets/f5758095-da1b-4134-8742-8d40f2d8f9bc"
/> |

## Review instructions

1. Open **Integrations** and an installed integration such as Data API.
Check that Installed appears only in the action button.
2. Resize across the medium and extra-large breakpoints. Compare the
sidebar alignment with Database, including the mobile menu.
2026-11-12 17:49:00 +11:00
Charis 395a54f2b7 feat(studio): gate jwt signing keys, legacy api keys, and third-party auth on grants (#53241)
Resolves
[FE-4732](https://linear.app/supabase/issue/FE-4732/grants-rollout-jwt-signing-keys-legacy-api-keys-and-third-party-auth).

## Changes
Gates the JWT signing keys, legacy API keys, and third-party auth
endpoints on grants instead of `unguarded.migrating`, and replaces their
V2 permission guards with `useGrant`:
- **Data layer (11 sites):** `data/jwt-signing-keys/*`,
`data/api-keys/legacy-api-keys-status-query`,
`data/api-keys/legacy-api-key-toggle-mutation`, and
`data/third-party-auth/*`. Queries become grant-gated query option
factories; mutations take the grant in their variables.
- **Consumers:** the JWT settings page, the JWT signing keys table and
its dialogs, `jwt-settings`, `ToggleLegacyApiKeys`, `Project/APIKeys`,
and the third-party auth page, form, and create dialogs. Each consumer
renders denied and error states.
- **JWT signing keys table:**
- It's gated only on the signing keys reads (`GET signing-keys` and `GET
signing-keys/legacy`, both `auth_signing_keys_read`).
- The legacy API keys status is only used by the revoke dialogs. If it
can't be read, revoking the legacy JWT secret fails closed: the user
sees the "disable legacy API keys first" warning, with copy explaining
why, instead of the confirm modal.
- **Legacy JWT secret query:** a 404 (secret not imported as a signing
key yet) resolves to `null` and shows the "Migrate JWT secret" panel.
Other errors now render an error instead of being treated as "not
migrated".
- **Write actions:**
- `getWriteGrantTooltip` moves from `APIKeys.utils` to `lib/grants` and
takes a resource noun. Disabled write actions use it to explain why
they're disabled.
- New `getWriteGrantToastMessage`: handlers that run without a grant now
show a toast instead of silently doing nothing. This includes the API
keys handlers from #52966.

## Permission changes
- **Legacy API keys toggle and status** (`GET`/`PUT
/v1/projects/{ref}/api-keys/legacy`): the guard moves from
`auth_signing_keys_read`/`_write` to the endpoint annotation,
`api_gateway_keys_read`/`_write`. The annotation was confirmed against
the backend controller (FE-4728). As a result, the JWT signing keys
table's legacy revoke check now depends on `api_gateway_keys_read`.
- **API keys last-used analytics**
(`/platform/projects/{ref}/analytics/endpoints/api_keys.last_used.otel`):
this endpoint uses legacy permissions (`analytics:Read` on `logflare`),
not FGA. Its check moves from the V2 `auth_signing_keys_read` check to
`useAsyncCheckPermissions(PermissionAction.ANALYTICS_READ, 'logflare')`.
- Every other guard already matched its annotation:
  - `auth_signing_keys_read`/`_write` for signing keys
  - `auth_config_read`/`_write` for third-party auth

## Testing
- Data layer: `jwt-signing-keys.test.ts`, `legacy-api-keys.test.ts`, and
`third-party-auth.test.ts` cover every migrated fetcher, check that
factories stay disabled without a grant, and cover legacy-key 404 vs.
500.
- `jwt-secret-keys-table/index.platform.test.tsx`:
- Legacy status denied: the table still renders, and revoking the legacy
key shows only the warning.
  - Legacy status known enabled or disabled.
  - Signing keys read denied.
  - Legacy key 404 vs. 500.
- `create-key-dialog.platform.test.tsx`: triggering create without a
grant shows the toast and sends no request.
- `ToggleLegacyApiKeys.platform.test.tsx`,
`ThirdPartyAuthForm.platform.test.tsx`, and
`settings/jwt/index.platform.test.tsx`: granted, denied, error, and
partial-permission cases.
- `lib/grants.test.ts`: the tooltip and toast helpers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-11-10 15:30:58 -05:00
Charis 121de3dff7 feat(studio): gate api key create and delete on endpoint grants (#52966)
Part 6 of 6 in a stack for
[FE-4731](https://linear.app/supabase/issue/FE-4731/grants-rollout-api-keys-consumers-that-only-need-publishable-keys).
Based on #52965.

## Stack
1. #52961 Docs and project API docs consumers
2. #52962 Edge functions and vector bucket examples
3. #52963 Integrations landing data
4. #52964 Connect sheet and project connection popover; remove the
transitional api-keys hooks
5. #52965 `reveal` refinement for single api-key reads; API key pill
6. 👉 #52966 API key create and delete

## Changes
Gates the api-key write endpoints (both require
`api_gateway_keys_write`) on grants instead of `unguarded.migrating`:
- `api-key-create-mutation` and `api-key-delete-mutation` take the grant
in their variables.
- `APIKeyDeleteDialog` uses the `DELETE` grant instead of its V2 check,
and is disabled with a tooltip when denied or errored. `SecretAPIKeys`
and `PublishableAPIKeys` pass the grant to the mutation.
- `CreateNewAPIKeysButton` and the create publishable and secret key
dialogs mint the `POST` grant. Their triggers and submit buttons are
disabled with a tooltip unless granted.
- `useConnectedResourceMutations`: the api-key delete call takes the
grant. Without it, the mutation shows an error toast and throws.

**New guard:** creating API keys had no UI guard. Users without
`api_gateway_keys_write` could open the dialogs and get a 403; the
controls are now disabled for them. The delete guard already matched the
annotation.

Out of scope: the legacy API key toggle and status (FE-4732).

## Testing
- `CreateAPIKeyDialogs.platform.test.tsx` (renamed from
`CreateAPIKeyDialogs.test.tsx`, the mutation mock removed): denied and
permission-check error disable the triggers and the submit button.
- `APIKeyDeleteDialog.platform.test.tsx`: granted, denied, and
permission-check error.
- `data/api-keys/api-key-write-mutations.test.ts`: create and delete
send their requests with a grant.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-11-10 14:01:40 +00:00
supabase-vercel-tedd[bot] 5f77aa07ea fix(studio): keep a cron job's stored command when opening the editor (#53172)
## Problem

The cron job editor could rewrite a job's SQL just by opening it, and
the result depended on how the editor was opened:

- Opened from the jobs list ("..." menu > Edit), the sheet is already
mounted with an empty job. Opening it resets the form to the parsed
values, which re-runs the effect that rebuilds `values.snippet` from the
form fields. The stored command gets replaced by a regenerated one.
- Opened from the job's own page, the sheet mounts with the job, so the
fields don't change on open and the stored command is kept.

The regenerated command is lossy for `net.http_*` calls the HTTP form
can't represent. For example, a header value such as `'Bearer ' ||
(select decrypted_secret from vault.decrypted_secrets ...)` turned into
a literal JSON string, and a chained `|| jsonb_build_object(...)` was
dropped. Saving would silently overwrite a working job.

## Solution

- `parseCronJobCommand` now checks that a `net.http_get` /
`net.http_post` command can be represented by the HTTP form before
parsing it into fields. It needs named arguments only (`url`, `headers`,
`body`, `timeout_milliseconds`), literal values (headers may also be a
single `jsonb_build_object` of literals), and nothing after the call
besides `;`. Anything else (SQL expressions, `||` concatenation, unknown
arguments such as `params`, extra statements) opens as a SQL snippet
with the stored command unchanged. The argument splitter used for
`jsonb_build_object` is generalised and reused for this check.
- `CreateCronJobSheet` keeps the stored command while the form fields
still describe it. It compares the command built from the current fields
with the one built from the parsed stored values. The SQL is regenerated
only after a field actually changes, so both ways of opening the editor
behave the same.

## How to verify

On a project with `pg_cron` and `pg_net` enabled, create a cron job (via
the SQL editor) whose command is a `net.http_post` with headers that use
a SQL expression, for example:

```sql
select cron.schedule('expr-headers', '*/5 * * * *', $$
select net.http_post(
  url:='https://example.com/hook',
  headers:=jsonb_build_object('Authorization', 'Bearer ' || (select current_user)) || jsonb_build_object('x-fired-at', to_char(now(), 'YYYY')),
  body:='{}'::jsonb,
  timeout_milliseconds:=5000
);
$$);
```

- Integrations > Cron > Jobs, "..." menu on the job > Edit: the editor
opens as a SQL snippet showing exactly the stored command.
- Click the job row to open its page, then Edit: the editor shows the
same command.
- Edit a simple HTTP job (literal URL and headers) from both places: it
opens in the HTTP request / Edge Function form, and the SQL preview
equals the stored command until a field is changed.
- Change a header value in that simple job: the SQL preview updates to
reflect the change.

Checks run: `vitest run components/interfaces/Integrations/CronJobs`
(new fallback cases in `CronJobs.utils.test.ts`), `pnpm turbo run
typecheck --filter='...[origin/master]'`, eslint and prettier on the
changed files.


[FE-4980](https://linear.app/supabase/issue/FE-4980/fix-cron-job-editor-serialization-different-sql-generated-for-menu-vs)

---------

Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com>
2026-11-10 07:07:34 -06:00
Charis c0e92057a6 feat(studio): split SQL errors into user and Studio SQL (#53059)
Part of FE-4772.

## Why

Errors from the pg-meta query endpoint didn't say who wrote the SQL, so
a Sentry issue like SUPABASE-APP-KXE couldn't tell a user's query from
one Studio composed. That event came from the assistant's `execute_sql`
tool and was captured by the Vercel AI integration on the server, so it
skipped `reportStudioError` and had no fault tags. The Postgres message
also went to Sentry as-is, and it can contain user SQL and data.

## What

- **`sqlOrigin` is required on `executeSql`.** `'user'` covers SQL the
user or an AI agent wrote, in whole or in part: SQL editor, editor
panel, Explorer, AI `execute_sql` and `run_notebook`, report blocks,
Query Insights EXPLAIN, the policy, function, and cron editors, and
running a stored cron job. Everything else is `'studio'`. The policy,
function, and cron mutation hooks and `useDbQuery` take `sqlOrigin` too.
- **`classifySqlResponseError`** turns a 400 from the query endpoint
into `UserSqlError` (`user`, `user_sql`) or `StudioSqlError` (`studio`,
`studio_sql`). Pattern rules (connection timeouts) and other statuses
keep their classes.
- **`UserSqlError` never reaches Sentry.** Its routing is
`SAMPLE_NEVER`, `alwaysCapture` doesn't override it, and `beforeSend`
drops it.
- **`StudioSqlError` is redacted.** Error classes can set
`sentryMessage`; for `StudioSqlError` it is the SQLSTATE and the query's
`queryName`, a static name that `executeSql` requires for Studio SQL.
The query key is never reported, since its segments can hold IDs,
schemas, and search terms. `applyStudioErrorPolicy` applies it from
`beforeSend` on the client and the server, so it holds however the error
was captured. The server config gets a `beforeSend` for this. Events get
`query_name` and `sql_state` tags and are grouped by both, since every
SQL error shares the `executeSql` stack.
- **A custom `handleError` gets the classified error**, matching its
declared type. The SQL editor, editor panel, and policy editor rethrow
it, so their errors are now `UserSqlError` instead of being reported as
`UnexpectedError`. The error keeps Postgres's `position` for the
editor's line highlight.

The error message, `formattedError`, and `position` stay on the error
for the UI. The query-performance Sentry context no longer carries the
raw error message, which bypassed redaction.

## Known gaps

- Index advisor queries run users' query text from `pg_stat_statements`
but are marked `'studio'`. Redaction keeps the text out of Sentry, but
their failures count as Studio faults.
- 5xx responses for user SQL are still `PlatformError` and keep their
message.
- The self-hosted MCP `executeSql` calls `executeQuery` directly and
isn't covered.

## Testing

- Unit tests for `classifySqlResponseError`, `applyStudioErrorPolicy`,
and the client `beforeSend`.
- Full Studio vitest suite passes except `useReportDateRange.test.ts`
(169 vs 168 hourly buckets across the DST change), which this PR doesn't
touch.
2026-11-09 09:47:35 -05:00
Charis 597d1ce56e fix(studio): pass caller options to grant-gated query factories (#53088)
## Context

Grant-gated query factories returned `queryFn: skipToken` when the
caller had no grant. TanStack Query keeps one options object per cache
entry, overwritten by whichever observer rendered last. When that was a
grant-less observer, invalidation refetched with `skipToken` and failed
with `Missing queryFn`, breaking the query for every other observer on
the key. #53075 patched two call sites; this fixes the factories.

## Changes

- New `grantedQueryOptions` helper (`data/granted-query-options.ts`).
Without a grant, the factory sets `queryFn: undefined` instead of
`skipToken`, so TanStack borrows the query function from a subscribed
observer that has one. The caller's `enabled` applies only when the
factory has a query function.
- `apiKeysQueryOptions`, `revealedApiKeysQueryOptions`,
`branchesQueryOptions`, `branchQueryOptions` and
`branchDiffQueryOptions` take caller options as a second argument. Call
sites change from `useQuery({ ...f(vars), enabled })` to
`useQuery(f(vars, { enabled }))`, so callers can't override the grant
gate.
- New type-aware `fga/no-spread-granted-query-options` lint rule
(error). `grantedQueryOptions` returns a type-only brand, and the rule
flags any spread or `Object.assign` of a branded value, however it was
built or named.
- Restores typed linting as a separate pass
(`eslint.type-checks.config.cjs`, run by `pnpm lint` via
`lint:type-checks`), as #44678 did. Enabling type info in the main
config changes what other plugins report, so it stays separate.
- `studio-queries` skill documents the pattern.

Callers still pass their own grant, so the UI gates on the same grant
the request carries.

## Testing

- `data/api-keys/api-keys-query.test.tsx`: a granted and a grant-less
component share the key, with the grant-less one rendering last;
invalidation via the delete mutation refetches successfully. Fails on
master with `Missing queryFn`.
- `data/granted-query-options.test.ts`: `enabled` gating, factory fields
win over caller fields, `select` type inference.
- Lint rule cases in `scripts/__tests__/fga-eslint-rules.test.ts`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-11-06 11:04:00 -05:00
Anthony Lio 1fb63b7d85 fix(ui): lift tooltip from the page and use a ring edge (#52631)
## Problem

- tooltips blend into the page in dark mode, for example the timestamp
tooltip in the logs table
- the tooltip background is `bg-alternative`, which is the same color as
the page background

## Solution

- changes the tooltip background in dark mode, so the tooltip is one
elevation step above the page
- replaces the border and the drop shadow with a 1px ring from the
`foreground` token, so the edge is thinner and uses theme tokens
- changes the row highlight in the timestamp tooltip
- fixes the "Copied!" state in the timestamp tooltip, so the copied
value does not show behind the text and the row keeps its width

| before | after |
| -------|------|
| <img width="357" height="162" alt="image"
src="https://github.com/user-attachments/assets/07435a9e-74eb-4007-aa5e-d350a979f8bb"
/> | <img width="357" height="162" alt="image"
src="https://github.com/user-attachments/assets/df274062-318e-4ed0-841a-2bf57c98ec4c"
/> |
| <img width="357" height="162" alt="image"
src="https://github.com/user-attachments/assets/1cfc18fa-196e-41e2-9aae-2458cd98418b"
/> | <img width="357" height="162" alt="image"
src="https://github.com/user-attachments/assets/c116329c-233c-4216-9a71-4a1950ec710a"
/> |

<!--
## Preview links

If relevant, include links to changed pages for easy review access.

Copy the preview base URL from the Vercel bot comment on this PR. Use
the following table as an example template.

| Site | Live | Preview | Search for |
| -------------- |
-------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------
| ----------------------------- |
| WWW | [/blog/your-post](https://supabase.com/blog/your-post) |
[/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post)
| unique phrase from the change |
| Docs |
[/docs/guides/your-page](https://supabase.com/docs/guides/your-page) |
[/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page)
| unique phrase from the change |
| Studio | [/dashboard](https://supabase.com/dashboard) |
[/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard)
| unique phrase from the change |
| Design system | [/design-system](https://supabase.com/design-system) |
[/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system)
| unique phrase from the change |
| UI library | [/library](https://supabase.com/library) |
[/library](https://ui-library-git-branch-name-supabase.vercel.app/library)
| unique phrase from the change |
| Knowledge base |
[/kb/guides/your-page](https://supabase.com/kb/guides/your-page) |
[/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page)
| unique phrase from the change |
-->

<!-- ## Additional context

Optionally add any other context or screenshots.

-->

## Review instructions


1. open
[/design-system/docs/components/tooltip](https://design-system-git-antlio-tooltip-contrast-supabase.vercel.app/design-system/docs/components/tooltip)
and set the theme to dark
2. hover the "Hover" button, and make sure that the tooltip is lighter
than the page and has a thin ring edge
3. set the theme to light, and make sure that the tooltip has a thin
ring edge and no drop shadow
4. open
[/dashboard/project/_/logs/edge-logs](https://studio-git-antlio-tooltip-contrast-supabase.vercel.app/dashboard/project/_/logs/edge-logs)
in dark mode and select a project
5. hover a date in the logs table, and make sure that the tooltip is
lighter than the table
6. hover each row in the tooltip, and make sure that the row highlight
shows
7. click a row, and make sure that "Copied!" shows with no value text
behind it and the tooltip width does not change

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-11-05 17:59:15 +02:00
Joshen Lim 6d08d66b7d Add eslint rule for google translate dynamic spans + address all issues (#52949)
## Context

We've been seeing many `NotFoundError: Failed to execute 'removeChild'
on 'Node'` and `NotFoundError: Failed to execute 'insertBefore' on
'Node'` events on Sentry which are historically known to be caused by
Google Translate in the browser.

There's technically no _right way_ to address this unfortunately, but
one of the solutions which should address most of these issues is to
wrap any dynamic text within a span - we've considered that quite a
while back tbh but never took the time to do this until today with the
help of Claude. Although just a heads up that it might not necessarily
completely eradicate those issues.

Also added an eslint rule which should prevent future occurences of this
<img width="1264" height="192" alt="image"
src="https://github.com/user-attachments/assets/b2c32ea0-45a2-4ccd-82fe-1a859905fc29"
/>
2026-11-05 23:28:46 +08:00
Charis 57a5087579 feat(studio): gate integrations landing api-keys query on grants (#52963)
Part 3 of 6 in a stack for
[FE-4731](https://linear.app/supabase/issue/FE-4731/grants-rollout-api-keys-consumers-that-only-need-publishable-keys)..

## Stack
1. #52961 Docs and project API docs consumers
2. #52962 Edge functions and vector bucket examples
3. 👉 #52963 Integrations landing data
4. #52964 Connect sheet and project connection popover; remove the
transitional api-keys hooks
5. #52965 `reveal` refinement for single api-key reads; API key pill
6. #52966 API key create and delete

## Changes
`useProjectOAuthIntegrationData`
(`Integrations/Landing/Landing.utils.ts`) read api-keys through the
transitional hook with no guard. It now takes a plain `GET
/v1/projects/{ref}/api-keys` grant.

A query skipped by `skipToken` stays pending forever, so a small helper
folds the grant into the api-keys query state:
- loading grant: pending
- denied: settles with no keys and no error, matching how a 403 was
treated before (no request is sent)
- permission-check error: surfaced as the hook's error

## Testing
- `Landing.utils.platform.test.tsx`: granted, denied (settles, no
request, no error), and permission-check error.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-11-05 06:48:49 -05:00
Charis b3dd6612d7 feat(studio): classify errors with fault, reason, and per-tag Sentry sampling (#52730)
Follows #52707 (rename `ResponseError` to `StudioError`).

Resolves FE-4772.

## What

Introduces the error core for Studio error classification.

- **Tagged errors.** `lib/errors/studio-errors.ts` defines
`Data.TaggedError` classes (`RequestAborted`, `NetworkUnreachable`,
`MalformedResponse`, `PlatformError`, `UnclassifiedApiError`,
`DbConnectionTimeout`, `UnexpectedError`). Each carries `fault`,
`reason`, `classifiedBy` (`rule` or `default`), `retryable`, and
`service`. `StudioError` is the union type; use `isStudioError` instead
of `instanceof`.
- **Two classifiers** in `data/error-classification.ts`:
- `classifyResponseError` is only for errors from an API response: known
message patterns first, then defaults by status (5xx `PlatformError`,
4xx `UnclassifiedApiError`, no status `UnexpectedError`).
- `classifyError` is for everything else: aborts, browser fetch failures
(matched by message, so ordinary `TypeError` bugs stay
`UnexpectedError`), and unexpected errors.
- `handleError` picks between them, reports, and rethrows the same
instance so React Query receives the classified error.
- **Routing and sampling.** `lib/errors/error-routing.ts` maps every tag
to a Sentry sample rate (`SAMPLE_NEVER`, `SAMPLE_OTHER`, `SAMPLE_OWNED`,
`SAMPLE_ALWAYS`). `reportStudioError` tags events with `sample_rate`,
and `beforeSend` applies it. `alwaysCapture` reports at rate 1. The
global Sentry error `sampleRate` stays unset so the rates don't
multiply.
- **Network failures.** A fetch failure is a `user` fault with reason
`offline` when the browser reports being offline, and a `platform` fault
otherwise.
- **Hand-built errors.** Call sites that wrapped caught exceptions or
made up status codes now use `classifyError` or a specific class instead
of `classifyResponseError`.

## Behavior changes

- Errors that previously went unreported, including unexpected errors
with a message, are now reported to Sentry at their routed sample rate.
- `handleError` no longer logs the stack with `console.error`.
- `MalformedResponse` is defined but not produced yet; a follow-up adds
the empty-body check.

## Testing

- Unit tests for classification, routing, reporting, and the
`beforeSend` sampling helper.
- `pnpm vitest run data lib components/interfaces/ErrorHandling`,
typecheck, lint ratchet, and knip pass locally.
2026-11-04 13:19:01 -05:00
CharisandClaude bef73a722c feat(studio): gate storage, cron, and realtime key consumers on grants (#52728)
Part 4 of 4 in a stack for
[FE-4694](https://linear.app/supabase/issue/FE-4694/pilot-split-api-keys-queries-and-add-first-refinement-reveal-variant).
Based on #52727.

## Stack
1. #52723 Reveal refinement and split api-keys queries
2. #52724 API keys settings UI and command menu
3. #52727 Database and edge functions consumers that reveal secret keys
4. 👉 Storage, cron, and Realtime consumers; remove the transitional
reveal path

## Changes
Moves the remaining consumers that need secret keys onto the `reveal`
grant with `revealedApiKeysQueryOptions`, replacing their V2 permission
checks:
- Analytics bucket configuration details and the update catalog token
dialog
- The Iceberg wrapper create mutation. Its V2 check only covered
`api_gateway_keys_secret_read`, which didn't match the endpoint's
requirement. Without keys it used to save a placeholder as the vault
token; it now throws unless the grant is granted, and returns the grant
so callers can explain why. The bucket create form disables Create and
the missing-wrapper callout disables "Install wrapper", both showing
`ApiKeysAccessNote`. The `storage_config_write` check is unchanged.
- Cron job HTTP headers (edge function variant)

`RealtimeTokensPopover` only reads the anon and publishable keys, so it
moves to the plain grant and `apiKeysQueryOptions` instead of requesting
revealed keys.

With no `reveal: true` callers left, the transitional `useAPIKeysQuery`
/ `useAPIKeys` hooks drop their reveal path and only mint a plain grant.
They remain for the publishable-only consumers until FE-4731.

## Testing
- `iceberg-wrapper-create-mutation.platform.test.tsx`: `mutateAsync`
throws without the reveal grant and makes no credentials request; the
granted case exposes the grant.
- `BucketCallouts.platform.test.tsx`: "Install wrapper" is enabled when
granted, and disabled with the note when denied or with an error when
the permission check fails.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-04 11:36:17 -05:00
CharisandClaude d727bb0081 feat(studio): add reveal refinement for api-keys and split queries (#52723)
Part 1 of 4 in a stack for
[FE-4694](https://linear.app/supabase/issue/FE-4694/pilot-split-api-keys-queries-and-add-first-refinement-reveal-variant).
Later PRs migrate the api-keys consumers onto grants.

## Stack
1. 👉 Reveal refinement and split api-keys queries
2. #52724 API keys settings UI and command menu
3. #52727 Database and edge functions consumers that reveal secret keys
4. #52728 Storage, cron, and Realtime consumers; remove the transitional
reveal path

## Changes
- Adds a `reveal` variant for `GET /v1/projects/{ref}/api-keys` in
`lib/fga-refinements.ts`. It requires `api_gateway_keys_secret_read` on
top of the base annotation, and owns the `reveal` query param: the fetch
wrapper sets it to `'true'` for a reveal grant and `'false'` otherwise
(including `unguarded`), so passing `reveal` by hand is a type error.
- Splits the query into `apiKeysQueryOptions` (plain grant) and
`revealedApiKeysQueryOptions` (reveal grant). Both use `skipToken`
without a grant, and the grant stays out of the query key.
- `useAPIKeysQuery` and `useAPIKeys` stay as deprecated transitional
hooks that mint the matching grant with `useGrant`. They can't use
`unguarded.migrating`: with `reveal` owned by the wrapper, that would
silently return unrevealed keys to consumers that need secrets.
- Marks the variant type parameter `const` in `getGrant`, `useGrant`,
`ensureGrant`, and `testGrant`. Adding a second refinement with variants
widened inference of the branch variants to a union.
- Adds `tests/lib/project-grant-mocks.ts` for component tests that need
`useGrant` to resolve, and updates tests that partially mocked the V2
permissions hook.

## Testing
Adds the type and runtime tests deferred from FE-4689 to
`data/guarded-fetch.test.ts`: type equality with the raw client for
plain and reveal grants, `reveal` rejected as a caller-supplied param, a
reveal grant rejected on an endpoint without that variant, brand
invariance, `guardMethod` setting `reveal` from the grant, and
`assertGrant` throwing on an unknown variant.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-04 10:12:22 -05:00
Joshen Lim 0b9e8bdea4 Joshenlim/fe 4882 make the new integrations UI the default (#52683)
## Context

Makes the one-click integrations feature preview the new default +
cleans up all the old integrations code that's no longer used with this
change

## To test
- [ ] Verify that the project integrations page is using the new UI
2026-11-04 14:26:01 +08:00
Charis df742bdb3b refactor(studio): rename ResponseError to StudioError (#52707)
## What

Moves the `ResponseError` class (`types/base.ts`) and the classified
error classes (`types/api-errors.ts`) into
`lib/errors/studio-errors.ts`, and renames `ResponseError` to
`StudioError`.

## Why

Studio's error classification is being expanded to cover errors that
don't come from API responses (thrown network failures, aborted
requests, unexpected client errors). The API-specific name and location
no longer fit. Landing the rename on its own keeps the follow-up PR,
which introduces the classified error model, small and reviewable.

## Notes for reviewers

- Mechanical change, no behavior change. Most of the diff is a one-line
import change per file plus import re-sorting by Prettier.
- Files that only use the type now use `import type { StudioError }`.
- `ResponseError` is no longer re-exported from `@/types`; there are no
compatibility shims at the old paths.
- Unrelated identifiers like `QueryResponseError` and
`parseResponseErrors` are unchanged.
2026-11-03 11:09:30 -05:00
K-Dog (Kevin) 31c9854c2a chore: update api types (#52618)
Fixes API-types as per latest develop - pending prod deployment today to
clear out the failing action that checks against prod types
2026-11-02 18:27:59 +08:00
Riccardo Busetti cd0b65c03e feat(logs): Add Pipelines to unified logs and rename ETL to Pipelines (#52555) 2026-11-02 11:26:29 +01:00
Coenen Benjamin 253d874e38 fix(warehouse): disallow warehouse installation on orioledb (#51913) 2026-10-29 11:31:54 +01:00
Charis 6a27ccbe09 fix(studio): restore RLS permission checks for GitHub/Vercel integrations (#52385)
## Problem
Project-scoped admins see "You need additional permissions to view
GitHub connections" (and the same for Vercel) since #50966. That PR
moved these checks to `ORGANIZATION.CONFIG_READ`/`CONFIG_WRITE`, which
the v2 permissions API never grants to project-scoped members.

## Fix
The platform endpoints behind these views don't use OpenFGA:
- GitHub connections: list/update/delete are RLS-only; create uses
`canForProjectRef(READ, 'projects')`
- Vercel connections: create uses `canForProjectRef(CREATE,
'integrations.vercel_connections')`; the rest are RLS-only
- OAuth apps (installed integrations view):
`AuthWithOrganizationSlug(READ, 'oauth_apps')`

So this reverts #50966's changes in `GithubSection`,
`GitHubIntegrationConnectionForm`, `VercelSection`, `Landing.utils` and
`useInstalledIntegrations` back to `useAsyncCheckPermissions` with the
original resources, and updates
`MarketplaceIntegrationSettingsTab.test.tsx` to mock the v1 permissions
endpoint.

## Testing
- `MarketplaceIntegrationSettingsTab.test.tsx` and
`MarketplaceDetail.test.tsx` pass

Fixes FE-4751
2026-10-28 09:08:24 -04:00
Charis 9391f60ec9 test(studio): add shared permissions mocks and testGrant helper (#52312)
## Problem

Components and fetchers are moving to endpoint-bound FGA grants, so more
tests need to mock `/platform/profile/permissions/v2` and mint grants.
Each test file currently defines its own permissions response type and
mock, and `testGrant` lives inside `guarded-fetch.test.ts`.

Resolves
[FE-4692](https://linear.app/supabase/issue/FE-4692/test-infra-global-msw-handler-for-v2-permissions-and-testgrant).

## Solution

* `tests/lib/permissions-fixtures.ts`: shared `PermissionsV2Response`
type, `ALL_FGA_PERMISSIONS`, `allPermissionsFor(slugs)` (grants
everything at the org level), and `NO_PERMISSIONS`.
* `tests/lib/msw-permissions.ts`: `mockPermissions(response)` and
`mockPermissionsError({ status, message })` on top of `addAPIMock`.
* `tests/lib/test-grant.ts`: `testGrant(endpoint, { variant,
organizationSlug, projectRef, permissionsProjectRef })` for unit tests
of fetchers and query options, moved out of `guarded-fetch.test.ts`.
* Existing tests that mocked the v2 endpoint now use the shared helpers.
`IndirectTaxDeclarationModal.test.tsx` keeps its own `addAPIMock`
because a test asserts the request was served.
* Documented in `apps/studio/tests/README.md` and the
`studio-mock-api-tests` skill.
2026-10-26 10:51:20 -04:00
Charis 254e24b170 feat(studio): require grants in fetch wrappers for FGA-annotated endpoints (#52238)
## Problem

Resolves FE-4689 and FE-4690.

Builds on #52105. Studio's fetch wrappers don't know which FGA
permissions an endpoint requires, so a UI guard and the request it
protects can drift apart. This makes the `grant` minted by
`useGrant`/`getGrant`/`ensureGrant` part of the request itself: calling
an annotated endpoint without a matching grant is a compile error.

## Solution

### What changed

- **Fetch wrappers** (`data/fetchers.ts`, `data/guarded-fetch.ts`):
`get`/`post`/`put`/`patch`/`del` keep their names, so no imports change.
- The `grant` option is required for endpoints annotated with
`x-fga-permissions`, and forbidden for unannotated ones.
- It accepts a `Grant` for that exact endpoint (or one of its variants)
or `unguarded`.
  - The wrapper strips the grant before calling openapi-fetch.
  - `head`/`trace`/`options` are unchanged.
- **Owned params**: refinements can declare query params the wrapper
sets from the grant's variant (`ownedQuery`). These params are removed
from the init type (`Omit<Query, Owned> & { [K in Owned]?: never }`), so
callers can't pass them. Nothing uses this yet: the api-keys `reveal`
variant is the first.
- **`assertGrant`** runs in development only and throws
`GrantAssertionError`. It checks:
  - the endpoint;
  - a missing grant;
  - the variant against `when(init)` predicates;
- the path `ref` against the grant's project, also accepting the parent
project ref for a grant minted on a branch;
  - the path `slug` against the grant's organization.
- **Escape hatches**:
  - `unguarded.migrating` for unmigrated call sites.
- `unguarded.byDesign('reason')` for calls that intentionally skip the
check.
- **Grants** now record `permissionsProjectRef`, the ref permissions
were evaluated against. It's required once the scope is resolved.
- **Readable errors**: a missing or wrong grant reports the caller's own
init type plus the expected `grant` type, instead of openapi-fetch's
full options type. Under `noErrorTruncation`, the old message was tens
of KB per call site.
- **`executeSql`** now requires a grant for `POST
/platform/pg-meta/{ref}/query`, so every caller counts as unmigrated.
- **Codemod**: added `grant: unguarded.migrating` at every existing call
site that hits an annotated endpoint, including all `executeSql`
callers. No behavior change. A follow-up lint rule ratchets the count
down.
- **Dependencies**: adds `openapi-typescript-helpers` (the version
openapi-fetch already uses) for the helper types. Only openapi-fetch's
unexported `InitParam` is copied locally.

### Type-level notes

- The grant is checked in the parameter type rather than in `Init`'s
constraint. That way `Init` is still inferred from the argument, which
keeps both the return type and the error message tied to the caller's
code.
- The grant is replaced rather than intersected. Intersecting a wrong
grant with the expected one can reduce the init type to `never`, which
then accepts the call.
- `NoInfer<Path>` stops a grant's endpoint from becoming an inference
candidate for the path.

## Review instructions

### Tests

- `data/guarded-fetch.test.ts`:
- Type equality with the raw client: required params and body,
template-literal paths, `parseAs`, `signal`/`headers`, optional-init
endpoints, and `unguarded`. An openapi-fetch upgrade that breaks the
local `InitParam` copy fails typecheck.
  - Negative type cases:
    - a missing or `undefined` grant;
    - a missing init on an annotated endpoint;
    - a grant for a different path or method;
    - any grant or `unguarded` on an unannotated endpoint;
    - a forged grant;
    - params and body still checked;
    - an unknown path.
- `guardMethod` and `assertGrant` runtime behavior, including
branch-parent refs and org slugs.
- Variant and owned-param tests are deferred to the api-keys (`reveal`)
and pg-meta (`read`/`write`) PRs, since no refinements exist yet.

1. Run `pnpm typecheck` and confirm Studio passes. Then remove a `grant:
unguarded.migrating` and check that the error is short and names the
expected grant.
2. Run `pnpm test:studio`.
3. Skim the codemod commit: it only adds `grant: unguarded.migrating`
and the `unguarded` import.

## Checklist

Check all before review:

- [ ] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-10-26 07:58:22 -04:00
Joshen Lim 60b51d74d5 Audit existing unit tests + Remove redundant ones (#52215)
## Context

_TLDR: Changes here speeds up unit tests on CI from ~14 minutes to ~3
minutes_ 😂
_TLDR 2: The file changes are solely only test files +
`studio-unit-tests.yml`_

We've currently got a lot of unit tests in the repository which while
great for coverage, hasn't been ideally written. There's a lot of
redundancy + overly specific tests that break easily, and our current
unit test takes about 15 minutes to run in the GHA per PR. Hence am
doing a audit clean up of all existing unit tests in the studio repo.

## Changes involved
- `.test.ts` files now run in `node`, `.test.tsx` in `jsdom`
- jsdom costs about 1s of setup per file. A `.ts` test that needs the
DOM opts in with `// @vitest-environment jsdom` (46 files do).
- Removed redundant and over-specific tests
- Duplicates are merged into `test.each`. Tests that only covered
libraries, existed for coverage, or asserted class names and snapshots
are deleted. 19 files are merged into a sibling or deleted.
- Fixed about 15 tests that couldn't fail 
- Examples: unawaited assertions, fixtures equal to the default, and a
`semverGte` test calling `semverLte`.
- Sped up the slowest files 
- Real sleeps are replaced with fake timers, `user.type` with paste, and
Radix option queries are scoped to the open listbox. For example,
`RestoringState` went from 18s to 0.3s and
`useTableEditorFiltersSort.navigation` from 20s to 3s.
- These ^ already shave down the unit tests time from 14 mins to 9 mins,
but am also sharding unit tests across 4 jobs to increase speed up
further which then shaves down time to 3 mins now
2026-10-23 18:51:27 +08:00
Joshen Limandcoderabbitai[bot] 2400e9537a Joshenlim/fe 4679 inconsistency with integrations that arent installed create (#52141)
## Context

Addresses some issues with the "One click integration" feature preview
for the following 3 integrations

### Database Webhooks
- The "Create a new hook" CTA can be clicked despite the integration not
being installed yet
- As such if you were to create a new webhook, you'll run into errors
- Am opting to follow the UX in wrappers where the dashboard will
install the integration for you if you're trying to create a new webhook
while the integration isn't installed yet
- So this allows users to go straight to creating webhooks without the
additional step of clicking "Install integration"
<img width="500" alt="image"
src="https://github.com/user-attachments/assets/7fb70937-94c2-4095-9eef-4fb71347d132"
/>
<img width="500" alt="image"
src="https://github.com/user-attachments/assets/7efcee65-34c0-438f-8fb5-3f0d855a0f34"
/>

### Cron and Queues
- The "Jobs" / "Queues" tab can be opened despite the integration not
being installed yet
- This results in a number of unnecessary API requests to fetch the data
for the corresponding grids, but they'd all error out since the database
extension isn't installed
- Opting to gate all the network calls via `enabled` if the integration
is not installed yet, and also render an empty state instead as such
(This aligns with the Stripe Sync Engine)
<img width="500" alt="image"
src="https://github.com/user-attachments/assets/e8203162-a249-4da0-9ef9-f47df194b20f"
/>

## To test
- [ ] For database webhooks, verify that you can create a webhook
without having to click "Install integration" prior
- [ ] For cron and queues, verify that there's no network requests to
fetch their data if the integration is not installed yet while you're on
the jobs / queues pages

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-10-23 16:16:33 +08:00
Danny White 9be9e570c3 feat(studio): adopt shared inline code defaults (#51981)
## Problem

Studio relies on repeated classes to style inline code. Bare `<code>`
elements can miss those styles.

## Solution

Import the shared styles from #51980 and remove the repeated classes.
Keep Markdown renderer behaviour and existing size overrides. Use
`data-code-style="plain"` for webhook headers, CLI and upgrade commands,
configuration comparisons and connected-resource labels that have their
own layout.

## Review instructions

Dashboard review: this PR changes Studio only.

1. Open [Database >
Extensions](https://studio-staging-git-dnywh-depr-707-code-studio-supabase.vercel.app/dashboard/project/_/database/extensions).
Search for `pg_trgm` or another disabled extension and turn on its
toggle to open the Enable dialog. Check the Extension and Schema values
and the help text under “Install in a different schema”. The SQL block
should keep its highlighting and copy control. Close without installing.
2. Open [Edge Functions >
Secrets](https://studio-staging-git-dnywh-depr-707-code-studio-supabase.vercel.app/dashboard/project/_/functions/secrets).
Scroll to “Default secrets” and check `SUPABASE_URL` and
`SUPABASE_DB_URL`: both should use the bordered inline-code style. Hover
a name to see “Click to copy”, then click it and confirm the name is
copied. No custom secret or deployed function is needed.
3. Compare light and dark themes at narrow and desktop widths.

| Before | After |
| --- | --- |
| <img width="812" height="1066" alt="CleanShot 2026-10-19 at 15 35
10@2x"
src="https://github.com/user-attachments/assets/e4a21310-1fac-4143-9ee6-d2452ab4f314"
/> | <img width="812" height="1068" alt="CleanShot 2026-10-20 at 15 39
20@2x"
src="https://github.com/user-attachments/assets/d2c91ef6-7836-4c71-8f15-d0c0df8e969d"
/> |
2026-10-22 00:48:56 +00:00
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>
2026-10-21 06:54:16 -04:00
Danny White 279434fb70 feat(studio): add copied data deletion to Warehouse disable dialog (#51906)
## Problem

Disabling Warehouse leaves copied data in storage. Users need an
explicit option to remove it without deleting files manually.

Closes [PIPE-1128](https://linear.app/supabase/issue/PIPE-1128), using
the deletion support from
[PIPE-1098](https://linear.app/supabase/issue/PIPE-1098).

## Solution

Adds “Also delete copied Warehouse data” to the disable dialog. It stays
unchecked by default. Source tables are preserved.

| Before | After |
| --- | --- |
| <img width="826" height="504" alt="CleanShot 2026-10-19 at 16 17
12@2x"
src="https://github.com/user-attachments/assets/defc99b9-4ec0-4188-bfa6-53f489ef2be5"
/> | <img width="830" height="614" alt="CleanShot 2026-10-19 at 16 36
40@2x"
src="https://github.com/user-attachments/assets/80299728-a790-4d80-a2d9-16750977a679"
/> |

Handles errors differently depending on what it relates to:

| General Errors | Data Deletion Only |
| --- | --- |
| <img width="840" height="864" alt="CleanShot 2026-10-20 at 13 22
05@2x"
src="https://github.com/user-attachments/assets/7b2b37c3-ace6-4fe0-a1b7-106a97eaab0a"
/> | <img width="854" height="876" alt="CleanShot 2026-10-20 at 13 19
13@2x"
src="https://github.com/user-attachments/assets/81459525-bb9f-4d2c-891d-b7f8f646098a"
/> |
| _Above the fold_ | _Below the fold, within the relevant section_ |

## Review instructions

1. Open **Integrations → Warehouse → Overview** in a project with
Warehouse enabled, then click **Disable Warehouse**.
2. Check that **Also delete copied Warehouse data** is unchecked and has
a permanent deletion warning. Select it, cancel, and reopen. It should
be unchecked again.
3. On a disposable project, confirm with the option unchecked. Copied
data should remain. With the option checked, the managed DuckLake
catalogue and Storage bucket should be removed. Source tables should
remain in both cases.
4. Confirm Studio shows cleanup progress, then returns to setup. Failed
requests should keep the dialog open; failed background cleanup should
offer **Retry**.
2026-10-20 14:40:05 +11:00
Danny White 3960e6ac41 chore(deps): bump lucide-react to v1 (#51770)
## Problem

Lucide React v1 improves screen reader behaviour (icons are hidden from
assistive tech by default). It also removes brand icons such as GitHub.
We were still on Lucide 0.x across the monorepo.

## Solution

- Move every workspace onto one shared Lucide React v1 version via the
pnpm catalog.
- But Lucide React v1 [deprecated brand
icons](https://github.com/lucide-icons/lucide/blob/main/BRAND_LOGOS_STATEMENT.md)
- Meaning we need to handle any _old_ brand icons we used from Lucide
0.x.
- Luckily, that was just `GitHubIcon`. So...
- Add a `GithubIcon` in `packages/ui` that matches Lucide’s previous
GitHub icon, and use it wherever we imported GitHub from Lucide.
  - No other Lucide brand icons were in use.
- Studio “Continue with GitHub” sign-in still uses the existing SVG
asset (`github-icon.svg`), not this component.
- Keep the `Icon` suffix import style [recently
introduced](https://github.com/supabase/supabase/pull/51659)
- Monorepo apps now use `catalog` Lucide React v1.

## Review instructions

1. Open [Studio
preview](https://studio-staging-git-dnywh-bump-lucide-react-v1-supabase.vercel.app/dashboard/org)
on a project that is connected to GitHub:
   - Project home → Activity stats “GitHub” row
   - Org project list → GitHub badge on a connected project card/row
- Branches → GitHub link on a branch row, or “Sync with a GitHub branch”
   - Project Settings → Integrations → GitHub integration panel
2. Open
[/kb/guides/sample-guide](https://supabase.com/kb/guides/sample-guide) →
confirm “Go to the GitHub discussion” shows the icon.
3. Open
[/docs/reference/javascript](https://supabase.com/docs/reference/javascript)
→ confirm the header GitHub control still shows the icon. Or
[/docs/guides/troubleshooting/rls-simplified-BJTcS8](https://supabase.com/docs/guides/troubleshooting/rls-simplified-BJTcS8)
→ “View discussion on GitHub”.
2026-10-15 23:00:55 +00:00
Joshen Lim 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).
```
2026-10-14 12:56:55 +02:00
Brian-AnandDanny White f1082e28c7 chore: migrate Framer Motion imports to Motion (#51520)
## Problem

Closes #31221.
The applications and shared UI packages still import the former
`framer-motion` package instead of Motion's React entry point.

## Solution

Replace runtime imports, type imports, and three test mocks with
`motion/react` across the consuming workspaces.
Replace the seven direct dependency declarations with `motion:
^11.18.2`.
Preserve the existing animation engine version and all other dependency
resolutions, including the asynchronous `domMax` feature loader.
Historical blog examples remain as published; `framer-motion` remains a
transitive implementation dependency of Motion.

## Review instructions

1. Run `pnpm install --frozen-lockfile` and check the seven dependency
replacements in the lockfile.
2. Open the WWW Auth page and Docs homepage at desktop and mobile
widths, with normal and reduced motion preferences.
3. Open the mobile navigation, expand Product on WWW, and close the menu
using Escape and the close button.
4. Check the existing animation components, shared form validation, and
Studio tests for unchanged behavior.

Validation:

- Studio: 731 test files, 8,334 passing tests and one expected failure,
with `--maxWorkers=4`.
- Shared UI, UI patterns, WWW, and UI library: 615 passing tests.
- `pnpm run typecheck --concurrency=1`: all 16 repository tasks pass.
- All six application source lint scripts and lint ratchets pass;
generated Docs example copies are excluded from local lint.
- Repository Prettier source check, lockfile formatting, and case hazard
check pass.
- WWW: 10 existing end-to-end checks across nine pages.
- Docs: 5 existing guide link and accessibility checks across Database
and Auth.
- WWW and Docs mobile navigation pass at desktop/mobile sizes with
normal/reduced motion; SQL-to-REST translation tabs exercise the
asynchronous feature loader without browser errors.
- Frozen-lockfile installation passes; all existing package and snapshot
resolutions are unchanged.
- Learn and UI library command palettes open, filter results, and close
with Escape without browser errors.
- Independent code review finds no actionable defects.
- `npm run build -- --filter=www --filter=docs --filter=studio
--filter=learn --filter=library --concurrency=1 --continue=always`: all
five affected applications build successfully (9 tasks including
prerequisites); asset uploads disabled for local validation.

## Checklist

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
(no docs topics changed)

---------

Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>
2026-10-14 07:16:00 +00:00
Joshen Lim 0f238b5296 Make project vercel integrations collapsible (#51585)
## Context

For a project that might have multiple connections to Vercel projects,
the Settings -> Integrations -> Vercel section can get really long as
we're showing the configuration fields for all projects by default

Opting to make each vercel integration a collapsible instead

Also improves the "Configure connection" CTA from org integration
settings to include an id in the URL, so that redirecting users to the
project settings integrations page will land them on the right section

### Before

Organization settings -> integrations
<img width="500" alt="image"
src="https://github.com/user-attachments/assets/f5b9ea2c-0a95-4aff-9416-e16f853d3b8e"
/>

Project settings -> Integrations
<img width="500" alt="image"
src="https://github.com/user-attachments/assets/361d5ac7-5919-4103-aaae-cdb5b1a1ce8c"
/>


### After

Organization settings -> integrations
<img width="500" alt="image"
src="https://github.com/user-attachments/assets/232cfef7-affe-4f06-a019-7f86ee7805db"
/>

Project Settings -> Integrations
<img width="500" alt="image"
src="https://github.com/user-attachments/assets/c3902451-0578-4bfc-8149-2d6f9c276ebd"
/>
2026-10-13 07:52:33 -06:00
Ali Waseem 4205c4103d fix(studio): make detail panel close buttons clickable (#51455)
The close button on the Auth users detail panel (and the queue message
panel) is absolutely positioned, but `TabsList` is `position: relative`
and comes later in tree order — so it painted on top of the button and
swallowed every click. The button looked fine and did nothing.

Stacks the button above the tab list, adds an accessible name to the
users panel button, and covers it with an E2E test (Playwright does real
hit-testing, so it fails without the fix).

Fixes FE-4519
2026-10-08 13:43:02 -06:00
Danny WhiteandJoshen Lim 78dc739901 fix(studio): show support inline and honour AlertError layouts (#51377)
## Problem

AlertError forces a vertical layout whenever additional actions are
supplied, even when the caller explicitly requests horizontal or
responsive layout. Stripe Sync Engine's uninstall error is one affected
call site, the other was Pipelines as demoed in #51311.

## Solution

Honour an explicit layout. Preserve the existing defaults: vertical with
additional actions, responsive otherwise.

Replace the standalone Contact support action with an InlineLink in the
contact support prose, preserving support form context and breadcrumb
capture. Keep custom actions such as Retry. If instructions are hidden
or custom prose omits contact support, retain a separate inline support
link. With `hideContactSupport`, show no support link and shorten the
default instructions to “Try refreshing your browser.” Custom
descriptions remain unchanged. The local Pipelines configuration error
explicitly hides support. Add the explicit responsive layout at the
Pipelines call site.

| Before | After |
| --- | --- |
| <img width="914" height="426" alt="CleanShot 2026-10-07 at 17 51
20@2x"
src="https://github.com/user-attachments/assets/6cbddfee-97f5-4a7a-bafa-7b5dfd6ab8bf"
/> | <img width="916" height="422" alt="CleanShot 2026-10-07 at 18 26
06@2x"
src="https://github.com/user-attachments/assets/a21952a6-1c1a-437c-af73-c5736f33fd98"
/> |
| <img width="1566" height="384" alt="CleanShot 2026-10-07 at 18 28
07@2x"
src="https://github.com/user-attachments/assets/bdc2a043-421f-4c22-9bd3-37859c6e85c7"
/> | <img width="1568" height="308" alt="CleanShot 2026-10-07 at 18 26
58@2x"
src="https://github.com/user-attachments/assets/da0f2c6a-6254-4196-944b-5665e87b3c3c"
/> |

## Review instructions

1. In a fresh local test project with no existing `stripe` schema, run
this in SQL Editor:

```sql
begin;
create schema stripe;
comment on schema stripe is
  '{"status":"uninstall error","errorMessage":"Local layout test: uninstallation failed"}';
commit;
```

2. Open **Integrations → Stripe Sync Engine → Overview** and reload.
Check **Failed to uninstall Stripe Sync Engine** at wide and narrow
widths, including **Retry uninstallation** and the inline **contact
support** link. Do not click Retry: it invokes the real uninstall
operation.
3. Remove the empty fixture with `drop schema stripe restrict;`.
4. Block the Pipelines source-status request and resize the page: Retry
uses the responsive layout.
5. AlertError callers without an explicit layout should retain their
existing presentation. Confirm default and custom contact support prose
use an inline link, with no standalone support action. Hidden
instructions and custom prose without contact support retain an inline
fallback. With `hideContactSupport`, the default prose is “Try
refreshing your browser.” and no support link appears; custom
descriptions remain unchanged.
6. Automated regression coverage checks that an explicit responsive
layout survives additional actions, and that hiding support removes the
default support wording while preserving custom descriptions.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-10-08 16:04:32 +11:00
Yuvraj Singh d1205a05e9 fix(studio): default cron HTTP timeout when timeout_milliseconds is omitted (#51385)
## Problem

`parseCronJobCommand` reads the timeout of an `net.http_get` /
`net.http_post` cron command like this:

```ts
const timeout = timeoutMatch?.[1] || ''
// ...
timeoutMs: Number(timeout ?? 1000),
```

When the command has no `timeout_milliseconds` argument, `timeout` is
`''`, which isn't nullish, so the `?? 1000` fallback never applies and
`timeoutMs` becomes `Number('') === 0`.

`timeout_milliseconds` is optional in pg_net, so this is common for jobs
created in SQL, e.g.:

```sql
select cron.schedule('ping', '* * * * *', $$ select net.http_get(url:='https://example.com/health') $$);
```

Opening such a job in the cron editor shows a timeout of **0 ms**, and
saving fails validation (the field requires 1000 to 5000 ms) until the
user edits a value they never set.

## Solution

Use the parsed value when present, and otherwise fall back to pg_net's
default for `timeout_milliseconds` (5000 ms in current pg_net). That's
what the job actually runs with, so opening and saving it in Studio
doesn't change its behavior. It's also within the form's allowed range.

Added tests for the Edge Function and HTTP request paths without
`timeout_milliseconds`. Both fail on `master` (`timeoutMs: 0`), and the
existing cron tests still pass.

## Review instructions

1. In the SQL editor, run:
   ```sql
select cron.schedule('ping', '0 * * * *', $$ select
net.http_get(url:='https://example.com') $$);
   ```
2. Open Integrations > Cron > `ping` > Edit.
3. Before: the timeout field shows `0` and saving shows a validation
error. After: it shows `5000` and saves.
4. `pnpm --filter studio test
components/interfaces/Integrations/CronJobs/CronJobs.utils.test.ts`

## Checklist

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-10-07 15:51:54 +02:00
Joshen Lim 838fcaaa89 Joshenlim/fe 4509 fdw general UI consolidation and refactor (#51079)
## Context

Stacks on top of https://github.com/supabase/supabase/pull/51074

PR's just mainly refactoring, no visual differences:
- `CreateWrapperSheet` + `EditWrapperSheet` use the same UI components
for the foreign tables section
  - Can be consolidated into one reusable component
- `WrapperTableEditor` is still using `SidePanel` component
  - Can be swapped to use new `Sheet` component
- Refactor `WrapperTableEditor`'s layout a little - added separators for
clarity between sections
<img width="400" alt="image"
src="https://github.com/user-attachments/assets/b1983bf2-cff5-43eb-8b31-40a7abb65038"
/>
- Update `getCreateFDWSql` to just use the Foreign Data Wrapper's name
from `wrapperMeta` since its now standardized

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

* **New Features**
* Added a shared foreign-table selector for wrapper setup and editing,
with options to view columns, add or edit table definitions, and remove
tables.
  * Updated the table editor to use a sheet layout with a fixed footer.
* **Bug Fixes**
* Wrapper creation now uses the wrapper’s configured name when creating
the server.
* Foreign-table targets display the table name when other target details
are unavailable.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-05 16:20:50 +08:00
Joshen Lim 521881a899 Joshenlim/fe 4480 fdw create wrapper to only init fdw once users to name the (#51074)
## Context

PR here refactors the way we manage Foreign Data Wrappers in the
dashboard (Under Project -> Integrations), as there's some DX problems
with the current behaviour.

Currently whenever a user creates a new wrapper, the dashboard is
creating both the Foreign Data Wrapper (`create foreign data
wrapper...`) + server (`create server ...`). The former is
**_redundant_** to create multiples of given that it just handles the
`handler` and `validator`, whereas what matters more is the server which
holds the connection credentials. Hence standard practice is usually one
Foreign Data Wrapper with multiple servers. (The former just needs to be
created once if not done yet)

This also led to some problems as well when users created their own
wrappers via SQL and tried to manage them through the dashboard GUI,
leading to us having to add some guard rails to prevent managing
wrappers sharing the same Foreign Data Wrapper
([ref](https://github.com/supabase/supabase/pull/50785))

## Changes involved
- When creating a wrapper, if the Foreign Data Wrapper has yet to be set
up for the wrapper type, the dashboard will initialize one and
subsequently use that same Foreign Data Wrapper for any new wrappers
- When creating / editing a wrapper, users will name the **server**
instead of the **wrapper**
<img width="500" alt="image"
src="https://github.com/user-attachments/assets/b3e61204-0e16-4599-84ac-af2aab5b93c2"
/>
- When deleting a wrapper, the clean up for vault secrets are now
deterministic by referencing the wrapper's server options
- RE backwards compatibility: Existing wrappers will _not_ be affected
by the changes here - they can be edited / deleted as per normal

## Unrelated fixes + UI refactors added
- Fix Iceberg Wrapper not showing the right form when adding new wrapper
- Adjust form layouts in side panel to be horizontal instead of vertical
(Follows Database -> Pipelines)
- Clean up to use newer UI components like `ButtonTooltip`
- Opt to hide Docs + Create CTA under `WrappersTab` if marketplace
feature preview is enabled (Since these actions are already in the
header, will be duplicates)
- Consolidate foreign tables configuration for create + edit wrapper
sheet into one component `ForeignTablesSelector`

## To test
- [ ] Verify that existing wrappers with their own Foreign Data Wrapper
can be edited correctly
- [ ] Verify that existing wrappers with their own Foreign Data Wrapper
can be deleted
- [ ] Verify that existing wrappers with shared Foreign Data Wrapper can
be edited correctly
- [ ] Verify that existing wrappers with shared Foreign Data Wrapper can
be deleted
- [ ] Verify that new wrappers can be created
- [ ] Verify that newly created wrappers can be edited correctly
- [ ] Verify that newly created wrappers can be deleted
2026-10-05 16:00:37 +08:00