Commit Graph
7336 Commits
Author SHA1 Message Date
Pamela Chia 06fc7c4f4e fix(studio): clear telemetry cookies on sign-out (#53915)
Studio's sign-out never called the API to clear the HttpOnly telemetry
cookies (`user_id`, `organization_slug`, `project_ref`). Events sent
from the sign-in page after a sign-out were still recorded under the
user who had just signed out, and the next user on that browser
inherited the previous user's org and project cookies. I call the
existing `resetServerTelemetryCookies` helper (already used when consent
is withdrawn) from `useSignOut`, right after the auth sign-out, and only
when a session existed. A stored session whose refresh fails during
sign-out counts as existing.

**Note:** `withAuth` also calls `useSignOut` when a visitor with no
session opens a protected page. I skip the reset there because the
endpoint also clears the anonymous id and session id cookies, and a
visitor who has not signed in yet needs them until sign-in links them to
the account. When the reset does run, I make sign-out wait for it
(capped at 1 second by the helper) so the sign-in page cannot send an
event with the old cookies first.

## To test

Tested on the PR preview:
- [x] Sign in, open the network tab, then click "Sign out" in the avatar
menu: expect one `POST /platform/telemetry/reset` with a 2xx response.
Observed: one reset request (201), sent right after the auth `logout`
request (204).
- [x] While signed out, open a protected page such as
`/dashboard/organizations`: expect a redirect to sign-in and no `POST
/platform/telemetry/reset`. Observed: redirect to
`/dashboard/sign-in?returnTo=%2Forganizations`, no reset request.

The preview is cross-site to the staging API, so the browser never
stores these `SameSite=Lax` cookies there and the cookie-clearing effect
cannot be observed on it. I'll check that on the staging dashboard after
merge.

## Linear
- fixes GROWTH-1556
2026-11-24 18:12:36 +08:00
anthony lio 1a37362821 chore(billing): plan selection styling (#53841)
## Problem

- plan cards on the studio upgrade screen do not match recent plan cards
updates to the pricing page
- add-on illustrations on the pricing page sometimes show the light
image in dark mode
- spend cap bars on the pricing page flash when a user toggles the spend
cap


## Solution

- changes the upgrade screen plan cards to the pricing page design +
shows enterprise as a fourth column
- moves the lifted card style to the current plan of the organization +
gives it a neutral "current plan" badge
- moves the compare plans and pricing faq links below the plan cards +
removes the stagger animation on the cards
- changes the pricing page illustrations to pick the light or dark image
with css because the server render does not know the theme
- changes the spend cap animation to resize the bars instead of
remounting them
2026-11-24 18:04:01 +08:00
K-Dog (Kevin) aa0fb9e84b fix: plan upgrade price rounding (#53924)
While we want to round up the price for compute, so it does not display
$9.87 or the likes, we do not want any type of rounding for taxes or
amount due.
2026-11-24 17:23:50 +08:00
K-Dog (Kevin) 2d39665757 fix: do not display Free Micro upgrade on Platform Plan (#53920)
Streamline to use common helper function `isEligibleForFreeMicroUpgrade`
2026-11-24 16:54:56 +08:00
K-Dog (Kevin) 8a49c1e3f9 refactor: plan upgrade screen (#53670)
A fully revamped plan change screen covering Free -> Paid Plan or Paid
Plan <> Paid Plan changes. Out of scope is the downgrade to Free Plan,
which is a separate modal and process. Besides a visual refresher of the
current modal, we are addressing common misconceptions about our pricing and being as transparent as possible.

The new modal is available behind the feature flag
`billingPlanUpdateRedesign`, which is enabled on local/staging and will
be rolled out gradually after further testing in production.
2026-11-24 13:52:36 +08:00
Alaister YoungandAlaister Young fcbdda8107 chore: migrate formatter from Prettier to oxfmt (#53835)
Migrate code formatting across the monorepo from Prettier to `oxfmt`
(`0.79.0`, pinned) for much faster formatting checks locally and in CI
while keeping code churn minimal (78 files total, 0.7% of the repo).

Studio's `@ianvs/prettier-plugin-sort-imports` ordering
(`<BUILTIN_MODULES>`, `<THIRD_PARTY_MODULES>`, blank line, then `@/` and
relative imports) is preserved via `oxfmt`'s native `sortImports`
override for `apps/studio/**/*.{js,jsx,ts,tsx}`.

### Performance (before vs after, uncached)

| Benchmark | Prettier (`3.8.x`) | oxfmt (`0.79.0`) | Speedup |
| --- | ---: | ---: | ---: |
| CI formatting step (`blacksmith-4vcpu-ubuntu-2404`, full repo) | `73s`
| **`7s`** | **~10×** |
| Local `apps/studio` JS/TS (`5,157` files) | `17.74s` | **`0.36s`** |
**~49×** |
| Local full monorepo (`11,131` files) | — | **`2.39s`** | — |

**Added:**

- `.oxfmtrc.jsonc` at repo root with Prettier-matching options,
`sortPackageJson: false`, the Studio `sortImports` override, and ignore
patterns migrated from `.prettierignore`
- `oxfmt` (`0.79.0` exact pin) in `pnpm-workspace.yaml` catalog and
workspace `devDependencies` / `dependencies`
- Shared `.agents/scripts/format_and_lint.sh` hook script and
`.agents/hooks.json` (used by both Claude Code and Antigravity)

**Changed:**

- Replaced `test:prettier` with `format:check` and switched `format` in
root `package.json` to `oxfmt`
- Updated `packages/api-types` (`codegen`,
`verify-production-types.mjs`), `apps/design-system` (`build:registry`),
`apps/docs` (`CodeSample.ts`, `generate-sitemap.ts`, `next.config.mjs`,
`spec/Makefile`), `apps/www` (`generate-sitemap.mjs`), and
`packages/build-icons` (`generateIconFiles.mjs`) from Prettier to
`oxfmt`
- Updated `.github/workflows/prettier.yml` (keeping the `format` job ID
intact), `.github/workflows/autofix_linters.yml`,
`.claude/settings.json`, `AGENTS.md`, `CONTRIBUTING.md`, and
`.github/copilot-instructions.md`
- Applied one-time `oxfmt` formatting pass in a separate commit (78
files: 30 `i18n/README.*.md` trailing spaces, 19 Studio files, 17 other
TS/TSX/generated types, 8 MD/MDX, 3 `package.json`, 2 example CSS files)

**Removed:**

- `prettier`, `@ianvs/prettier-plugin-sort-imports`, and
`prettier-plugin-sql-cst` from `devDependencies` (note: `.sql` files
were not part of the CI formatting glob; `eslint-config-prettier` is
kept for ESLint)
- `prettier.config.mjs`, `.prettierignore`, and
`.claude/scripts/format_and_lint.sh`

## To test

- Run `pnpm run format:check` and confirm it passes cleanly across all
matched files
- Run `pnpm --filter api-types test`, `pnpm --filter docs exec vitest
run features/directives/CodeSample.test.ts`, and `pnpm --filter www exec
vitest run generate-sitemap.test.ts`
- Edit an `apps/studio` file with out-of-order imports and run `pnpm run
format` to confirm builtin/third-party vs `@/`/relative grouping matches
prior behavior
- Check that the `Check Code Formatting` CI workflow passes on this PR

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-11-24 12:51:31 +08:00
K-Dog (Kevin) 57628c6de0 chore: Free Micro upgrade when filing a performance ticket (#53848)
If a user selects the "Performance" category on the support ticket form
and their project ref maps to a Nano project on a paid plan, show an
inline tip in the form itself, before submission, pointing to a
troubleshooting guide covering the free Micro upgrade and the usual perf
debugging steps (query optimization, advisors, etc.).

<img width="523" height="327" alt="Screenshot 2026-11-23 at 6 56 05 PM"
src="https://github.com/user-attachments/assets/b0b69866-3e34-443a-8405-23279e07e25c"
/>
2026-11-24 12:31:54 +08:00
Joshen Lim 85194a05d8 Joshenlim/fe 5190 move off scaffold components in (#53849)
## Context

Housekeeping to deprecate more deprecated UI components, this one's
focusing on the `Scaffold` components.
The main visual differences are just the width within PageSections since
the new components where the right content takes up a bit more width
than the left content. (Ref org billing + usage)

Starting the refactor with the organization pages:
- Billing
- Team
- Usage
- Settings -> SSO
- Settings -> Security
- Settings -> Audit Logs
- Settings -> Documents
2026-11-24 10:39:33 +07:00
Danny White c3426aca1a fix(studio): match interstitial titles to section headings (#53704)
## Problem

The interstitial title explicitly uses the sans font, so it can look
different from the section headings in the same card.

## Solution

Let the title inherit Studio’s heading font so it matches the h2, h3 and
h4 headings inside the interstitial.

| Before | After |
| --- | --- |
| <img width="892" height="738" alt="CleanShot 2026-11-20 at 13 40
22@2x"
src="https://github.com/user-attachments/assets/72ed0238-ba51-4a49-ba1b-d9c22e7be08d"
/> | <img width="880" height="728" alt="CleanShot 2026-11-20 at 13 40
50@2x"
src="https://github.com/user-attachments/assets/5deb7004-7b08-467e-9e34-d87d48d397b6"
/> |

_Not the best example but you get the point; a card with `h2`, `h3`, etc
would now match visually._

## Review instructions

1. Open [Before on staging](https://supabase.green/dashboard/authorize)
and [After on the deploy
preview](https://studio-staging-git-dnywh-interstitial-title-font-supabase.vercel.app/dashboard/authorize).
Sign in if prompted.
2. Compare the **Missing authorization link** title in both tabs. The
title on the preview should inherit the heading font (Manrope).
2026-11-24 10:14:56 +11:00
Danny White a1b71bfdce fix(studio): clarify OAuth consent copy and hierarchy (#53702)
## Problem

The consent screen repeats information below the permissions and puts
the organization-level error away from the button it blocks.

## Solution

Place the member-bound role limit under **Permissions requested**, mark
section headings as headings, and group the role error with the action.
Keep the redirect destination centred in the footer.

| Before | After |
| --- | --- |
| <img width="890" height="1892" alt="CleanShot 2026-11-20 at 12 46
26@2x"
src="https://github.com/user-attachments/assets/1fa1b266-a82a-4fec-a840-50408f1e04fa"
/> | <img width="872" height="1706" alt="CleanShot 2026-11-20 at 12 46
32@2x"
src="https://github.com/user-attachments/assets/f0e510b1-e6b3-4e66-b3f7-61845c4cab71"
/> |
| <img width="874" height="1970" alt="CleanShot 2026-11-20 at 12 52
19@2x"
src="https://github.com/user-attachments/assets/97bcef92-50e7-453d-a1e4-9962b01a7cdf"
/> | <img width="862" height="1488" alt="CleanShot 2026-11-20 at 12 47
59@2x"
src="https://github.com/user-attachments/assets/556eb2f7-2d71-47ed-a21d-8a71a577bae6"
/> |

## Review instructions

1. **Before:** Open the [Scoped OAuth
tester](https://api.supabase.green/v1/oauth/authorize?response_type=code&client_id=a3999bfe-cfc7-4584-9c5a-ab6828d35aa3&redirect_uri=http%3A%2F%2Flocalhost%3A8765%2Foauth%2Fcallback)
and leave consent open.
2. **After:** Open the [deploy preview consent
screen](https://studio-staging-git-dnywh-oauth-consent-copy-supabase.vercel.app/dashboard/authorize?auth_id=606dbb8e-60ea-4155-bb36-70a7d31378dd).

**What to check**

1. Open consent for a member-bound staging test app. Compare the role
explanation under **Permissions requested** and the centred redirect
destination with the current staging screen.
2. Open an organization-wide request with a role that cannot grant it.
Alternatively, in Chrome DevTools → Network, use **Override content** on
the successful organization preflight GET response for an unscoped
request. Set `validation_failure` to
`{"scope_target":"all_projects","role":{"name":"read-only"},"failed_scopes":["database:write"]}`
and reload with DevTools open.
3. Check that the warning sits above the disabled **Authorize** button
and the requested permissions are hidden. Clear any overrides when done.
2026-11-24 10:14:44 +11:00
Danny White 828bd84820 fix(studio): make OAuth project scope explicit (#53701)
## Problem

An unchecked box leaves users to figure out that access is limited to
selected projects.

## Solution

Show two explicit project scope options as a set of radio buttons. A new
grant starts with selected projects. Reauthorising an all-projects grant
still preselects all projects.

## Review instructions

1. **Before:** Open the [Scoped OAuth
tester](https://api.supabase.green/v1/oauth/authorize?response_type=code&client_id=a3999bfe-cfc7-4584-9c5a-ab6828d35aa3&redirect_uri=http%3A%2F%2Flocalhost%3A8765%2Foauth%2Fcallback)
and leave consent open.
2. **After:** Open the [deploy preview consent
screen](https://studio-staging-git-dnywh-oauth-project-scope-supabase.vercel.app/dashboard/authorize?auth_id=606dbb8e-60ea-4155-bb36-70a7d31378dd).

| Before | After |
| --- | --- |
| <img width="880" height="1904" alt="CleanShot 2026-11-20 at 12 43
31@2x"
src="https://github.com/user-attachments/assets/87ed5f18-eebd-455e-a37a-9131fc9ac269"
/> | <img width="884" height="1948" alt="CleanShot 2026-11-20 at 12 43
45@2x"
src="https://github.com/user-attachments/assets/1ec03fb1-1208-496c-8ad0-1d5b6736c5da"
/> |

**What to check**

1. Open consent for a project-scoped staging test app in an organization
with projects.
2. Check that **All current and future projects** appears first and
**Selected projects only** is selected for a new grant.
4. Select a project, switch to all projects, then switch back. The
picker should reappear with your selection.
5. Repeat with an existing all-projects grant and check that the first
option is selected.
2026-11-24 10:14:13 +11:00
Danny White 1c85e3efb7 fix(studio): clarify OAuth permission labels (#53699)
## Problem

OAuth mixes abbreviated access levels with permission names whose
meaning is hard to infer.

## Solution

Use **Read and write** and **Read only** consistently, and add
keyboard-accessible definitions for Database management and Environment.
Reuse the dotted underline from Pipelines and document above-label
placement.

| Before | After |
| --- | --- |
| <img width="926" height="1936" alt="CleanShot 2026-11-20 at 12 20
42@2x"
src="https://github.com/user-attachments/assets/053b4afa-f428-4c0d-8f3b-dbc3f3dd5cf8"
/> | <img width="886" height="1902" alt="CleanShot 2026-11-20 at 12 21
20@2x"
src="https://github.com/user-attachments/assets/8277064b-1e73-43ff-b7b5-4d4af7d6c68f"
/> |
| _No tooltips, old “READ-WRITE”._ | _Tooltips for ambiguous
permissions, “READ AND WRITE” for clarity and to match setup
terminology._ |

## Review instructions

1. **Before:** Open the [Scoped OAuth
tester](https://api.supabase.green/v1/oauth/authorize?response_type=code&client_id=a3999bfe-cfc7-4584-9c5a-ab6828d35aa3&redirect_uri=http%3A%2F%2Flocalhost%3A8765%2Foauth%2Fcallback)
and leave consent open.
2. **After:** Open the [deploy preview consent
screen](https://studio-staging-git-dnywh-oauth-permission-labels-supabase.vercel.app/dashboard/authorize?auth_id=606dbb8e-60ea-4155-bb36-70a7d31378dd).

**What to check**

1. Open consent for a test app that requests database read/write,
environment read, and projects read access.
2. Check the small **Read and write** and **Read only** headings. Hover
or Tab to Database management and Environment. Each definition should
appear above its dotted-underlined label.
3. Optionally open an existing Pipeline and hover over an annotated
status label to check the shared underline.
2026-11-24 10:13:36 +11:00
kemal.earth 676d216c81 feat(studio): add events for saved views (#53856)
## Problem

Studio tracks PostHog telemetry for most user-facing interactions, but
the saved-views feature added in #53630 (moving saved views from a
toolbar dropdown into the filter sidebar) shipped with no tracking.
There's no way to measure whether people discover the new Views panel,
how often they create/apply/manage views, or how they respond to the
"this view has been modified" prompt.

## Solution

Added six PostHog events covering the saved-views lifecycle, following
the existing `unified_logs_*` naming convention (matching the
pre-existing `unified_logs_row_clicked` event):

- `unified_logs_views_panel_opened` — opening the panel from the sidebar
entry or mobile drawer (`surface` property)
- `unified_logs_view_applied` — applying a preset or saved view
(`viewType`, and `trigger: 'select' | 'reset'` to distinguish a row
click from discarding edits via "Reset")
- `unified_logs_view_created` — creating a view, with `source: 'new' |
'save_as_new' | 'duplicate'` to distinguish entry points
- `unified_logs_view_updated` — renaming (`updateType: 'name'`) or
updating a view's filters from the modified-view popover (`updateType:
'filters'`)
- `unified_logs_view_removed` — deleting a view
- `unified_logs_view_update_prompt_closed` — dismissing the "this view
has been modified" popover without updating/saving/resetting

Key choice: similar actions were consolidated into one event with a
distinguishing property rather than one event per button, per the
telemetry-standards convention (e.g. rename and filter-update both fire
`unified_logs_view_updated` rather than two separate events). The
internal re-apply that happens right after duplicating a view is not
tracked as a separate `view_applied` event, to avoid double-counting
against `view_created`.

Event interfaces were added to `packages/common/telemetry-constants.ts`
and registered in the `TelemetryEvent` union; `track()` calls were wired
into the relevant handlers in `UnifiedLogs.tsx`.

## Review instructions

1. Enable the Unified Logs feature preview and the `logsSavedViews`
flag, then open **Logs**.
2. With PostHog dev tools / network tab open, click the **Saved views**
sidebar entry and confirm `unified_logs_views_panel_opened` fires with
`surface: 'sidebar'`.
3. Save the current filters as a new view and confirm
`unified_logs_view_created` fires with `source: 'new'`.
4. Click another view row to apply it — confirm
`unified_logs_view_applied` fires with `trigger: 'select'`.
5. Change a filter on the active view, then click **Reset** in the
modified-view popover — confirm `unified_logs_view_applied` fires with
`trigger: 'reset'`.
6. Modify filters again and click **Update view** — confirm
`unified_logs_view_updated` fires with `updateType: 'filters'`.
7. Rename a view via the row's ⋮ menu — confirm
`unified_logs_view_updated` fires with `updateType: 'name'`.
8. Duplicate a view — confirm `unified_logs_view_created` fires with
`source: 'duplicate'`.
9. Delete a view — confirm `unified_logs_view_removed` fires.
10. Modify the active view again and dismiss the popover with the X —
confirm `unified_logs_view_update_prompt_closed` fires.
2026-11-23 16:54:03 +00:00
Jordi Enric 548abae3e9 fix(auth): open matching logs from Overview API errors FE-5191 (#53854)
## Problem

On Auth Overview, following a failed sign-in from the Auth API Errors
table opens a legacy text search. That search can miss the requests
behind the count or include requests with a different method or status.

## Fix

Open unified logs for the current project with the gateway source, HTTP
method, path, and status from the selected row. Use the start and end
timestamps of the query that produced the count.

Closes [FE-5191](https://linear.app/supabase/issue/FE-5191).

## How to test

1. Open Authentication → Overview on a project with Auth API errors.
2. Follow the logs link on a failed sign-in row such as `POST
/auth/v1/token`.
3. Check the project, API Gateway source, method, path, and HTTP status
in Logs. The time range should match the 24-hour window used to fetch
the row, even if the page has been open for a while.

## Compatibility and verification

Explicit legacy Logs preferences still open the legacy gateway view. In
unified logs, existing Path equals and Path does not equal filters now
compare the complete path on both backends. Use Contains or Does not
contain for substring matching.

All 211 focused tests passed with retries disabled, along with Studio
typecheck and formatting. Restoring the old substring predicates made
the exact-path tests fail on both backends.

Verified the click-through on the Studio staging preview for
`c9186d34c0`. A `POST /auth/v1/signup` row with status 401 opened
unified logs on the same project with the four expected filters. The
time window was exactly 24 hours and the visible results matched the
row. The component regression covers `POST /auth/v1/token` on both
analytics backends.
2026-11-23 17:00:55 +01:00
supabase-vercel-tedd[bot]andAlaister Young fb3ed7ee3c fix(studio): treat WebKit's CORS-denied module load as a chunk-load error (#53532)
## Problem

When a lazily loaded module chunk fails an access-control check in
Safari/WebKit (including every iOS browser) — for example, when a
corporate proxy, VPN, or captive portal redirects a chunk request
cross-origin, or a cross-origin response lacks CORS headers — WebKit's
`ScriptModuleLoader` does not throw `"Importing a module script
failed."` Instead it rejects the dynamic `import()` with `TypeError:
Cross-origin script load denied by Cross-Origin Resource Sharing
policy.` and caches the failed module fetch in the document's module
map.

`isChunkLoadError` in `apps/studio/lib/chunk-load-error.ts` did not
recognize this message. The global error boundary and router error
component therefore skipped the guarded auto-reload, showed the error
page immediately, and reported the error without the `chunkLoadError`
tag.

## Solution

Add WebKit's access-control module load error message to
`CHUNK_LOAD_ERROR_PATTERNS`. Because WebKit only emits this message from
`ScriptModuleLoader` (never for `fetch()` or XHR) and Studio only uses
dynamic `import()` for internal chunks, it gets the same handling as
other chunk-load failures:

- one guarded page reload under the existing time window and per-tab cap
- if the error recurs inside the window, it falls through to the error
UI and is reported with the `chunkLoadError` tag

Unit tests cover the new message and verify that a generic CORS-denied
`fetch` error is still not treated as a chunk-load error.

## Review instructions

This change has no UI. Check it with:

1. `pnpm --filter studio exec vitest run lib/chunk-load-error.test.ts
components/ui/ErrorBoundary/useChunkLoadReload.test.tsx` (50 passed).
2. `pnpm --filter studio exec tsc --noEmit` and ESLint on the changed
files.

## 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)


[FE-4940](https://linear.app/supabase/issue/FE-4940/typeerror-cross-origin-script-load-denied-by-cross-origin-resource)

---------

Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com>
Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-11-23 15:20:18 +00:00
Vaibhav 601cb1fe0f fix(studio): keep inline editor results on expand (#53790)
## TL;DR

fixes the inline sql editor dropping its results when opened in the full
sql editor

## prob/sol

expanding only passed the sql along, so the full editor opened on `Click
Run to execute your query` and the query had to be run again


ps: now they end up carrying the inline results over to the new snippet
on expand,
so they show w/o another run

| before | after |
| ------ | ----- |
| <video
src="https://github.com/user-attachments/assets/586a5aa3-3793-4e9c-ac51-a63a076e6fdd"
controls></video> | <video
src="https://github.com/user-attachments/assets/c17200df-2ea7-4da4-a39d-a33dea87561c"
controls></video> |

## ref

- closes: https://github.com/supabase/supabase/issues/53779
2026-11-23 07:20:43 -06: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
899e18527b fix(studio): use local dirname in vitest config to avoid Vite deprecation warning (#53210)
## Problem

`apps/studio` is configured as an ES module (`"type": "module"` in
`package.json`). In native Node ESM, the CommonJS global `__dirname` is
not defined.

In `apps/studio/vitest.config.ts`, line 9 explicitly creates a standard
ESM directory reference:
```typescript
const dirname = fileURLToPath(new URL('.', import.meta.url))
```
which is properly used in `setupFiles` (lines 27–29). However, line 18
accidentally used `__dirname` for the `@ui` path alias:
```typescript
alias: {
  '@ui': resolve(__dirname, './../../packages/ui/src'),
}
```

This triggers Vite's native loader deprecation warning on every test
run:
```text
(!) Your Vite config uses features that are unsupported by `configLoader: 'native'`, which is planned to become the default in a future major version of Vite:
  - `__dirname` (vitest.config.ts:18:22). Use `import.meta.dirname` instead
```

## Solution

Replace `__dirname` with `dirname` on line 18 to use the variable
already declared at the top of the file. This aligns with the rest of
the configuration, silences the deprecation warning, and ensures
compatibility with Vite's upcoming native config loader.

## Review instructions

1. Run Vitest in `apps/studio`:
   ```bash
   pnpm --filter studio test
   ```
2. Verify that the tests run without printing the `configLoader:
'native'` warning for `vitest.config.ts:18:22`.

## Checklist

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)

Co-authored-by: hallidayo <22655069+Hallidayo@users.noreply.github.com>
Co-authored-by: Nik Richers <nrichers@gmail.com>
2026-11-23 13:10:55 +00:00
Jordi Enric 31f9125e22 fix(logs): open related timeline events in Overview FE-5160 (#53850)
## Problem

Selecting a related event in the Logs Timeline updated the panel header,
but users still had to switch to Overview to inspect the event.

## Fix

Open the selected event’s Overview and move focus to its tab. Returning
to Timeline shows the original request with the inspected event
highlighted.

Addresses the Timeline interaction reported in
[FE-5160](https://linear.app/supabase/issue/FE-5160). The issue also
tracks missing Auth events in unfiltered results.

## How to test

1. Open a log with a related event and select Timeline.
2. Click a related event. Check that Overview opens with that event’s
details.
3. Return to Timeline and use Enter on a different event. Check its
Overview and keyboard focus.

## Verification

Verified on the Studio staging preview for commit `96ba43278c`: clicking
a related runtime event opened its Overview. Returning to Timeline
highlighted that event. Pressing Enter on another event opened its
details with focus on the Overview tab.

All 37 focused Timeline and user-detail tests passed locally. The
updated regression test failed against the previous behavior. Studio
typecheck, changed-file ESLint, and Prettier passed.
2026-11-23 13:09:00 +01:00
claude[bot]andClaude 9102a31451 chore(studio): graduate import/no-anonymous-default-export to error (#53791)
<!-- claude-slack-attribution -->
_Requested via [Slack
thread](https://supabase.slack.com/archives/C063LNYJJKS/p1795307074102889)_

Before: `import/no-anonymous-default-export` was tracked in the Studio
ESLint ratchet and ran as a warning, so new anonymous default exports
could slip in.

After: Studio has no violations of this rule, so it is no longer
ratcheted and any new anonymous default export fails lint as an error.

This graduates `import/no-anonymous-default-export` out of the ratchet
and sets it to `error` in Studio's ESLint config.

How: removed the rule from `apps/studio/scripts/ratchet-rules.json` and
from both sections of `apps/studio/.github/eslint-rule-baselines.json`,
and set it to `error` in `apps/studio/eslint.config.cjs`. I set it in
the Studio config rather than the shared `eslint-config-supabase`, since
`www` (25) and `docs` (1) still have violations. `eslint .` in
`apps/studio` reports 0 errors and 0 violations of this rule, and a
throwaway anonymous default export is flagged as an error.
`lint:ratchet` passes. The bot's baseline PR (#53117) also edits this
rule's entries in the baselines file, so one of the two will need a
rebase.

---
_Generated by [Claude Code](https://claude.ai/code)_

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-23 07:04:05 -05:00
K-Dog (Kevin) 649f2b04f7 chore: More prominent Nano -> Micro upgrade badge if available (#53847)
Use a more prominent badge for the Compute Size if a Free Upgrade is
available, aligned with the Upgrade available banner (same badge with
same animation).
2026-11-23 18:59:43 +08:00
fadymak 8728c41ad3 feat(studio): raise passkey relying party origins limit to 10 (#53735)
Raises the relying party origins limit in the Passkeys settings form and
the passkeys guide from 5 to 10.
2026-11-23 11:14:44 +01:00
K-Dog (Kevin) 286dc37677 chore: Free Micro Upgrade banner less permanently dismissible (#53838)
We want more customers to upgrade their instances to Micro on paid
plans.

- Only dismiss for 7 days at a time per project
- Render it if available, not only when there's a performance related
reason
2026-11-23 18:09:42 +08:00
Alaister Young c3a7e1019e chore(api-types): sync types with production OpenAPI specs (#53839) 2026-11-23 17:38:29 +08:00
Joshen Lim 764c676951 Joshenlim/fe 5170 deprecate pagelayout component (#53836)
## Context

Final piece to the housekeeping for removing the deprecated `PageLayout`
component.
Moves off the organization and project home routes to the new layout
components and deletes the `PageLayout` component within studio
2026-11-23 16:21:23 +07:00
Joshen Lim 98876d2e90 Joshenlim/fe 5167 refactor pagelayout for branching pages (#53717)
## Context

Just some housekeeping to move off old layout components - this PR
targets the branching pages, specifically

Branching
Branching -> Merge requests
Branching -> Merge

Just need to make sure that these pages still render fine
2026-11-23 12:43:20 +07:00
Joshen Lim f5ac51d4c6 Joshenlim/fe 5168 refactor pagelayout for advisor database (#53718)
## Context

Just some housekeeping to move off old layout components - this PR
targets the database + advisor pages, specifically

Advisor -> Settings (Rules), this is behind a feature preview
Database -> Tables
Database -> Publications

Just need to make sure that these pages still render fine
2026-11-23 12:43:10 +07:00
Joshen Lim 4a73166675 Add support for downloading edge functions when file size exceeds max cap (#53709)
## Context

Just creating a separate PR cause I messed up the [previous
one](https://github.com/supabase/supabase/pull/53453) with a bad merge 🫠
Also changed the implementation to no longer use `@deno/eszip`.

For edge functions, functions which exceed 5MB cannot be fetched and
displayed in the dashboard editor (API will return a 507). The CTA we
give to users is to download the function via the CLI, but this PR
explores allowing users to download their edge functions via the browser
still, by calling `/v1/functions/slug/body` without the
`multi-part/data` header. This returns the function in a raw eszip
stream which we're then parsing using a custom reader

We'll do this via the "Download as ZIP" CTA here - but this way of
downloading only kicks in if the GET Edge Function body endpoint returns
a 507. Otherwise it'll just be status quo where we bundle the files that
were already fetched to render in the browser into a ZIP file.
<img width="343" height="186" alt="image"
src="https://github.com/user-attachments/assets/4ffc9fee-7e6d-46a6-bdbe-294610abc802"
/>

Also updated the warning for 507s:
- To use a normal admonition instead of `AlertError` since its
technically not an issue
- To avoid rendering the API error message in this case specifically as
the API message contains "Use multipart instead" which isn't relevant to
the dashboard from a user's POV
<img width="500" alt="image"
src="https://github.com/user-attachments/assets/8242a875-f142-419d-81f0-0dbc30807f87"
/>

## To test

- [ ] Upload an edge function of size larger than 5MB to a staging
project via the CLI
- [ ] Verify that there's an Admonition for the large function instead
of an error
- [ ] Verify that you can still download the edge function via the
Download button (Which triggers a POST /body request without multipart)
2026-11-23 10:59:57 +07: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
Joshen Lim 3cfd882683 Joshenlim/fe 5169 refactor pagelayout for storage functions (#53719)
## Context

Just some housekeeping to move off old layout components - this PR
targets the Storage + Edge Function + Wildcard pages, specifically:

Project wildcard route (/project/_)
Organization wildcard route (/org/_)
Storage -> Analytics Buckets
Storage -> Vector Buckets
Edge Function -> New function

Just need to make sure that these pages still render fine
2026-11-23 10:59:11 +07:00
Joshen Lim cea3232469 Joshenlim/fe 5166 refactor pagelayout for auth api pages (#53716)
## Context

Just some housekeeping to move off old layout components - this PR
targets Auth and Settings pages, specifically
- Auth -> Emails
- Auth -> Providers
- Settings -> API Keys
- Settings -> JWT Keys
- Settings -> Log Drains
- Settings -> Read Replica/id

The only visual change is just that navigation tabs take the full width
of the viewport now

Just need to make sure that these pages still render fine
2026-11-23 10:58:53 +07:00
Joshen Lim 7e92210d31 Replace useUrlState with useQueryState, and deprecate (#53726)
## Context

We've got a `useUrlState` hook that was written a long time ago, which
is now deprecated and can be replaced with nuqs' `useQueryState` - so
this PR cleans that up and deletes the hook.

## To test
Just 2 surfaces in the dashboard that's affected
- Project -> Settings -> Addons
- [ ] Verify that opening/closing the addon panels toggle the panel URL
param accordingly
- Table Editor filters and sorts
- [ ] Verify that landing on the editor with `?create=table` URL param
opens the new table panel + removes the URL param
- [ ] Verify that filter and sorts still work + including refreshing the
browser should land back on the same state
- [ ] Verify that renaming a column while there's a filter/sort applied
for that column will also update the URL param
2026-11-23 10:58:18 +07:00
Gildas Garcia e6986b5296 feat(studio): OAuth apps consent screen should allow to select another org (#53744)
## Problem

The OAuth apps consent screen does not allow users to change the
selected org. If the calling app didn't provide the org slug, we select
the first available org from the users orgs.

## Solution

Add an organization selector:
<img width="436" height="570" alt="image"
src="https://github.com/user-attachments/assets/a5579f2c-ff54-4d02-9d4a-ac75ed245719"
/>

## Review instructions

Requirements:
- have multiple orgs
- have a published app that needs projects selection and at least one
authorization already granted
- have the oauth example app ready

Tests:
- authorizing the app again on the same org it was before should
preselect the projects
- you should be able to select another org and if you do, that should
clear the selected projects and you should see only this org projects in
the options
- reselecting the initially granted org should reselect the projects it
had in the existing grant
2026-11-20 18:16:48 +01:00
kemal.earth 53f2bb416d feat(studio): saved views in sidebar (#53630)
## Problem

Unified Logs had saved views behind a dropdown in the toolbar. The
dropdown couldn't show more than a name per row, had no room for
grouping, and gave new projects nothing to start from — an empty list
until you built and saved a filter combination yourself.

## Solution

Moved saved views into the filter sidebar as a second level, following
the Explorer notebooks/chats pattern: a Saved views button in the
sidebar header swaps the filters out for a Views panel, with a
breadcrumb back to Logs.

Key choices:

- **`FilterSideBar` stays generic.** It takes `section`, `headerAction`
and `onReset` slots; all saved-views specifics live in `LogsViewsPanel`.
- **Presets are virtual, not seeded.** Three built-in views (Errors,
Failed requests, Database health) render from a constant with `preset:`
ids. No per-project write, so they work for read-only members and can't
be deleted into oblivion. They can be duplicated into a real saved view,
but not renamed, edited or deleted.
- **One dialog for naming.** `ViewNameDialog` backs create, rename and
duplicate.
- **Clicking a modified view opens the update prompt** instead of
re-applying it, which previously discarded unsaved filter edits with no
warning.

Also fixed two pre-existing alignment issues in the sidebar: filter
options sat 4px left of their section heading, and the User filter — a
hand-copied clone of the filter row markup — had drifted from the shared
one.

## Review instructions

1. Enable the Unified Logs feature preview and the `logsSavedViews`
flag, then open **Logs**.
2. Click the layers button in the sidebar header. The filters swap for
the Views panel, with **Preset views** above **Saved views**.
3. Click **Errors**. The filter applies and the row highlights; the
layers icon turns green.
4. Change a filter. The row reads **Modified** and the update prompt
appears. Go back to Logs and return — the prompt is still available.
5. Open the ⋮ menu on a preset: only **Duplicate** is offered. Duplicate
it and confirm it lands under Saved views with rename/delete available.
6. Click **+** in the Views header to save the current filters, then
rename and delete it.
7. Hit the reset button in the header and confirm the active view clears
along with the
   filters.
2026-11-20 15:28:59 +00:00
Ali Waseem 73f1a60341 fix(studio): hide spend cap file size banner when Pro already allows 500 GB (#53633)
## What

Storage settings showed "Reduced max upload file size limit due to spend
cap" to every Pro org with spend cap on, telling them to disable it to
get 500 GB uploads. The `storage.max_file_size` entitlement for Pro is
already 500 GB regardless of spend cap, so the banner was wrong and
confusing.

- The banner now only shows when the entitlement returns a known value
below 500 GB (it no longer relies on the 50 GB fallback). The check
lives in `isFileSizeReducedBySpendCap` with unit tests.
- When it does show, the banner states the current reduced limit (e.g.
"Max upload file size limit reduced to 5 GB due to spend cap") instead
of a generic message.

Fixes FE-5063
2026-11-20 09:24:58 -06:00
Drew McLellan 8f73c10ce1 feat(studio): sample browser-translation DOM errors in Sentry (#53600)
## Problem

Browser translation (e.g. Chrome Translate) and some extensions rewrite
DOM text nodes, which makes React throw `insertBefore` / `removeChild`
errors. We drop all of these via `ignoreErrors`, so we have no signal on
how often they still happen after the dynamic-text ESLint rule (#52949).

Linear:
[FE-5008](https://linear.app/supabase/issue/FE-5008/sample-sentry-events-for-browser-translation-crashes-instead-of),
from the investigation in
[FE-5013](https://linear.app/supabase/issue/FE-5013/investigate-how-we-currently-hide-browser-translation-insertremove).

## Solution

Stop ignoring these errors in Studio and send a 5% sample, tagged so
they are easy to find in Sentry.

- Move the insert/remove node messages from
`BROWSER_NOISE_IGNORE_ERRORS` into a new
`BROWSER_TRANSLATION_DOM_ERRORS` list in `packages/common/sentry.ts`.
`docs` and `www` add it to `ignoreErrors`, so their behavior is
unchanged.
- In Studio's `beforeSend`, tag matching events with
`browser_translation`, `page_translated` and `sample_rate`. The existing
`shouldDropForSampleRate` applies the rate.
- `page_translated` is best effort: it checks for the `translated-ltr` /
`translated-rtl` class on `<html>` and Google Translate `<font>`
wrappers. Firefox and Edge are less reliable, so `false` is not proof.
- `filterSentryEvent` skips its 1% non-crash sampling for tagged events.
Without this the rates would multiply and 5% would really be 0.05%.
- The generic `parentNode` / `removeChild` null reads stay ignored. They
have many unrelated causes, so tagging them as translation would
mislead.

Not in this PR:

- The `text content does not match` and hydration ignores. They are
related symptoms and should be a follow-up.
- The user-facing fallback in `InsertBeforeRemoveChildErrorHandler`.

## Review instructions

1. Check that `docs` and `www` still ignore the five DOM messages, via
`BROWSER_TRANSLATION_DOM_ERRORS` in their `instrumentation-client.ts`.
2. Run `pnpm exec vitest run lib/sentry-client-options.test.ts` from
`apps/studio`, and `pnpm exec vitest run sentry.test.ts` from
`packages/common`.
3. After merge, filter Sentry for `browser_translation:true` on the
production Studio project and compare `page_translated` true against
false.

## Before merging

Sentry also has server-side inbound filters on the production Studio
project. Someone with project access should confirm the `error-message`
filter doesn't match these messages. If it does, the sampled events will
be dropped on arrival.

## 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 (not applicable)
2026-11-20 13:40:23 +00:00
Gildas Garcia 4448134b3b fix(studio): OAuth apps consent screen permission diff may show an empty Already granted section (#53729)
## Problem

The OAuth apps consent screen may show an empty _Already granted_
section in the permissions diff
<img width="802" height="474" alt="image"
src="https://github.com/user-attachments/assets/f49bca9e-20da-4554-83dd-98b93b752a0a"
/>

## Solution

Hide it when empty

## Review instructions

- Publish an oauth app with only the _Database Read_ permission
- Use the oauth example to authorize it 
- Update the published app to add the _Database Write_ permission
- Use the oauth example to authorize it again

You shouldn't see an _Already granted_ button
2026-11-20 14:22:43 +01:00
Colum Ferry 037ee2afad fix(studio): name the actual config file on the code configuration page (#53518)
## Problem

The Code configuration page (`ConfigDrift`) hard-codes `config.toml` in
its copy. The GitHub connection config endpoint (`GET
/platform/integrations/github/connections/{id}/config`) now also reads
`supabase/config.json` and `supabase/config.jsonc` and returns the file
it read in `path`, so a project with a JSON config sees wording about a
file it doesn't have.

Linear: CLI-2954

## Solution

- `useSelectedGitHubConfigDrift` returns `configFileName`, the basename
of the response's `path`.
- The drift page uses it in the column header, drift banner, decode
error title, overwrite warning and the Matching / Not tracked sections.
Where no file is known (the no-connection empty state) it says "config
file".
- `formatGitHubConfigDecodeMessage` takes the file name, falling back to
"The config file".
- The `config-toml` error source is renamed to `config-file`.
- Small copy fix in the warning: "redeploys … and overwrites changes
made here".

TOML projects see the same text as before, since `path` resolves to
`config.toml`.

## Review instructions

1. Open the Code configuration page for a project connected to a repo
with `supabase/config.toml` and confirm the copy is unchanged.
2. Repeat for a repo with only `supabase/config.jsonc` and confirm the
page names `config.jsonc` throughout.
3. `pnpm --filter studio exec vitest run
components/interfaces/ConfigDrift` covers both cases, including a JSONC
decode error.

## 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)
2026-11-20 14:20:08 +01:00
Gildas Garcia ea5cd851ed fix(studio): OAuth apps consent screen should always select the org provided in URL (#53727)
## Problem

The organization provided by its slug in the URL isn't selected unless a
project ref was also provided.

## Solution

Always select the org provided in URL

## Review instructions

- Publish an oauth app
- Use the oauth example and provide an org slug in the form
- Check the consent screen selected this org

Do check this with multiple different orgs to ensure you weren't lucky
with the org array sorting
2026-11-20 12:04:48 +01:00
claude[bot]andClaude c3c049ea53 chore: remove public TIA PDF and point to Trust Center (#53687)
<!-- claude-slack-attribution -->
_Requested by **Ivan Vasilov** · [Slack
thread](https://supabase.slack.com/archives/C0161K73J1J/p1795121287621619)_

## Problem

**Before:** The Studio org Documents page linked directly to
`https://supabase.com/downloads/docs/Supabase+TIA+250314.pdf`, and that
PDF was served publicly from `apps/www/public/downloads/docs/`.
Legal/Security wants people to get the latest TIA from the Trust Center
instead, and the old PDF taken off the public site.

**After:** The Studio TIA section links to https://trust.supabase.io,
and the PDF is deleted from `apps/www`. The old PDF URL permanently
redirects to the Trust Center, so existing links don't 404.

This removes the public TIA PDF and repoints the dashboard to the Trust
Center.

## Solution

- Deleted only `apps/www/public/downloads/docs/Supabase+TIA+250314.pdf`
(the other docs in that folder are untouched).
- `TIA.tsx` in Studio: the button now links to
`https://trust.supabase.io` (the same form already used in the legal
FAQ), reads "View TIA in Trust Center", uses the external-link icon, and
drops the `download` attribute. Description copy mentions the Trust
Center. The existing `document_view_button_clicked` telemetry is
unchanged.
- `apps/www/lib/redirects.js`: added a permanent redirect for
`/downloads/docs/Supabase\\+TIA\\+250314.pdf` to
`https://trust.supabase.io`, following the existing DPA PDF redirect.
This is easy to drop if you'd rather have a hard 404.

No other references to the PDF exist in the repo (checked www, studio,
docs, packages). The legal FAQ already links to the Trust Center.

## Important caveats

- Deleting the file does **not** remove the blob from git history.
`supabase/supabase` is public, so the PDF stays fetchable through the
repo's history. If it must be truly gone, that needs a separate decision
(history rewrite and/or contacting GitHub support).
- A CDN/Vercel cache may serve the PDF briefly after deploy (and the
redirect takes effect once deployed).

## Review instructions

1. In the Studio preview, open an org's Documents page and check the TIA
section: the button opens https://trust.supabase.io in a new tab.
2. On the www preview, request `/downloads/docs/Supabase+TIA+250314.pdf`
and confirm it redirects to the Trust Center.

## Testing

Typecheck, lint and tests were not run: `pnpm install` is partially
blocked in my environment (npm.jsr.io is egress-blocked) and prettier
couldn't load its plugins. I only confirmed `redirects.js` loads in Node
and the entry parses. I couldn't reach supabase.com, so the live URLs
are unverified.

---
_Generated by [Claude Code](https://claude.ai/code)_

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-20 10:30:36 +01:00
supabase-vercel-tedd[bot]andAlaister Young 6fda122771 chore(studio): show the TanStack devtools only with ?tanstack-devtools (#53708)
## What kind of change does this PR introduce?

Chore (local developer experience)

## What is the current behavior?

In local development, Studio renders the TanStack devtools floating
trigger in the bottom-right corner on every page. It overlaps Studio's
own dev toolbar trigger and gets in the way.

## What is the new behavior?

The TanStack devtools (Router and Query panels) only show when Studio is
loaded with `?tanstack-devtools` in the URL, using the library's
built-in `requireUrlFlag` setting. Once loaded, they stay available
while navigating within Studio, and a reload without the flag hides them
again.

Use a URL that doesn't redirect, for example
`/org/<slug>?tanstack-devtools` or `/project/<ref>?tanstack-devtools`.
The library reads the flag when the devtools mount, so a redirect that
drops the query string can hide them.

**If you've opened the devtools before**, the library has saved its
settings to localStorage, and those override the `config` prop. Turn on
**Require URL Flag** in the devtools Settings tab once, or delete the
`tanstack_devtools_settings` localStorage key.

## How to verify

- With no `tanstack_devtools_settings` in localStorage, run `pnpm
dev:studio` and open `/org/<slug>`: no TanStack trigger appears.
- Open `/org/<slug>?tanstack-devtools`: the trigger appears and opens
the panel. Click through to another page: it's still there.
- Reload without the flag: the trigger is gone.
- Production and test builds are unchanged.

---------

Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com>
Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-11-20 07:40:47 +00:00
Joshen Lim 4ce89b7090 Remove unnecessary guard in CLI login (#53707)
## Context

Resolves FE-5165

The CLI login screen could get stuck on the loading state and never
navigate to the device code view. Was happening due to two guards that
interact badly:
- `startedForSessionIdRef` stops the effect from sending a second POST
for the same `session_id`.
- An `isActive` flag, set to `false` in the effect cleanup, made the
POST handler ignore its result once the effect had been cleaned up.

It's seemingly a race condition issue as in my case I only ran into this
problem locally, but not on staging as `isActive` was getting flipped to
`false` and hence the UI never navigates to show the device code

Opting to remove the `isActive` guard and solely rely on
`startedForSessionIdRef.current` since the latter should be able to
handle this logic by itself

## To test
This one can only be tested locally i reckon
- [ ] Verify that you can login via CLI via `supabase login --profile
supabase-local`
2026-11-20 14:26:31 +07:00
Joshen Lim 21fa55ba0e Navigate away after deleting the open table when its tab was already pruned (#53710)
## Context

Table Editor E2E tests for context menu is failing on `deleting the open
table from its context menu closes its tab`
Likely a race condition happening as the test does passes sometimes, but
fails way too often. Fix is applied on `useCloseDeletedTableTab` to
navigate away after deleting the open table when tab was already pruned
2026-11-20 14:05:48 +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
Danny WhiteandJoshen Lim 98b197509e feat(studio): show Warehouse worker activity (#53574)
## Problem

The Warehouse report does not show worker starts or request performance.

## Solution

Add worker starts, worker start time, requests by method and request
duration below Capacity. Keep the API’s kind, result, method and status
labels visible. Durations use milliseconds.

| After |
| --- |
| <img width="1670" height="3362" alt="CleanShot 2026-11-18 at 13 41
47@2x"
src="https://github.com/user-attachments/assets/90f6c5ec-dc4c-4828-ba40-7242fa4c1b71"
/> |
| _The new “Worker activity” section._ |

## Review instructions

1. Open the [Studio staging
preview](https://studio-staging-git-dnywh-warehouse-report-workers-supabase.vercel.app)
with a staging project that has Warehouse access, then go to
**Observability > Warehouse**.
2. Check **Worker activity** below Capacity. Compare worker starts and
start time, then requests by method and request duration.
3. Change the period and refresh. Check that the labels distinguish the
returned worker kinds and request outcomes, and that missing
measurements stay distinct from zero.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-11-20 15:46:02 +11:00
Danny WhiteandJoshen Lim 8409c5d98f feat(studio): show Warehouse capacity (#53573)
## Problem

The Warehouse report does not show available worker capacity or why
requests are rejected.

## Solution

Add worker-slot usage alongside the slot limit, plus rejected requests
split by reason. Labelled measurements keep separate lines and missing
values stay visible as gaps.

| After |
| --- |
| <img width="1694" height="1842" alt="CleanShot 2026-11-18 at 13 38
04@2x"
src="https://github.com/user-attachments/assets/e480b83c-6c93-4b18-85e6-9a37caf304b0"
/> |
| _The new “Capacity” section._ |

## Review instructions

1. Open the [Studio staging
preview](https://studio-staging-git-dnywh-warehouse-report-capacity-supabase.vercel.app)
with a project that has Warehouse access, then go to **Observability >
Warehouse**.
2. Under **Capacity**, compare **In use**, **Active grants** and
**Pending grants** with **Limit**.
3. Check **Rejected requests** for labelled rejection reasons. Change
the period and refresh to check both charts update.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-11-20 15:46:02 +11:00
Danny WhiteandJoshen Lim 2372aa0fc2 feat(studio): show Warehouse query latency (#53570)
## Problem

The Warehouse report shows query activity and outcomes, but not how long
queries spend waiting or running.

## Solution

Add query-duration percentiles, worker-acquisition waits and
successful-query duration. Durations are shown in milliseconds, with
missing measurements kept distinct from zero. Latency loads separately
so a failed request does not hide query activity.

| After |
| --- |
| <img width="1678" height="1796" alt="CleanShot 2026-11-18 at 12 28
53@2x"
src="https://github.com/user-attachments/assets/48c6545e-8f2d-40c4-aa3c-977dd2ae6479"
/> |
| _New latency section._ |

## Review instructions

1. Open the [Studio staging
preview](https://studio-staging-git-dnywh-warehouse-report-latency-supabase.vercel.app)
with a staging project that has Warehouse access
([example](https://studio-staging-git-dnywh-warehouse-report-latency-supabase.vercel.app/dashboard/project/yirnfrgkxmnqgexikhfc/observability/warehouse?its=2026-11-18T00%3A23%3A52.901Z&ite=2026-11-18T01%3A23%3A52.901Z&isHelper=true&helperText=Last+60+minutes)),
then go to **Observability > Warehouse**.
2. Check **Query duration**, **Time waiting for a worker** and
**Successful query duration** below the query charts. Hover the lines to
compare timing measurements.
3. Change the date range and refresh. Both query activity and latency
should update.
4. Check the selected period without measurements. Empty or unavailable
data must remain distinct from measured zeroes.

Shared ChartLine accessibility changes are separate in #53706.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-11-20 15:46:02 +11:00
Joshen Lim df6eafef7c Joshenlim/fe 5116 support editduplicatedelete tables from (#53662)
## Context

We previously introduced context menus to the table editor
[here](https://github.com/supabase/supabase/pull/53506), but prevented
edit, delete, and duplicate actions as those actions were coupled to the
router. Hence this PR decouples that by making those actions target a
table by a provided ID

"More options" action now also shows on every row, just visibly shown
only if its active or the user hovers over the row
<img width="335" height="183" alt="image"
src="https://github.com/user-attachments/assets/9897945d-37f4-4658-9420-29b948173208"
/>

## To test

Can test edit / delete / duplicate table on a table that you're not
currently actively on, via both context menu and dropdown menu
2026-11-20 10:19:00 +07:00
anthony lio 3b12d2e167 feat(ui): switch component (#53379)
## Problem

* the shared switch in `packages/ui` uses the radix primitive
* the thumb does not react to hover or press, and only the track color
shows the state
* a click on a switch label toggles the switch, but the label keeps the
default cursor

## Solution

* replaces the radix switch with base ui, and keeps a native `<button>`,
so labels and `role="switch"` work as before
* changes the thumb to white and the resting track one step darker, so
the off state shows on light pages
* replaces the hover color change with a thumb stretch that grows more
on press, so the thumb reacts to the pointer
* adds a pointer cursor on labels next to an enabled switch, because a
click on the label toggles it
* removes the `PointerEvent` stand-in from the studio test setup,
because it blocks base ui switch clicks in jsdom
* changes the install step in the switch docs to `@base-ui/react`, so
the manual install matches the component

<!-- linear:table-colwidths:345,344 -->
<table>
<thead>
<tr>
<th></th>
<th>preview</th>
</tr>
</thead>
<tbody>
<tr>
<td>light</td>
<td>


https://github.com/user-attachments/assets/a7c33dda-3487-43b8-881b-344e28891650

</td>
</tr>
<tr>
<td>dark</td>
<td>


https://github.com/user-attachments/assets/9718057b-f983-4099-8f7e-82521001b625

</td>
</tr>
</tbody>
</table>

## Preview links

| Site | Live | Preview | Search for |
| -- | -- | -- | -- |
| Design system |
[/design-system/docs/components/switch](<https://supabase.com/design-system/docs/components/switch>)
|
[/design-system/docs/components/switch](<https://design-system-git-feat-switch-base-ui-supabase.vercel.app/design-system/docs/components/switch>)
| Airplane Mode |
| Studio |
[/dashboard/project/\_/storage/files](<https://supabase.com/dashboard/project/_/storage/files>)
|
[/dashboard/project/\_/storage/files](<https://studio-git-feat-switch-base-ui-supabase.vercel.app/dashboard/project/_/storage/files>)
| Public bucket |

## Review instructions

1. open
[/design-system/docs/components/switch](<https://supabase.com/design-system/docs/components/switch>)
and
[/design-system/docs/components/switch](<https://design-system-git-feat-switch-base-ui-supabase.vercel.app/design-system/docs/components/switch>)
side by side
2. hover and click the "airplane mode" label, and make sure that the
cursor is a pointer and the switch toggles
3. change the theme to light and to dark, and make sure that the thumb
stays white in the on and off states
4. scroll to the form example, and make sure that the disabled "security
emails" switch does not toggle or stretch
5. open
[/dashboard/project/\_/storage/files](<https://studio-git-feat-switch-base-ui-supabase.vercel.app/dashboard/project/_/storage/files>),
click "new bucket" and turn on "public bucket", and make sure that the
"public buckets are not protected" warning shows

## Checklist

Check all before review:

- [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>)
2026-11-19 21:32:09 +00:00
Gildas Garcia 4442d91d77 feat(studio): Wire org and users authorized apps list to backend (#53674)
## Description

Part of the work for OAuth apps with the scoped permissions. This PR
wires the org and users authorized apps lists to backend.
2026-11-19 21:40:12 +01:00