mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
docs/reference-template
943
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0b9e4f6ab1 |
fix(studio): clarify token access settings and SSL prerequisites (#54507)
## Problem - Token access confirmations use stilted copy. - The SSL prerequisite notice sits outside the Token access card, repeats “enabled”, and includes an unnecessary project reference. - SSL configuration also shows enforcement as off when the latest update failed, and its dependency tooltip needs clearer guidance. ## Solution - Rewrite the token access and SSL confirmations, keeping the connection warnings. - Group prerequisite notices inside the Token access card with one divider, remove the project reference, and simplify their descriptions. - Keep the SSL switch tied to the fetched configuration independently of update success. - Explain the token access dependency in the disabled switch’s tooltip: “Database token access requires SSL enforcement.” Leave the existing SSL failure warning unchanged apart from its final full stop. | Before | After | | --- | --- | | <img width="727" height="501" alt="CleanShot 2026-12-03 at 11 21 35" src="https://github.com/user-attachments/assets/9fd18a91-528a-47dd-82e8-7349e26a8daa" /> | <img width="736" height="506" alt="CleanShot 2026-12-03 at 12 05 57" src="https://github.com/user-attachments/assets/8263303a-49d8-4910-9c88-e2fe5ecc1c34" /> | | <img width="362" height="236" alt="CleanShot 2026-12-03 at 11 21 54" src="https://github.com/user-attachments/assets/026852d4-9c1b-4a9d-9833-02e047794199" /> | <img width="421" height="229" alt="CleanShot 2026-12-03 at 12 06 24" src="https://github.com/user-attachments/assets/9a53c459-c7ca-4c18-8567-499d67a9c068" /> | | <img width="420" height="206" alt="CleanShot 2026-12-03 at 11 22 36" src="https://github.com/user-attachments/assets/4d2f8711-fd75-4730-832f-ac9e2e3d85ad" /> | <img width="420" height="207" alt="CleanShot 2026-12-03 at 11 52 51" src="https://github.com/user-attachments/assets/2fce238e-c8d7-4087-8402-05c2122f92f0" /> | | <img width="420" height="208" alt="CleanShot 2026-12-03 at 11 32 11" src="https://github.com/user-attachments/assets/f081e782-0a6c-499a-947d-0da149311218" /> | <img width="417" height="219" alt="CleanShot 2026-12-03 at 11 52 05" src="https://github.com/user-attachments/assets/6b6cfcf5-2c54-4f38-9b16-bcc0cdd500a0" /> | | <img width="809" height="255" alt="CleanShot 2026-12-03 at 12 28 47" src="https://github.com/user-attachments/assets/19cffa41-691f-4f60-96b5-7ba1ebcfb78e" /> | <img width="804" height="246" alt="CleanShot 2026-12-03 at 12 44 39" src="https://github.com/user-attachments/assets/2c3f2b74-21a8-41e7-b25e-ea2293350fcc" /> | ## Review instructions 1. Open Project → Database → Settings in the preview for a project that requires SSL enforcement before token access. 2. Check that SSL enforcement required sits inside Token access, separated by one divider, with no project reference in its description. 3. Select Enable SSL enforcement and review the confirmation copy. Cancel without applying the change. 4. On a project where token access is available, toggle it on and off to review both confirmations. Cancel each dialog. 5. With token access on, check that SSL enforcement stays on and locked, with a tooltip explaining that database token access requires SSL enforcement. Check that the tooltip also opens on keyboard focus. 6. If the API reports an unsuccessful SSL update, check that the switch still reflects `currentConfig.database` and the existing warning remains visible. |
||
|
|
be27ad8cf5 |
feat(studio): show apps and confirm token access changes (#53917)
> [!WARNING] > This PR relies on #53705 being merged first. ## Problem Project admins need to see authorised apps before changing token access. [DEPR-734](https://linear.app/supabase/issue/DEPR-734) ## Solution - Show Apps below Members only when authorised apps exist; hide the section while loading or empty, and retain verification errors. - Show access levels and links to each app’s access sheet. - Include members and authorised apps in toggle confirmations; wait for complete counts and offer retry on errors. | After | | --- | | <img width="725" height="560" alt="CleanShot 2026-12-02 at 14 44 13" src="https://github.com/user-attachments/assets/6f033b2f-a8b4-4a64-824f-ef0cc270ff6c" /> | | No authorised apps (no empty state) | | <img width="728" height="773" alt="CleanShot 2026-12-02 at 14 11 31" src="https://github.com/user-attachments/assets/76b31461-abca-4f9a-b76d-bb664093dd67" /> | | Loading error | | <img width="727" height="749" alt="CleanShot 2026-12-02 at 14 38 34" src="https://github.com/user-attachments/assets/0722002c-a5cf-4877-b00b-15f9e4a6524c" /> | | 1× authorised app | | <img width="418" height="222" alt="CleanShot 2026-12-02 at 14 39 27" src="https://github.com/user-attachments/assets/db5cc89a-2099-4a6f-969c-b4e2c38ac972" /> | | Disabling token access whilst 1× app is relying on it | | <img width="424" height="387" alt="CleanShot 2026-12-02 at 14 39 58" src="https://github.com/user-attachments/assets/e15c1227-8190-42f4-876b-5f55a321848b" /> | | Re-enabling token access which will immediately restore access for N members and apps | ## Review instructions 1. Open the [staging preview](https://studio-staging-git-dnywh-depr-734-temporary-acc-b81819-supabase.vercel.app/dashboard), select a project you administer, and open **Database → Settings**. Enable database token access in **Feature previews**, plus `jitDbAccess` and `enableScopedOAuthManage` in the dev toolbar’s **Flags** tab if needed. 2. Open DevTools → **Console**, paste the setup below and run it. Navigate to another Studio page (possibly outside of Database) and back to **Database → Settings**, without reloading. Check **Test Partner App** appears under Apps with **Read and write** access. 3. Turn token access off. Check the confirmation includes the app, then choose **Cancel**. 4. Run `tokenAccessReview.state = 'disabled'` in Console, then navigate away and back. Turn token access on, expand **Who will regain access?**, check the app is listed, then choose **Cancel**. 5. Run `tokenAccessReview.state = 'enabled'; tokenAccessReview.fail = true`, then navigate away and back. Check the Apps error disables the toggle. Run `tokenAccessReview.fail = false` and choose **Retry apps** to recover. 6. Run `tokenAccessReview.apps = false`, then navigate outside Database and back. Check Apps is hidden once loaded. Reload to remove the setup. The setup mocks GET responses only, requires no app authorisation, and does not change saved access. Use **Cancel** in both confirmations. Do not reload between steps; reloading removes the setup. Network’s Response tab does not show these browser-generated responses. <details> <summary>Console setup</summary> ```js (() => { if (window.tokenAccessReview) throw new Error('Review setup is already active. Reload to reset it.') const projectRef = location.pathname.match(/\/project\/([^/]+)/)?.[1] if (!projectRef) throw new Error('Open a project’s Database Settings first.') const appId = '75e64165-b74e-432f-bb70-80d6ae432f06' const grantId = 'review-org-grant' const scopes = ['database_token_access:write'] const originalFetch = window.fetch const review = window.tokenAccessReview = { state: 'enabled', apps: true, fail: false } const approvals = /\/platform\/organizations\/[^/]+\/oauth\/approvals$/ const grants = new RegExp(`/platform/organizations/[^/]+/oauth/approvals/${appId}/grants$`) const page = (data) => Response.json({ data, links: { next: null, prev: null } }) window.fetch = function (input, init) { const url = new URL(input instanceof Request ? input.url : input, location.href) const method = init?.method ?? (input instanceof Request ? input.method : 'GET') if (method.toUpperCase() === 'GET') { if (url.pathname.endsWith(`/v1/projects/${projectRef}/jit-access`)) { return Promise.resolve(Response.json({ state: review.state, appliedSuccessfully: true })) } if (approvals.test(url.pathname)) { return Promise.resolve(page(review.apps ? [{ id: appId, type: 'oauth_app', attributes: { app: { name: 'Test Partner App', icon: null, created_by: null }, last_approved_at: '', target: 'organization', org_grant: { grant_id: grantId, approved_scopes: scopes, approved_at: '' }, }, }] : [])) } if (grants.test(url.pathname)) { if (review.fail) return Promise.resolve(Response.json({ message: 'Review: apps unavailable' }, { status: 500 })) return Promise.resolve(page([{ id: grantId, type: 'oauth_grant', attributes: { kind: 'organization_bound', user: null, approved_at: '', approved_scopes: scopes, projects: [{ ref: projectRef, name: 'Review project' }], }, }])) } } return originalFetch.call(this, input, init) } })() ``` </details> --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> |
||
|
|
59cddd41a9 |
feat(studio): group database access settings (#54350)
> [!WARNING] > This PR relies on #54282 being merged first. ## Problem Database password and token access appear as separate sections in Database Settings, although both control connections to Postgres. ## Solution Group the existing controls under **Database access**, with **Password access** first and the switch beside **Token access**. Nest **Members** inside the Token access card and label its action **Add member**. Preserve the existing feature gates, permissions, toggle behaviour, dialogs and section anchors. Use shared card headings for Members, centre the token switch beside its description, and darken the Members table header. Update the matching token-access and password-reset docs instructions. ```text Database access ├── Password access └── Token access [switch] └── Members [Add member] ``` | After | | --- | | <img width="735" height="818" alt="CleanShot 2026-12-01 at 15 56 50" src="https://github.com/user-attachments/assets/f1207a2f-80d5-480a-9529-e110b960f427" /> | | _App [token] access coming separately in https://github.com/supabase/supabase/pull/53917._ | ## Review instructions 1. Open a project's **Database → Settings** page. Check that **Database access** contains **Password access** first, with the existing **Reset database password** button. 2. With the database token access preview enabled, check that **Token access** has its switch on the same row and **Members** appears inside the same card when enabled. Check that **Add member** opens the existing access rule sheet. 3. Check the existing enable confirmation and password reset dialog. Projects requiring SSL enforcement or a Postgres upgrade should keep their existing notices and actions. |
||
|
|
30a1b38da0 |
feat(studio): rename temporary access to database token access (#54282)
## Problem The database access preview still uses “Temporary access” across its settings and member rules. ## Solution Use “Database token access” for the feature and “Member access” for member rules. Update the preview, settings, dialogs, feedback, member status messages and docs together. Move the guide to `/guides/platform/token-access`, permanently redirect the old URL, and preserve existing section anchors. ## Review instructions 1. Open [the Studio preview](https://studio-staging-git-dnywh-database-token-access-naming-supabase.vercel.app), then Feature previews and find **Database token access**. Enable the preview for a supported project, then open [Database Settings](https://studio-staging-git-dnywh-database-token-access-naming-supabase.vercel.app/project/_/database/settings). 2. Check the **Database token access** heading, **Allow token access** switch and **Member access** table. Open **Add rule** and an existing rule to check the sheet titles. Open a rule’s delete confirmation and cancel it. 3. With an assigned role, check the access status above the member table. As a member without management permission, check the access notice uses the same feature name. 4. Open the [database token access guide in the docs preview](https://docs-git-dnywh-database-token-access-naming-supabase.vercel.app/docs/guides/platform/token-access). Check the guide and navigation use the new name, the dashboard instructions match Studio, and the existing section links from the member guide still work. Open `/docs/guides/platform/temporary-access` and its `.md` variant to check they permanently redirect to the new URLs. | Before | After | | --- | --- | | <img width="726" height="367" alt="CleanShot 2026-11-30 at 16 06 00" src="https://github.com/user-attachments/assets/be351f0c-d578-4289-8785-5c4e69a254a7" /> | <img width="729" height="374" alt="CleanShot 2026-11-30 at 16 05 38" src="https://github.com/user-attachments/assets/f02b470d-ef1a-4b6c-bdbb-20fe10b847c6" /> | |
||
|
|
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> |
||
|
|
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> |
||
|
|
e3684c034c |
feat(studio): track usage on Project Settings: General (#54081)
## Problem Project Settings → General has almost no usage tracking. We can't tell how often users restart, pause, resume, or transfer projects from here. We also can't tell how often they copy the project ID or region, use the custom domain flow, or toggle high compliance mode. ## Solution Adds six PostHog events to `packages/common/telemetry-constants.ts`: `project_name_updated`, `project_settings_value_copied`, `project_lifecycle_action_submitted`, `project_compliance_mode_updated`, `custom_domain_step_submitted`, and `custom_domain_dns_record_copied`. Each event fires from the user's submit, confirm, copy, or toggle handler, never on render. Properties are only enums and booleans. No project names, domains, DNS record contents, or other typed values are sent. `ResumeProjectButton` is shared between settings and the paused-project home state, so it now takes a required `source` prop. The two call sites pass `settings_general` and `project_home`. Restart fires from the confirmation modal, with `restart_project` or `restart_database` depending on the chosen restart type. `DNSRecord` now types its `type` prop as `'CNAME' | 'TXT'`, so the copy event sends the record type as an enum. No `data-attr` attributes are added, because PostHog autocapture is off and they would not be collected. ## How to verify 1. On Project Settings → General, save a new project name. One `project_name_updated` event fires. 2. Copy the project ID, then the region. Each copy fires one `project_settings_value_copied` event, with `field` set to `projectRef` and then `region`. 3. Open the restart modal, then cancel it. No event fires. Confirm a restart (project or fast database reboot). One `project_lifecycle_action_submitted` fires with `action: restart_project` or `restart_database` and `source: settings_general`. 4. Confirm a pause, a resume, and a transfer. Each fires `project_lifecycle_action_submitted` with the matching `action`. A resume from settings sends `source: settings_general`; a resume from the paused project home page sends `source: project_home`. 5. Toggle high compliance mode. One `project_compliance_mode_updated` fires, with `isSensitive` set to the new value. 6. In the custom domain flow, Add, Verify, confirm Activate, and confirm Delete each fire `custom_domain_step_submitted` with `step` set to `configure`, `verify`, `activate`, and `remove`. 7. In the custom domain verification step, copy a DNS record's name, then its value. Each copy fires one `custom_domain_dns_record_copied` event, with `recordType` set to `CNAME` or `TXT` and `field` set to `name` and then `value`. ## Checks Ran `tsc --noEmit` in `apps/studio` and `packages/common`. Ran `eslint` (default config and `eslint.type-checks.config.cjs`) on the changed Studio files: no errors, only warnings that were already there. Ran `oxfmt --check` on all changed files. Ran `vitest run` on `General.test.tsx`, `Project.test.tsx`, `PauseProjectButton.test.tsx`, and `RestartServerButton.test.tsx`: all pass. ## Checklist - [x] I have read the [Contributing Guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] I have checked that the change works in the preview deployment ## Feedback for Tedd To ask Tedd for a change to this PR, reply in Tedd's session on [FE-5029](https://linear.app/supabase/issue/FE-5029/track-usage-on-project-settings-general). Tedd doesn't read comments on this PR. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com> |
||
|
|
39b359a70e |
chore: keep db partner roles out of picker (#54019)
## Problem Newly added trusted partner roles appear as user selectable / manageable. Resolves DEPR-735. ## Solution Trusted partner roles should not be selectable in temporary access. And should not appear as modifiable in the database roles tab. | Before | After | | --- | --- | | <img width="553" height="398" alt="CleanShot 2026-11-27 at 12 24 43" src="https://github.com/user-attachments/assets/14affc16-2f00-496f-a124-d918acd93bf0" /> | <img width="553" height="363" alt="CleanShot 2026-11-27 at 12 25 00" src="https://github.com/user-attachments/assets/de06002f-d063-453e-a9da-00eee8e0616d" /> | | _This partner role `this_is_a_test` shouldn’t be here._ | _Partner role `this_is_a_test` is no longer in the list of options._ | | <img width="940" height="305" alt="CleanShot 2026-11-30 at 10 34 52" src="https://github.com/user-attachments/assets/bdface9f-b3f4-4620-b567-cba8d829205e" /> | <img width="935" height="299" alt="CleanShot 2026-11-30 at 10 37 40" src="https://github.com/user-attachments/assets/da1abaa3-5a98-4837-9e8f-35be84b6be4c" /> | | _Previous definition._ | _Broadened definition to better encompass roles we generally manage ([context](https://github.com/supabase/supabase/pull/54019#discussion_r4716757425))._ | ## How to test 1. Open the [Studio staging preview](https://studio-staging-git-chore-depr-735-supabase.vercel.app) and select a staging test project. If **Temporary access** is off in **Feature previews**, enable it there. Then go to **Database → Settings → Temporary access** and make sure it is enabled for the test project. 2. Go to **Database → Roles**. Open Chrome DevTools, select **Network**, and reload. Filter for `key=database-roles`. Right-click the matching request and select **Override content**. 3. Append this test role to the roles array. Save the override and reload. ```json { "id": 99999, "name": "this_is_a_test", "isSuperuser": false, "canCreateDb": false, "canCreateRole": false, "inheritRole": true, "canLogin": true, "isReplicationRole": false, "canBypassRls": false, "activeConnections": 0, "connectionLimit": 90, "validUntil": null, "comment": "{\"_supabase\":{\"oauth_app_id\":\"app\"}}", "config": {} } ``` 4. In **Database → Roles**, make sure that `this_is_a_test` appears under **Supabase managed roles** without edit or delete controls. 5. Go to **Database → Settings → Temporary access**, select **Add rule**, and open the role picker. The test role should be absent. 6. Set the test role's `comment` to `null` in the override and reload. Open **Add rule** again and make sure that the role is now selectable. Close the form without saving and remove the override. --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com> |
||
|
|
27c4433a3e |
feat: revised project add-ons page (#54186)
The current add-ons page only lists a subset of available add-ons, which often causes confusion with things like Advanced MFA Auth (customers cant find where to configure it). The revised add-on page covers all potentially configured project add-ons including replicas and advanced disk. This should help the customer locate configured add-ons and at the same time discover potentially interesting add-ons. This can be enhanced further in the future with "smart" suggestions based on usage. |
||
|
|
15e95ab013 |
Joshenlim/fe 5242 jit db access show assigned role (#54214)
## Context Building on top of https://github.com/supabase/supabase/pull/54192, there was a missing piece to the JIT DB access UI which was showing the assigned access to the user if any (On staging it just shows an error, on the previous PR we show a "Contact your project admin" CTA). So this PR addresses that - there's a couple of cases to consider and I'd love for design to feedback / adjust as well as I'm not convinced this is the best way to do things. Am deliberately leaving out the "copyable connection strings" part for now as Danny's investigating into that one ### If you're a non-owner If not assigned a role: <img width="500" alt="image" src="https://github.com/user-attachments/assets/111d7c4f-0083-4bd5-88d5-ec45974ccf4d" /> If assigned a single role: <img width="500" alt="image" src="https://github.com/user-attachments/assets/1b4b1f3c-9a20-4010-bff8-7bf68a455e26" /> If assigned multiple roles: <img width="500" alt="image" src="https://github.com/user-attachments/assets/42cc66f6-4604-42eb-ab30-f58b1396ca6b" /> <img width="500" alt="image" src="https://github.com/user-attachments/assets/0914e1a3-9c7d-463e-851d-65f6b9793bb7" /> If (all) access expired: <img width="500" alt="image" src="https://github.com/user-attachments/assets/bda0fc65-e22a-49d9-b444-fc5d58a4745a" /> ### If you're an owner If not assigned a role: Status quo <img width="500" alt="image" src="https://github.com/user-attachments/assets/435abe70-ae88-49bb-86b9-7a03963b5b66" /> If yourself is assigned a role: <img width="500" alt="image" src="https://github.com/user-attachments/assets/9fafc74a-1a33-489e-a7da-70f57356a034" /> If yourself is assigned multiple roles: <img width="500" alt="image" src="https://github.com/user-attachments/assets/f4af901b-a24e-4272-b573-9ccb474bb7e2" /> If (all) access expired: Same as not assigned a role, just refer back to the table |
||
|
|
bef044891b |
Improve UI for JIT DB access for non owners + use proper perms check (#54192)
## Context For the Temporary database access feature preview, non project owners/admins are unable to view or manage the JIT db access section, but we currently don't guard properly against that. So this PR addresses this by showing an Admonition instead + guard the relevant react queries against the perms check to prevent unnecessary calls. We were also using `FGA_PERMISSIONS.PROJECT.ADMIN_WRITE` incorrectly as there's `FGA_PERMISSIONS.PROJECT.DATABASE_JIT_WRITE` that we can use ### Before <img width="788" height="602" alt="image" src="https://github.com/user-attachments/assets/90458c5a-5994-4812-abe1-17f0d3782f70" /> ### After <img width="836" height="284" alt="image" src="https://github.com/user-attachments/assets/ba08aa55-6b2a-49e5-8fc0-709c7b41cd72" /> |
||
|
|
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 🙏
|
||
|
|
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> |
||
|
|
76b8dfd2e5 |
chore: ssl enforcement doesn't restart db (#53860)
## Problem SSL enforcement currently warns that the database will be restarted. This is no longer the case. ## Solution SSL enforcement no longer restarts the database. Update references to indicate that only non-SSL enabled connections are disabled. Only display warning when enabling SSL enforcement. ## 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) |
||
|
|
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>
|
||
|
|
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" /> |
||
|
|
8fcd5e7f65 |
feat(studio): add Warehouse report date controls (#53494)
## Problem The Warehouse report only shows the last hour. ## Solution Add date selection and refresh using the shared report controls. Respect the organisation’s log retention limits and the metrics API’s 30-day maximum. | After | | --- | | <img width="1688" height="1050" alt="CleanShot 2026-11-18 at 11 35 24@2x" src="https://github.com/user-attachments/assets/88267bf8-1054-480b-ac26-c0c2b58386bc" /> | | _The new controls._ | | <img width="2420" height="1028" alt="CleanShot 2026-11-18 at 11 47 52@2x" src="https://github.com/user-attachments/assets/383c06a0-5470-4748-b9a6-fe80647a1399" /> | | _The standard retention upgrade prompt follow tapping either of these on a Pro plan._ | ## Review instructions 1. Open the [Studio staging preview](https://studio-staging-git-dnywh-warehouse-metrics-range-supabase.vercel.app) and select a staging project with Warehouse access. 2. Open **Observability > Warehouse**, or `/project/<ref>/observability/warehouse` ([example](https://studio-staging-git-dnywh-warehouse-metrics-range-supabase.vercel.app/dashboard/project/yirnfrgkxmnqgexikhfc/observability/warehouse)). Change Last 60 minutes to Last 24 hours and check that the chart or no-data state reflects the selected period. 3. Refresh the report. Check that the selected period stays selected. 4. On a paid staging organisation, select a period beyond its log retention (for example, Last 14 days with 7-day retention). Check that the retention upgrade prompt appears and the current period stays selected. --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> |
||
|
|
c6a3a23dfb |
feat(studio): track free project limit blocks on downgrade and transfer (#53460)
Studio blocks a downgrade to the Free Plan and a project transfer when a member would exceed their free project limit, and neither block is tracked. This adds one event for each so we can count how often people hit them. No UI change. **Changed:** - **Downgrade blocked**: `studio_billing_downgrade_blocked_modal_opened` fires when confirming a downgrade opens the "members have exceeded their free project limits" modal. It sits in `CancellationFlow`, so it covers both the Cancel subscription button and the plan side panel. - **Transfer blocked**: `project_transfer_preview_failed` fires when the transfer preview for the selected target organization comes back with members over the limit, once per preview. A refetch that returns the same data does not fire it again. **Note:** the transfer event fires from an effect on the preview data. The notice appears when that data arrives, so there is no click handler to attach it to. ## To test Needs an organization on a paid plan with a running project, where an owner or admin already has the maximum number of free projects in other organizations. Tested on the PR preview: - [ ] Go to the org billing page, click "Cancel subscription" and confirm the downgrade, expect the members-exceed-limit modal and one telemetry request with action `studio_billing_downgrade_blocked_modal_opened` carrying `currentPlan` and `membersExceedingLimitCount` - [ ] Open the plan side panel, pick the Free Plan and confirm, expect the same modal and one more `studio_billing_downgrade_blocked_modal_opened` request - [ ] In project settings > General, click "Transfer project" and select a Free Plan target organization, expect the "Project cannot be transferred" notice listing members and one telemetry request with action `project_transfer_preview_failed` carrying `sourcePlan`, `targetPlan` and `membersExceedingLimitCount` - [ ] Edge case: with the notice showing, switch to another browser tab and back, expect no additional `project_transfer_preview_failed` request ## Linear - fixes GROWTH-1510 |
||
|
|
f4d8252427 |
Improve postgres upgrade warning for pipelines (#53359)
## Context For upgrading a project's Postgres version, the eligibility check returns blockers if a project has active pipelines running. However, the notices are currently confusing and not actionable from a user's POV for these reasons: - The warnings mention the slot name in the title, but as a user i've no idea what slot names these are referring to - There's no CTA as a user to action on to unblock myself - There's multiple warnings due to each replication slot that the pipelines take up, although they all point to the same reason that pipelines just needs to be stopped before upgrading - Example here if i have 3 active pipelines: I get 10 warnings here <img width="500" alt="image" src="https://github.com/user-attachments/assets/c4d99cd4-df3b-4e8e-90cd-896c0f2fa52b" /> Am opting to consolidate all Pipelines related upgrade warnings into just one row as such, by grouping them if the upgrade eligibility error type is `active_replication_slot` and the slot name begins with `supabase_etl_`. Added a "Manage" CTA as well that brings users to the Pipelines page <img width="799" height="234" alt="image" src="https://github.com/user-attachments/assets/50a0c64a-6afe-44e2-9bf8-a21e8ecfc47a" /> Also small nit but this PR fixes the weird list decorator in the rows too <img width="165" height="81" alt="image" src="https://github.com/user-attachments/assets/8c0a0ff6-225f-48d1-a25f-8ffa9e65533c" /> |
||
|
|
79e7836a5a | feat(pipelines): Add support for unknown destination (#53272) | ||
|
|
0ed90ae460 |
fix(ui): split button divider (#53258)
## Problem - in dark mode split button shows a middle divider that is lighter and heavier than the outer edge, and the design system `button-split-dropdown` example has the same bug - button edge is a translucent inset shadow over a translucent fill, so the `-ml-px` overlap stacks two edges and two fills in one column - light mode has the same defect on hover and with the menu open, because the hover fill is translucent too ## Solution - adds a `SplitButtonGroup` component to `ui`, so a split button has a `role="group"` wrapper and one shared divider - fixes the divider color in both themes, because only one button paints the shared border column - changes the shared column to follow the hovered button, so the divider takes its edge color in a fixed place - removes the press scale from buttons in the group, so no gap opens between the two buttons - changes the design system split button docs to `SplitButtonGroup` | before | after | | -------|------| | <img width="428" height="219" alt="image" src="https://github.com/user-attachments/assets/4cbc5dc9-3575-4eef-83b9-a6141796ccc8" /> | <img width="428" height="219" alt="image" src="https://github.com/user-attachments/assets/9c5b283d-e6bd-428a-bee1-7f59249aeb83" /> | | <img width="428" height="219" alt="image" src="https://github.com/user-attachments/assets/046338f9-6dfd-4c32-8e33-30c1b0f84715" /> | <img width="428" height="219" alt="image" src="https://github.com/user-attachments/assets/c79e1c7a-e1ac-4682-a898-1a36c6b028fc" /> | <!-- ## 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 the [/design-system/docs/components/button](https://design-system-git-antlio-fix-split-button-divider-supabase.vercel.app/design-system/docs/components/button#split-with-dropdown) preview in dark mode, and zoom in on the split example 2. make sure that the divider has the same color and weight as the outer edge 3. hover the primary action, and make sure that the divider takes its edge color and stays in the same place 4. hover the chevron and open the menu, and make sure that the divider takes the chevron edge color 5. switch to light mode, and repeat steps 2 to 4 6. press and hold the primary action, and make sure that it does not shrink 7. tab to the chevron, and make sure that the focus ring shows on all four sides and that Enter opens the menu 8. open the [/design-system/docs/fragments/admonition](https://design-system-git-antlio-fix-split-button-divider-supabase.vercel.app/design-system/docs/fragments/admonition#split-button-with-dropdown) preview at a narrow width, and make sure that the split fills the row with one divider 9. open the [/dashboard/project/\_/settings/log-drains](https://studio-git-antlio-fix-split-button-divider-supabase.vercel.app/dashboard/project/_/settings/log-drains) preview, and make sure that the `primary` split looks the same as on master ## 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) |
||
|
|
36e8bda235 |
fix(studio): align deletion panels (#53190)
## Problem Account, project and organisation deletion settings use different warning layouts and action placement. In the organisation panel, the button sits inside the admonition description, so it stays below the copy at wide widths. ## Solution ```text Delete account / project / organisation └─ Danger admonition ├─ Consequence and supporting copy └─ Action below the copy at narrow widths, beside it at wide widths ``` Standardise the affected settings section descriptions and preserve the Vercel Marketplace action for partner-managed organisations. The account confirmation flow is reviewed separately in #52350. Both PRs target `master`. | Before | After | | --- | --- | | <img width="1458" height="484" alt="CleanShot 2026-11-10 at 14 15 06@2x" src="https://github.com/user-attachments/assets/2e7e627d-5079-464c-b7ef-51b93ca62e9a" /> | <img width="1450" height="410" alt="CleanShot 2026-11-10 at 14 13 15@2x" src="https://github.com/user-attachments/assets/88cdcd4a-463c-47be-9c95-3eab172bed29" /> | | <img width="1462" height="430" alt="CleanShot 2026-11-10 at 14 14 51@2x" src="https://github.com/user-attachments/assets/84109e7e-2e42-4252-9f1b-9760ded1f2e7" /> | <img width="1452" height="392" alt="CleanShot 2026-11-10 at 14 13 37@2x" src="https://github.com/user-attachments/assets/d2238d64-5a32-456f-addc-6fd3ce1de1fe" /> | | <img width="1868" height="394" alt="CleanShot 2026-11-10 at 14 15 22@2x" src="https://github.com/user-attachments/assets/a2ab7a9d-2d79-46fc-b600-ace07e098e55" /> | <img width="1872" height="412" alt="CleanShot 2026-11-10 at 13 26 40@2x" src="https://github.com/user-attachments/assets/fad70041-d0ea-4da6-b429-2b2fc39d2103" /> | ## Review instructions 1. Open the deletion sections in **Account preferences**, a project's **Settings → General** and an organisation's **General settings**. 2. At narrow and wide widths, check that the buttons sit below and beside the copy respectively. 3. For a Vercel-managed organisation, check that the panel still directs users to Vercel Marketplace. 4. In project and branch general settings, check the updated punctuation in the affected section descriptions. |
||
|
|
44573b7a5c |
feat(studio): rename Advisors to Issues in navigation (#52993)
Part 5 of 6: #52989 → #52990 → #52991 → #52992 → #52993 → #53138 Switches Studio navigation between Advisors and Issues with `issuesInbox`. With the flag off, the existing Advisors sidebar, pages, command menu entries, shortcuts, header panel, and contextual finding links remain available. With it on, these entry points show Issues and legacy Advisor URLs forward to the matching Issues category while preserving finding context. Direct Issues routes remain accessible in either state. The homepage section remains hidden when the flag is off. Telemetry event names are unchanged. ## How to test 1. Turn `issuesInbox` off: desktop and mobile navigation show Advisors, the header opens Advisor Center, and Security, Performance, and enabled Health Advisor pages remain usable. 2. Turn it on: navigation and the header show Issues. Legacy Advisor category URLs forward to matching Issues lists. 3. `G` then `V` opens the active variant. `V` then `S`, `P`, or `H` follows the active category links; shortcut reference labels match. 4. Table Editor finding links open the legacy finding when off and its issue when on. 5. Direct Issues routes remain usable with the flag off; the homepage section stays hidden. ## Validation - Broad navigation/layout/redirect/shortcut regression suite: 456 tests passed, retries disabled. - Focused suite: 181 tests passed with shuffle seed 52993, retries disabled. - Full Studio TypeScript, scoped ESLint, and changed-file Prettier pass. - Behavioral mutation probes detect broken flag guards, finding links, and redirect destinations; source restored afterward. [DEBUG-255](https://linear.app/supabase/issue/DEBUG-255/replace-advisor-terminology-with-issues-throughout-studio) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Jordi Enric <jordi.err@gmail.com> |
||
|
|
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. |
||
|
|
c920e07d9c |
feat(studio): review a pending network restrictions change (#52984)
## Problem A network restrictions change that was never applied can now wait for the customer's review ([API Docs](https://api.supabase.com/api/v1#tag/projects/POST/v1/projects/{ref}/network-restrictions/review), [CTRL-1934](https://linear.app/supabase/issue/CTRL-1934)). Studio doesn't show it. Lists with an entry that isn't a valid IP range also fail to save without saying which entry is wrong. ## Solution - A change in review shows one callout with **Apply change** and **Discard change**, and both lists together: added entries in green, removed ones in red. Editing is disabled until it's resolved, and discarding asks for confirmation. Only the change on screen is resolved (`pending_requested_at`). - A list the worker is still applying shows as applying and is polled, instead of showing the "not applied correctly" error. - Entries that aren't valid ranges are marked Invalid with a suggested correction, and can be saved corrected. The add dialog rejects IPv4-mapped IPv6 addresses and finds duplicates spelled differently. There's no way to create a review yet: a change only ends up in review when the backend fails to apply a list. I tested the review state locally by editing the database directly. Stacked on #53046, which syncs the API types with production, including the review endpoint. This PR will be retargeted to `master` once that merges. ## Screenshots <img width="712" height="473" alt="Screenshot 2026-11-04 at 5 10 19 PM" src="https://github.com/user-attachments/assets/c72cc38d-f7b4-4269-a787-f27dfe382086" /> ### If pressing `apply` <img width="704" height="150" alt="Screenshot 2026-11-04 at 5 19 27 PM" src="https://github.com/user-attachments/assets/92dce8e5-8d58-48b8-8899-ed01c9f242c2" /> ### If pressing `discard` <img width="712" height="473" alt="Screenshot 2026-11-04 at 5 10 38 PM" src="https://github.com/user-attachments/assets/85656004-d510-4cef-89c1-80d9f95ebb83" /> ### Invalid <img width="754" height="596" alt="Image" src="https://github.com/user-attachments/assets/4ba480f6-af4c-4253-9693-2c545fb77ab1" /> ### Invalid repair <img width="704" height="680" alt="Screenshot 2026-11-04 at 6 03 20 PM" src="https://github.com/user-attachments/assets/ed4e3dcf-8d9b-4588-afc0-938248c78712" /> ### Invalid and Pending <img width="704" height="593" alt="Image" src="https://github.com/user-attachments/assets/7ad76b50-0d08-4505-89ad-b6afff6865af" /> ### Invalid and Pending repair <img width="704" height="585" alt="Screenshot 2026-11-04 at 6 05 04 PM" src="https://github.com/user-attachments/assets/b123453f-0f30-452d-b84c-a556c52458a0" /> ## Review instructions 1. Locally, put a project's network restrictions into review by editing the database directly. There's no API that creates one. 2. Open Database Settings > Network restrictions and check the callout and the added and removed entries. 3. Apply or discard the change. ## 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) |
||
|
|
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) |
||
|
|
fe7b3ad6af |
chore: bump @graphql-codegen and its deps (#52785)
## Problem `@graphql-codegen/cli` and related packages in `apps/studio` and `apps/docs` were pinned to old major versions (`cli` 5.0.5, `typescript` 4.1.6, `typescript-resolvers` 4.5.0). ## Solution - Bump `@graphql-codegen/cli` to `^7.0.0` and `@graphql-codegen/typescript-resolvers` to `^6.0.0`. Drop the explicit `@graphql-codegen/typescript` dependency from `apps/docs`. - Regenerate the Studio GraphQL output in `apps/studio/data/graphql/` with the new codegen. The generated files now include an `index.ts` export change, and `graphql.ts` is much smaller. - Refresh `apps/studio/scripts/schema.graphql`, which picks up the new `ManagementApiReference` search result type. - Update `.prettierignore` (ignore `apps/studio/.output`, `apps/studio/dist`, and all of `apps/ui-library/public`) and run Prettier on the regenerated files. ## Review instructions 1. Check the dependency bumps in `apps/studio/package.json` and `apps/docs/package.json`. 2. Re-run the Studio codegen and confirm it produces no diff in `apps/studio/data/graphql/`. 3. Run `pnpm typecheck` and confirm the GraphQL consumers in Studio still compile. ## 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) --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
e05ef0e50c |
fix(studio): use API collation warning for read replica eligibility (#53049)
## What
Read replica eligibility now uses the `collation_reindex_required`
warning returned by the upgrade eligibility endpoint
(`/v1/projects/{ref}/upgrade/eligibility`) to decide whether to block
replica creation, instead of reimplementing the collation lineage
boundary check in Studio.
- Removes `CollationLineage.utils.ts` and its tests.
- `useCheckEligibilityDeployReplica` sets `isCollationLineageCrossed`
when the response includes a `collation_reindex_required` warning.
## API types
Regenerated `packages/api-types` from the production specs so the new
warning type is available. The regen also picks up other recent API
changes, which Studio now handles so typecheck passes:
- `PROMOTING` project status: added labels in `BranchStatusBadge` and
the dev toolbar's `ProjectStatusTab`.
- `table_using_reg_type` upgrade validation error (tables with columns
using `reg*` types that `pg_upgrade` can't carry over): added a title,
description, and Manage link to the table in `UpgradeWarnings`.
## Testing
- Studio typecheck passes (the one remaining error, in `ui-patterns`
McpUrlBuilder, is also on `master`).
- Read replica and infrastructure settings unit tests pass.
|
||
|
|
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" /> |
||
|
|
b5d9f22f14 |
fix(studio): handle unknown upgrade warning types (#52775)
Fixes a page crash on Project Settings > General. The upgrade
eligibility API now returns a warning type
(`collation_reindex_required`) that Studio doesn't handle, so
`getWarningLink` returned `undefined` and `<Link href={undefined}>`
threw in `resolveHref`, taking the page down via the global error
boundary.
**Changed:**
- Added `default` cases to the warning title, description, and link
helpers in `UpgradeWarnings.tsx`. Unknown warning types now show generic
copy and link to the specific upgrade notes section of the docs, rather
than being hidden or crashing.
**Added:**
- `UpgradeWarnings.test.tsx`, covering a known warning type and an
unknown one. The unknown case failed with `href` undefined before this
change.
**Not in this PR:**
- Dedicated copy for `collation_reindex_required`. That needs
regenerated `api-types` and an upgrade guide section, which doesn't
exist yet.
- Open tabs on old bundles keep crashing until they reload, since this
fix only reaches new bundles.
## To test
- Open Project Settings > General on a project whose
`/upgrade/eligibility` response includes `collation_reindex_required`.
The page should load and show "Review the upgrade notes before
upgrading".
- Check that "Read upgrade notes" goes to the specific upgrade notes
section of the upgrading guide.
- Check that a known warning type, such as `ltree_reindex_required`,
still shows its own copy and link.
Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
|
||
|
|
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.
|
||
|
|
53e2c4f1d1 |
[FE-4809] fix(studio): group HA topology by shardRef (#52545)
Update HA topology grouping for the Multigres JSON field rename from `shardKey` to `shardRef`, so separate shards retain their own primaries and replicas. **Changed:** - Normalize pooler responses to `shardRef`, falling back to legacy `shardKey` and preferring `shardRef` when both exist. - Use `shardRef` in the topology selector and shard grouping. **Added:** - Regression coverage from response parsing through diagram node/edge generation for new, legacy, mixed, and conflicting key formats, plus omitted shard identity fields. Addresses https://linear.app/supabase/issue/FE-4809/update-studio-ha-topology-grouping-to-use-shardref ## To test - Open Settings → Infrastructure on a multi-shard HA project returning `shardRef`. Confirm one group per shard, each primary shown as Primary Database, and replicas connected only to their own shard's primary. - Check the same topology on Database → Pipelines. - Confirm legacy `shardKey` responses still render correctly and single-shard projects remain unchanged. ## Validation - Passed: 33 targeted utility tests, ESLint on all changed files, Studio TypeScript check, and diff whitespace checks. - Local browser: login and non-HA infrastructure passed. HA grouping remains unverified because local poolers/gateways endpoints returned 404; browser response mocking was blocked by cross-origin/CORS limitations. - Upstream multigres/multigres#1608 merged October 29; deployment of the renamed field remains unconfirmed. Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> |
||
|
|
9b7cbd1803 |
feat(studio): migrate branches to FGA grants with production/development variants (#52331)
## Problem Branch actions in Studio were guarded by hand-written permission checks (`useAsyncCheckPermissionsV2(FGA_PERMISSIONS.PROJECT.BRANCHING_*)`, plus one legacy `useAsyncCheckPermissions` in `Branch.Commands.tsx`) that weren't tied to the endpoints they protect. Every branches request in `data/branches` was marked `unguarded.migrating`. This is the pilot migration for endpoint-bound FGA grants. Resolves [FE-4693](https://linear.app/supabase/issue/FE-4693/pilot-migrate-branches-to-grants-8-endpoints-createbranchmodal). ## Solution ### Data layer * `data/branches` has no `unguarded.migrating` left (was 10). * The list, detail, and diff queries are now `branchesQueryOptions`, `branchQueryOptions`, and `branchDiffQueryOptions`. They take a grant, use `skipToken` without one, and keep the grant out of the query key. * Mutations take the grant in their variables. The merge mutation also takes `diffGrant`, because it reads the diff before merging. ### Production and development variants The backend doesn't treat development and production branching permissions as interchangeable: * Actions on a single branch (`/v1/branches/{branch_id_or_ref}` and its diff, merge, push, reset, and restore) need the production permission for the default branch and the development permission for preview branches. * Creating a default branch or a branch with data needs production create. To model this, `lib/fga-refinements.ts` gets its first entries: * The 8 single-branch endpoints have `production` and `development` variants. A new `variantRequired` flag makes the fetch wrapper reject a grant without a variant, at compile time and in `assertGrant`. * `POST /v1/projects/{ref}/branches` has a `production` variant. `assertGrant` requires it when the body sets `is_default` or `with_data`. * `useBranchGrant(endpoint, { projectRef, isDefault })` picks the variant from the branch's `is_default`. It stays `loading` until the branch is known. * `GrantForVariants<M, P>` types a grant for any of an endpoint's variants. ### UI * The old checks are replaced with grants in `CreateBranchButton`, `CreateBranchModal`, `Overview`, `DeleteBranchPanel`, `DeleteBranchModal`, the branches and merge-requests pages, and `Branch.Commands.tsx`. * Grants are evaluated against the parent project, where branch permissions live. The scope is passed explicitly, because `/v1/branches/*` paths don't include the project. * Pages that are mainly about branches show `NoPermission` when the grant is denied and `AlertError` when the permission check fails. Action buttons are disabled with a tooltip. Places that use the branch list incidentally (nav, project home, usage) treat a denied grant as "no branches" instead of loading forever. * "Include data" in `CreateBranchModal` is disabled without production create. It previously failed after submitting. * `OutOfDateNotice`'s "Update branch" is disabled without the push grant. It previously did nothing. * The GitHub integration form blocks saving without the production-branch grant. Previously the connection was saved while the branch request failed, and a repo change deleted the old connection first. ### Where the old checks differed from the backend * **Too strict:** the branches and merge-requests pages required development read, and the create button required development create. The backend accepts development or production for both. * **Wrong for the default branch:** single-branch actions always checked development permissions, or production write for the main branch menu, regardless of which branch was targeted. * **Missing:** reset and "Switch to persistent" in `Overview` had no check. * **Legacy check:** `Branch.Commands.tsx` used the legacy `CREATE preview_branches` check. `BranchingPITRNotice` is unchanged: its check guards a subscription update, not a branches request. ### Other changes * The two new query options use an `eslint-disable` for `@tanstack/query/exhaustive-deps`, because grants stay out of query keys. A separate PR upgrades the plugin and allowlists `grant`, after which these can be removed. * `upsertMigration` in the merge mutation still uses `unguarded.migrating`. It belongs to the database-migrations domain. ## Testing * New component tests for `CreateBranchButton`, `DeleteBranchPanel`, the branches page, and `GitHubIntegrationConnectionForm` cover granted, denied, and error states. * New `useBranchGrant` tests: default vs. preview branch, and loading until the branch is known. * `guarded-fetch.test.ts` covers required variants (types and runtime) and the production variant for default and data branches. * Shared fixtures are in `tests/lib/branch-test-utils.ts`. * Studio typecheck passes, affected suites pass, the ESLint ratchet is stable, and knip is clean. |
||
|
|
7bb6e13aa8 |
Include existing postgres config params in PUT payload (#52675)
## Context The PUT `database/postgres` endpoint does a full resource override for the project's Postgres config. The only surface in the dashboard that does requests to PUT `database/postgres` is under Database -> Settings -> Log connections, but the dashboard only sends `log_connections` and `log_disconnections` when updating the settings here, resulting in existing config values being over written. Fix here is to merge the existing Postgres config values in the PUT payload |
||
|
|
8be85ad4ad |
feat(studio): guard branch update and push with FGA grants (#52377)
Part 6 of 7 in a stack that splits #52331 into reviewable pieces. Resolves part of [FE-4693](https://linear.app/supabase/issue/FE-4693/pilot-migrate-branches-to-grants-8-endpoints-createbranchmodal). There are no functional changes beyond #52331, and the top of the stack is identical to it. See #52331 for the full rationale. ## Stack 1. #52372 Grant infra for branch variants 2. #52373 Branches list query 3. #52374 Page gates on the list grant 4. #52375 Branch creation 5. #52376 Branch read, delete, reset, and restore 6. 👉 #52377 Branch update and push 7. #52378 Branch diff and merge ## Changes The update and push mutations take grants. `Overview` (including "Switch to persistent", which previously had no check), `EditBranchModal`, `SwitchToPreviewModal`, `MergeRequestButton`, the merge-requests page, and the merge page use `useBranchGrant`. The "Update branch" button in `OutOfDateNotice` is disabled without push; previously it did nothing. The GitHub integration form blocks saving without the production-branch grant. Previously the connection was saved even when the branch request failed. ## Testing New `GitHubIntegrationConnectionForm` test. |
||
|
|
4810bbcfdf |
feat(studio): guard branch read, delete, reset, and restore with FGA grants (#52376)
Part 5 of 7 in a stack that splits #52331 into reviewable pieces. Resolves part of [FE-4693](https://linear.app/supabase/issue/FE-4693/pilot-migrate-branches-to-grants-8-endpoints-createbranchmodal). There are no functional changes beyond #52331, and the top of the stack is identical to it. See #52331 for the full rationale. ## Stack 1. #52372 Grant infra for branch variants 2. #52373 Branches list query 3. #52374 Page gates on the list grant 4. #52375 Branch creation 5. 👉 #52376 Branch read, delete, reset, and restore 6. #52377 Branch update and push 7. #52378 Branch diff and merge ## Changes `useBranchQuery` becomes `branchQueryOptions`. The delete, reset, and restore mutations take grants. `DeleteBranchModal`, `DeleteBranchPanel`, and the relevant `Overview` actions use `useBranchGrant`, which picks production for the default branch and development for preview branches. Reset previously had no check. ## Testing New `DeleteBranchPanel` test. |
||
|
|
cd0b65c03e | feat(logs): Add Pipelines to unified logs and rename ETL to Pipelines (#52555) | ||
|
|
1915615dca |
fix: clamp Popover/Select/DropdownMenu content to viewport height (#49233)
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Bug fix. ## What is the current behavior? Fixes #49155. The three dropdowns in the issue (Edge Function Logs Severity filter, and the two dropdowns in the "Add foreign key relationship" modal) all get clipped by the viewport with no way to scroll to the rest of the content, in some cases making buttons unreachable. All three share the same root cause: `PopoverContent`, `SelectContent`, and `DropdownMenuContent` in `packages/ui/src/components/shadcn/ui/` each cap their max height with either a hardcoded pixel value (`max-h-96`, `max-h-[300px]`) or nothing at all, instead of using the available-height CSS variable Radix's Popper already computes and exposes for exactly this purpose. When the real available space is smaller than the hardcoded cap, the content still renders at the larger size and overflows past the edge of the screen. ## What is the new behavior? Swapped the fixed `max-h-*` values for the matching `--radix-*-content-available-height` variable on all three components, and changed `overflow-hidden` to `overflow-y-auto` so any content that still doesn't fully fit gets an internal scrollbar instead of clipping off-screen. ## Additional context **On verification:** I wasn't able to get an actual visual click-through of this fix. Locally, `apps/design-system` (the component demo site) hits a known contentlayer2 issue on Windows that leaves every `/docs/*` page 404ing regardless of this change. The CI preview deployment for `design-system` did build successfully, but it's gated behind Vercel SSO (team-only), which I don't have access to as an external contributor. What I did verify directly: - `pnpm --filter=ui typecheck` passes clean. - The three CSS variable names I'm referencing (`--radix-select-content-available-height`, `--radix-popover-content-available-height`, `--radix-dropdown-menu-content-available-height`) are real — confirmed by reading the installed `@radix-ui/react-select`, `@radix-ui/react-popover`, and `@radix-ui/react-dropdown-menu` source directly, where each one aliases its own variable to the underlying `--radix-popper-available-height` that Popper computes. - Compiled the exact new classes through this repo's pinned Tailwind version (4.2.4) via `@tailwindcss/postcss` directly, and confirmed each one generates the expected rule, e.g. `.max-h-\(--radix-popover-content-available-height\) { max-height: var(--radix-popover-content-available-height); }` — so there's no syntax mistake in the arbitrary-value class. Happy to have someone with repo access check the design-system preview, or I can revisit this once I have another way to view it. There's also a fourth spot in the report — the Severity filter's option list (`packages/ui-patterns/src/FilterBar/DefaultCommandList.tsx`), which hardcodes its own `max-h-[300px]` on an inner div rather than the `PopoverContent` primitive directly. That div renders inside the now-fixed `PopoverContent`, so it may already be covered by this change since CSS custom properties inherit to descendants — but since I couldn't confirm that visually either, I've left it untouched for now rather than guess. --------- Co-authored-by: Drew McLellan <drew.mclellan@gmail.com> |
||
|
|
19aa27384a |
feat(studio): guard branch creation with FGA grants (#52375)
Part 4 of 7 in a stack that splits #52331 into reviewable pieces. Resolves part of [FE-4693](https://linear.app/supabase/issue/FE-4693/pilot-migrate-branches-to-grants-8-endpoints-createbranchmodal). There are no functional changes beyond #52331, and the top of the stack is identical to it. See #52331 for the full rationale. ## Stack 1. #52372 Grant infra for branch variants 2. #52373 Branches list query 3. #52374 Page gates on the list grant 4. 👉 #52375 Branch creation 5. #52376 Branch read, delete, reset, and restore 6. #52377 Branch update and push 7. #52378 Branch diff and merge ## Changes The create mutation takes a grant. `CreateBranchButton`, `CreateBranchModal`, and `Branch.Commands` (legacy `CREATE preview_branches`) switch to `useGrant('POST /v1/projects/{ref}/branches')`. "Include data" is disabled without production create; previously it failed after you submitted. The GitHub integration form gets a minimal production-create guard, which ##52377 replaces. ## Testing New `CreateBranchButton` test. |
||
|
|
ce52277546 |
feat(studio): migrate branches list query to FGA grants (#52373)
Part 2 of 7 in a stack that splits #52331 into reviewable pieces. Resolves part of [FE-4693](https://linear.app/supabase/issue/FE-4693/pilot-migrate-branches-to-grants-8-endpoints-createbranchmodal). There are no functional changes beyond #52331, and the top of the stack is identical to it. See #52331 for the full rationale. ## Stack 1. #52372 Grant infra for branch variants 2. 👉 #52373 Branches list query 3. #52374 Page gates on the list grant 4. #52375 Branch creation 5. #52376 Branch read, delete, reset, and restore 6. #52377 Branch update and push 7. #52378 Branch diff and merge ## Changes `useBranchesQuery` becomes `branchesQueryOptions`, which takes a grant, uses `skipToken` without one, and keeps the grant out of the query key. Every call site moves to `useGrant('GET /v1/projects/{ref}/branches')`. Places that use the list incidentally (nav, project home, usage, settings, GitHub status) treat a denied grant as "no branches" instead of loading forever. Config drift no longer stays pending when its prerequisites fail. Page gating is unchanged here and moves in the next PR. ## Testing Usage, General, `useGitHubConfigDrift`, and ConfigurationDriftPage tests. |
||
|
|
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 |
||
|
|
5d52b00f70 |
feat(studio): combine function invocations and logs (#50957)
With the unified logs preview on, an edge function's Logs tab renders the unified logs view scoped to that function (#50954), with its invocations and runtime output in one list. That replaces the separate Invocations and Logs tabs. - `UnifiedLogs` takes a `scope` plus view props: `hasFilterSideBar`, `offeredFilters` and `columnPreferencesKey`. The function Logs tab turns the sidebar off, which also drops the filters-toggle shortcut, and saves its columns and panel layout separately from the Logs page. - `getEdgeFunctionLogsScope` and `EDGE_FUNCTION_LOGS_VIEW` are the edge function preset: the scope's fixed filters, the filters the tab offers and its saved-columns key. It offers date, log type, level and message, so no user filter, since no function row has a user. - The Invocations tab and its shortcut are hidden. Old Invocations links redirect to Logs, converting `its`/`ite`/`log` to `date`/`id`. - `getEdgeFunctionLogsUrl` builds links into the scoped tab with the shared params serializer from #50953, and clicking a bar on the invocations chart uses it. With the preview off, both tabs work as on master. ### How to test 1. Turn on the unified logs preview and open an edge function's Logs tab. You should see only that function's invocations and runtime logs, with the filter bar limited to date, log type, level and message. 2. Filter to Edge Function runtime, then to errors, and check counts and the chart follow. 3. Open an old `/functions/<slug>/invocations?its=…&ite=…&log=…` link. It lands on Logs with the same range and log selected. 4. Click a bar on the Overview invocations chart. The Logs tab opens on that bucket. ### Validation - URL helper, offered filter and preset tests, plus the scoped query tests from #50954. - Studio typecheck, lint ratchet, Prettier and knip pass on this layer. ### Stack Merge in order: 1. #50953 — reusable logs table building blocks 2. #50954 — function-scoped unified logs queries 3. #50955 — slimmer function detail layout, header on Overview 4. #50957 — Invocations merged into a function-scoped Logs tab 5. #50958 — Overview errors in the shared logs table 6. #52281 — remove the legacy Overview --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Jordi Enric <jordi.err@gmail.com> |
||
|
|
de32f3130b |
fix(studio): show compute size labels on infrastructure surfaces (#52170)
## Problem
We don't want to mention raw AWS instance type names. Instead only
display the actual instance size name (e.g. "Small", "Medium", ...).
Fixes PROD-673
## Solution
Add a `getComputeSizeLabel` helper (`apps/studio/lib/compute-labels.ts`)
that maps `infra_compute_size` to its display label (`medium` →
"Medium", `2xlarge` → "2XL", …) and returns `undefined` for unknown
values so callers render nothing instead of a raw value.
Studio elements changed:
- Read replica details: "Compute Size" field
(`/project/<project_id>/settings/infrastructure/replica/<replica_id>`)
- Infrastructure diagram: primary and replica node cards
(`generateNodes` now receives the label; replicas always match the
primary's compute size) (`/project/_/settings/infrastructure`)
- Map view: "AWS • {size}" line in the region popup
(`/project/<project_id>`)
- HA pooler node cards (`useHaPoolerCard`)
Also removes the `size` field from the create-replica request (API
ignores it).
Unit tests cover the new helper, including the unknown-value case. The
existing `project_homepage:show_instance_size` feature flag keeps gating
the label as before.
## Review instructions
1. Open a project's Infrastructure settings page
(`/project/_/settings/infrastructure`).
2. Check the diagram node cards and (for projects with replicas) the map
view popup: compute shows as "Small"/"Medium"-style labels matching the
project's compute badge.
3. Open a read replica's details page: the "Compute Size" field shows
the same label.
4. Open the add-replica dialog and submit: the request body contains
only `read_replica_region`.
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
|
||
|
|
c31c7afb1b |
fix(studio): add latest-version hint to Postgres version field (#52143)
## Problem On the General settings page, the Service versions card shows the versions as disabled inputs. When a project is already up to date, nothing explains that Postgres updates would show up in this section, or where to learn more. Resolves FE-4604: https://linear.app/supabase/issue/FE-4604/add-hint-regarding-database-versioning ## Solution Adds a subtle description under the Postgres version field, using the existing `description` prop on `FormItemLayout`: > This project is already on the latest version of Postgres that Supabase supports. Updates will appear here when available. Learn more "Learn more" links to the upgrading guide. It is tertiary information, so it is a field description and not an admonition (changed after design feedback). It only shows when the project is on the latest version, database upgrades are enabled, and the project is not on a K8s cloud provider. The condition is one named boolean, `canShowLatestVersionHint`. Component tests cover the visible case and the hidden cases. ## How to test 1. Run Studio and open a project's General settings page. 2. On a project already on the latest Postgres version, check that the description appears under the Postgres version field, next to the "Latest" badge. 3. Click "Learn more" and check that the upgrading guide opens in a new tab. 4. On a project with an upgrade available, check that only the upgrade alert shows and the description does not. |
||
|
|
973dfa1b97 |
feat(studio): scope unified logs queries to one edge function (#50954)
Adds an optional `scope` to the unified logs search: fixed filters every query applies on top of the user's, which the user can't remove. Nothing sets a scope in this PR, so the Logs page is unchanged. #50957 uses one to narrow the function Logs tab to one edge function. A scope uses the same columns and operators as the `filter` URL param, so any view can narrow logs to one resource without new query code. Columns the query builder doesn't know match a `log_attributes` key, so one edge function's logs are: ```ts { filters: [ { column: 'log_type', operator: '=', value: 'edge function' }, { column: 'log_type', operator: '=', value: 'edge function runtime' }, { column: 'function_id', operator: '=', value: functionId }, ], } ``` - New `edge function runtime` log type, read from the `function_logs` source. Its level comes from the console level (`error`/`fatal` count as errors, `warn`/`warning` as warnings), and its details stay in metadata. - **Every scan**: the scope's filters apply to rows, counts, the chart and single-facet queries. Facet scans never drop them, unlike the user's own filter on the facet's column. Filters on the same column and operator combine like the URL's (`=` values match any), every group must match, and a scope replaces the default postgres + edge log types. - **Fails closed**: a scope condition that can't be built matches no rows, instead of being dropped like a bad user filter. - **ClickHouse only**: scoped searches always run on ClickHouse, whatever `otelUnifiedLogs` says, including downloads and the log detail panel. The BigQuery queries are unchanged from master and throw on a scope rather than return rows from outside it. - `getLogTypeVisibility` offers only the log types a scope fixes. Otherwise it keeps the new log type out of the filters, since the project-wide Logs page already shows runtime logs inside each invocation's detail panel. - `toQuerySearchParams` and `createUnifiedLogsSearch` attach the scope. - `UnifiedLogs` works out which log types its queries may use once, instead of in each of its queries, filters and facets. ### How to test 1. Open the project Logs page with the unified logs preview on. The log type filter shouldn't offer "Edge Function runtime", and default results should match master. 2. The scoped behavior is easiest to try on #50957. ### Validation - Query builder tests: the scope on every count scan, the chart and facet queries, requests for out-of-scope log types, different operators on one column, the fail-closed case, BigQuery refusing a scope, and unscoped queries staying the same. - Studio typecheck, lint ratchet, Prettier and knip pass on this layer. ### Stack Merge in order: 1. #50953 — reusable logs table building blocks 2. #50954 — function-scoped unified logs queries 3. #50955 — slimmer function detail layout, header on Overview 4. #50957 — Invocations merged into a function-scoped Logs tab 5. #50958 — Overview errors in the shared logs table 6. #52281 — remove the legacy Overview --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Jordi Enric <jordi.err@gmail.com> |
||
|
|
bc9bee459f |
refactor(studio): extract reusable logs table building blocks (#50953)
Extract shared logs tables and query helpers. Validate query parameters and preserve defaults, keep custom preview footers independent of pagination, and cover preview behavior and omitted log counts. |
||
|
|
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) |
||
|
|
e38c93e960 |
feat(studio): block read replica creation when upgrade crosses collation lineage (#52244)
## What Read replica creation is now blocked when upgrading the primary's Postgres would cross a collation lineage boundary. The check uses the upgrade eligibility endpoint, and the lineage boundary logic is ported from the platform. The blocker shows an admonition asking the user to upgrade Postgres first, with a link to the upgrade section in General settings. - Multiple blockers on the replica dialog now collapse into a single admonition. - `useCheckEligibilityDeployReplica` now exposes `isLoading`, `isError`, `error`, and `refetch`. The dialog shows a skeleton while loading and an error with a Retry action on failure. ## Notes for reviewers - Upgrade eligibility only runs for active, healthy projects, so other projects are not blocked by this check. - The admonition copy needs a messaging review. ## Testing - Unit tests for the collation lineage util. - Component tests for blocker collapsing, the loading state, and error/retry. Closes FE-4643 |
||
|
|
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
|
||
|
|
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" /> | |