mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 15:39:13 +00:00
docs/auth-rate-limits-reference
5214
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
58b468916c |
docs(auth): Solve eval for Anonymous sign-in page (#53489)
Closes DOCS-1676 ## Problem The drafted Eval for this guide has one failing check. This PR fixes that check and also runs the `edit-the-docs` and `test-the-docs` skill to improve the page as a whole. The Anonymous Sign-Ins guide tells readers to check the `is_anonymous` JWT claim in RLS policies. When a guest links an email, phone, or OAuth identity, the user becomes permanent at once, but the token the client holds keeps `is_anonymous: true` until it refreshes. A policy on the claim refuses that new customer with `42501` until then. ## What changed - **Access control:** a caution on the stale claim, and a policy that reads `auth.users.is_anonymous` through a `security definer` function in a non-exposed schema with `search_path = ''`. - **Convert an anonymous user:** a "Refresh the session after linking" step with `refreshSession()`. - **Whole-page edit**, one commit per change type: - Style: wording, word list, sentence-case and imperative headings, no time-anchored text. - Structure (moves only): Access control before Convert, identity conflicts under Convert, the Next.js caution under Sign in. - Technical: the `anon` key uses the `anon` role, not `anonymous`; the opening caution no longer says to check the JWT claim; the existing-account sample throws instead of a top-level `return`. Renamed headings with no inbound links: Resolving identity conflicts, Linking an anonymous user to an existing account, Automatic cleanup. `#access-control` (Studio) and `#link-an-email--phone-identity` are unchanged. ## Eval on the preview `build-docs-016-auth-anonymous` with `REFERENCE` pointed at the preview, 3 runs ([workflow run](https://github.com/supabase/evals/actions/runs/43983385855)). | Run | Score | Guest who just made an account can post a review | Failed check | | --- | --- | --- | --- | | Baseline (published page) | 9/10 in all 3 runs | Fail in all 3 | Guest who just made an account can post a review | | 1 | 10/10 | Pass | None | | 2 | 9/10 | Pass | Agent read the guide | | 3 | 9/10 | Pass | Agent read the guide | All 3 runs fetched the preview and wrote the `security definer` policy. The guide-read check only counts fetches from `supabase.com`, so it can't pass on a preview. Run 1 passed it because that agent also opened the published page. ## Manual testing 1. Open the [Anonymous sign-ins preview](https://docs-git-docs-anonymous-claim-refresh-supabase.vercel.app/docs/guides/auth/auth-anonymous). 2. Check the new caution and function example under **Access control**, and the new **Refresh the session after linking** section. 3. Click the anchor links between the two sections and to the RLS guide. |
||
|
|
b53403e1d7 |
docs(integrations): add Build a Supabase integration guide (#54088)
## Problem The steps to build a Supabase integration are spread across five pages: the Partner Catalog page, creating an OAuth app, OAuth scopes, the partner install flow, and the Management API reference. A partner has no single page that says where to start or what to do next. Linear: DOCS-1720. ## Solution Add one guide, **Build a Supabase integration**, as the first item under **Build Your Own** in the integrations sidebar. It does not repeat the detail on the other pages. It links to them. - **The path at a glance:** two short paths. Partner Catalog: apply, build a landing page, publish. Integration: apply, build the OAuth flow, build the integration, publish. - **Apply to the Partners program**, then **Choose: Partner Catalog or Integration**, a comparison table with wireframe images (SVG, light and dark). - **Partner Catalog: Build your landing page** and **Integration** (build the OAuth flow, build the integration), each with "Build it" cards that link to the top of the existing page. - **Publish:** ask the partner manager to list the partner on the Partner Catalog or the Integrations page. - Removes the redirect from `/docs/guides/integrations/build-a-supabase-integration` to the OAuth guide, so the new page is reachable at that URL. The old `/oauth-scopes` redirect stays. - The progression and card data is in `apps/docs/data/content-listings/build-a-supabase-integration.data.ts`. Not in this PR: edits to the existing pages. The cards link to page tops, so nothing here depends on those edits. ## Please check - The five progression icons are placeholders from the built-in set. New icons are coming. - The table images sit inside table cells with a fixed width. I checked them in the dev server only. - I rendered the page with `pnpm dev` and ran `oxfmt --check` on the changed files. I did not run the docs tests or `build:guides-markdown`. - Two details are unverified: how partners hand their public key to Supabase for a signed redirect, and partner status callbacks. The guide does not describe either. - The Dashboard Integrations tab wireframe is a drawing, not a screenshot. ## Preview links | Site | Live | Preview | Search for | | ---- | ---- | ------- | ---------- | | Docs | [/docs/guides/integrations/build-a-supabase-integration](https://supabase.com/docs/guides/integrations/build-a-supabase-integration) (redirects to the OAuth guide until this merges) | Vercel bot comment | `The path at a glance` | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: John Stokvis <345546350+stokvis-at-supabase@users.noreply.github.com> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: Nik Richers <nik@validmind.ai> Co-authored-by: John Stokvis <johnstokvis@Johns-MacBook-Pro.local> |
||
|
|
07101b6894 |
[FE-3200] chore(studio): lift bundler workarounds and stabilize hooks (#54121)
Cleans up obsolete Rolldown/Vite bundler workarounds from the TanStack Start migration and fixes unstable router selectors and inline default array props that could cause unnecessary re-renders or render loops. Addresses [FE-3200](https://linear.app/supabase/issue/FE-3200/lift-bundler-workarounds-and-fix-latent-issues-next-was-masking). **Removed:** - Emptied `KNOWN_CHUNK_CYCLES` in `apps/studio/vite.config.ts` while keeping the `assertNoChunkCycles` build guard enabled - Removed obsolete `manualChunks` workarounds (`class-variance-authority`, `ui-field`, `ui-drawer`, `ui-form`, `ui-sidebar`, `ui-slider`, `ui-avatar`), keeping the React and `lucide-react` vendor chunks so React stays a single leaf chunk and Lucide does not fan out into per-icon modulepreload requests - Removed the obsolete `sharedDefines` (`global: 'globalThis'`) substitution from `apps/studio/vite.config.ts` **Changed:** - `StudioLink` (`StudioFrameworkProvider.tsx`): split `useRouterState` into primitive `currentPathname` and `currentSearch` selectors instead of returning a fresh object on every router state tick - `useNuqsTanStackRouterAdapter` (`nuqs-tanstack-adapter.tsx`): select a serialized query string key from `useLocation` so `useQueryState` consumers do not re-render when unwatched search params change - `FilterPopover`: replaced inline `[]` defaults for `options` and `activeOptions` with shared `EMPTY_ARR` (`@/lib/void`), and guarded `setSelectedOptions` with an element-wise equality check when closed - `InputWithSuggestions`: replaced inline `[]` default for `suggestions` with shared `EMPTY_ARR` (`@/lib/void`) so `useEffect` does not loop when `suggestions` is omitted at runtime **Added:** - Regression tests covering router selector stability and default-prop render loops in `StudioFrameworkProvider.test.tsx`, `nuqs-tanstack-adapter.test.tsx`, `FilterPopover.test.tsx`, and `InputWithSuggestions.test.tsx` ## To test - Run `pnpm --filter studio run build` and verify the build passes with `KNOWN_CHUNK_CYCLES` empty and `assertNoChunkCycles` enabled - Run the new/updated unit tests in `apps/studio` (`StudioFrameworkProvider.test.tsx`, `nuqs-tanstack-adapter.test.tsx`, `FilterPopover.test.tsx`, `InputWithSuggestions.test.tsx`) - Smoke-test Studio navigation, URL search-param filters (`nuqs`), Table Editor column suggestions, `FilterPopover` interactions, and `/auth/hooks` (confirming no `global` ReferenceError) --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
fd5c02f1a0 |
fix(studio): Scoped OAuth apps - improve text for projects with permission issues (#54409)
## Problem When an authorization fails because of permission issues, we currently display _Unavailable_ next to the problematic projects in the project selector list. This is confusing as those projects are available, just not selectable for this authorization ## Solution Display _permission issues_ instead <img width="417" height="601" alt="image" src="https://github.com/user-attachments/assets/331073ac-71e0-45b0-a607-dcbd47268d91" /> |
||
|
|
5fb027c28f |
feat(studio): launch week + builder day sign-ins redirect (#54317)
## Problem - dashboard sign-in sends a user back with `router.push(returnTo)`, and the path stays under `/dashboard` - lw16 card app at `/launch-week` (#54315) signs in with `returnTo=/launch-week?claim=1` and the user lands on a 404 at `/dashboard/launch-week?claim=1` - `validateReturnTo` rejects full urls, and the Builder Day site at `/builderday` has the same problem ## Solution - adds `/dashboard/launch-week` and `/dashboard/builderday` pages that load the same path outside the dashboard + keep the query and the hash - adds a test that a query with another address does not change the destination ## Preview links | Site | Live | Preview | Search for | | ---- | ---- | ------- | ---------- | | Studio | [/dashboard/launch-week?claim=1](https://supabase.com/dashboard/launch-week?claim=1) | [/dashboard/launch-week?claim=1](https://studio-git-antlio-studio-launch-week-return-supabase.vercel.app/dashboard/launch-week?claim=1) | the address bar | | Studio | [/dashboard/builderday](https://supabase.com/dashboard/builderday) | [/dashboard/builderday](https://studio-git-antlio-studio-launch-week-return-supabase.vercel.app/dashboard/builderday) | the address bar | ## Review instructions 1. open the preview [/dashboard/launch-week?claim=1](https://studio-git-antlio-studio-launch-week-return-supabase.vercel.app/dashboard/launch-week?claim=1) and make sure that the address changes to `/launch-week?claim=1` outside `/dashboard` 2. open the preview [/dashboard/builderday](https://studio-git-antlio-studio-launch-week-return-supabase.vercel.app/dashboard/builderday) and make sure that the address changes to `/builderday` 3. sign out and open the preview [/dashboard/sign-in?returnTo=%2Flaunch-week%3Fclaim%3D1](https://studio-git-antlio-studio-launch-week-return-supabase.vercel.app/dashboard/sign-in?returnTo=%2Flaunch-week%3Fclaim%3D1) 4. sign in and make sure that the browser ends at `/launch-week?claim=1` 5. sign out, open the preview [/dashboard/sign-in?returnTo=%2Forganizations](https://studio-git-antlio-studio-launch-week-return-supabase.vercel.app/dashboard/sign-in?returnTo=%2Forganizations) and make sure that the sign-in still returns to `/dashboard/organizations` ## 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) --------- Co-authored-by: Dion Zeneli <101271736+Dionysos288@users.noreply.github.com> |
||
|
|
dc4f247e79 |
Revert "chore: update prod api types (#54394)" (#54404)
This reverts commit
|
||
|
|
a27ef81d2e |
feat(studio): enable advanced V3 deployment for allowlisted organizations (#53158)
## Problem Currently, in production, the Supabase UI doesn't allow for a set of advanced deployment options, that we need to properly test new clusters before getting those into production. ## Solution Allow production dashboard requests to specify an AWS_K8S cluster when the organization is included in the comma-separated `orgsAllowedToUseV3AdvancedDeployment` setting. Limited the exception to cluster placement fields. Preserve existing permissions and cluster validation, require force for cordoned clusters, and keep system requests supported. Default the allowlist to empty. Updated the API descriptions and document ConfigCat setup. ## Review instructions - ## 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) |
||
|
|
431a55435a |
fix(studio): keep the function overview range in logs FE-4973 (#53867)
## Problem An Edge Function’s Overview can show an invocation from two hours ago. Selecting **Open logs** or pressing **O** then **L** opens the function’s Logs page with its default one-hour window, which hides that invocation. ## Fix Both actions now pass the start and end of the selected Overview window to the function’s Logs page. ## How to test 1. Open an Edge Function with invocations in the last three hours and select the three-hour interval on Overview. 2. Select **Open logs**. Check that Logs opens for the same function and the date range spans exactly three hours. If an invocation is older than one hour, confirm it appears in that range. 3. Return to Overview, select three hours again, and press **O** then **L**. Check the same function and time range. Related to [FE-4973](https://linear.app/supabase/issue/FE-4973). ## Verification On the Studio staging preview, both **Open logs** and **O** then **L** opened the same function with the exact Overview timestamps, 13:03:16.960 through 16:03:16.960 UTC. The results included a successful invocation more than one hour before the window ended. All 72 focused Overview and Logs navigation tests passed. Removing the date range from either entry point independently failed its regression assertion. |
||
|
|
37d4f444b4 |
chore: update prod api types (#54394)
Updated API types and addressed any type issues. Had to update shared-types alongside. |
||
|
|
31f68587f6 |
feat(studio): track remaining usage on project home (#54143)
## Problem Project home tracked most interactions, but not which credential people copy from the "Copy" popover, or how often they use the custom report and notebooks beyond adding blocks. Opening the Connect sheet from the popover's "Get Connected" button also reported a stale `connect_sheet_opened` source, because the popover never set one. ## Solution Project home gets three new events: `home_project_credential_copied` (with a `credentialType` enum), `home_custom_report_refresh_clicked`, and `home_notebook_action_clicked` (`action: 'create' | 'analyze'`). "Get Connected" in the popover now sets a new `home_popover` Connect sheet source. The compute and GitHub stats now send `home_activity_stat_clicked` as well, with two new `stat_type` values. Every event fires from its click handler with a typed `track()` call, and none sends the copied value or any user-defined name. This follows the telemetry standards, so no `data-attr` attributes are added. ## How to verify 1. On a project's home page, open the "Copy" popover and copy each item. Each copy sends one `home_project_credential_copied` event, with `credentialType` set to `project_url`, `publishable_key`, `direct_connection_string`, or `cli_setup`. No event contains the copied value. 2. In the same popover, click "Get Connected". The Connect sheet opens and sends `connect_sheet_opened` with `source: 'home_popover'`. Opening it from the header button afterwards still sends `source: 'header_button'`. 3. Click the "Compute size" stat. It sends `home_activity_stat_clicked` with `stat_type: 'compute'` and no `stat_value`. 4. Click the "GitHub" stat. It sends `home_activity_stat_clicked` with `stat_type: 'github'`, and `stat_value` is 1 when a repository is connected and 0 when none is. 5. With the custom report section shown, click "Refresh report". It sends one `home_custom_report_refresh_clicked` event. 6. With the Notebooks section shown, click "New notebook" (or "Create your first notebook" when there are none). It sends `home_notebook_action_clicked` with `action: 'create'`. Click "Analyze" on a notebook with cells: it sends `action: 'analyze'`. ## Checks Ran `tsc --noEmit` in `apps/studio` and `packages/common`, `eslint` and the type-aware `eslint.type-checks.config.cjs` lint on the changed Studio files, `oxfmt --check` on every changed file, and `vitest run` for `ProjectConnectionPopover.platform.test.tsx` and `ActivityStats.test.tsx`. ## 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-5026](https://linear.app/supabase/issue/FE-5026/track-usage-on-project-home-gaps-only). 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> |
||
|
|
680633ee4f |
[FE-5108] (part 5) refactor(studio): migrate remaining interfaces off next/link (#54308)
Part 5 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 | Integrations, Settings, Observability, LogDrains, Issues, Linter, Reports, QueryPerformance, QuerySources, ConfigDrift, DiskManagement, Compute | | **5** | **#54308 ← this PR** | **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 the remaining `components/interfaces/**` directories off `next/link`, leaving zero `next/link` component imports in `apps/studio`. **Changed:** - Replaced `next/link` across all 73 remaining interface files (`Organization`, `OrganizationInvite`, `Billing`, `Auth`, `Support`, `ProjectHome`, `Home`, `Project`, `ProjectCreation`, `ProjectAPIDocs`, `ApiAuthorization`, `App`, `ConnectSheet`, `SignIn`, `APIKeys`, `Account`, `CliLogin`, `Docs`, `JwtSecrets`, `Platform`) - Converted the sole remaining `UrlObject` link (`<Link href={{ pathname: '/sign-in-sso', query }}>`) in `SignInSSOForm.tsx` to `<Link to="/sign-in-sso" search={query}>` - Migrated `SupportLink.tsx` onto `DynamicLink` (`createSupportFormUrl(...)`) - Standardized external `target="_blank"` anchors with `rel="noreferrer noopener"`, switched `OverviewMetrics.tsx` observability link to typed `<Link to="/project/$ref/observability/auth">`, and adopted `InlineLink` / `InlineLinkClassName` on inline paragraph links per review feedback Addresses [FE-5108](https://linear.app/supabase/issue/FE-5108/replace-the-nextlink-shim-with-tanstack-link) ## To test - [ ] Check Organization (billing, usage, team, documents, AWS Marketplace), Auth (providers, templates, rate limits, users, OAuth apps), Support form/links, Project Home, Connect sheet, and Sign-In/SSO links - [ ] Verify `SignInWithSSOButton` preserves query params when navigating to `/sign-in-sso` - [ ] Verify `SupportLink` pre-populates support form query parameters cleanly --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
7a6c6f7df8 |
fix(studio): fix Publish OAuth app button tooltips (#54359)
## Problem Users who don't have the required permissions to publish an oauth app may see two tooltips when hovering the _Publish OAuth app_ button. <img width="620" height="208" alt="image" src="https://github.com/user-attachments/assets/fedf7150-35e6-4429-b0c0-2fbc4cd2aa5e" /> ## Solution Hide the shortcut tooltip when users don't have the required permissions to publish an oauth app |
||
|
|
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> |
||
|
|
e0635f2f38 |
[FE-5108] (part 3) refactor(studio): migrate database, editors & storage off next/link (#54306)
Part 3 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 ← this PR** | **Database, TableGridEditor, Storage, SQLEditor, BranchManagement, Branching, Functions, Realtime** | | 4 | #54307 | Integrations, Settings, Observability, LogDrains, Issues, Linter, Reports, QueryPerformance, QuerySources, ConfigDrift, DiskManagement, Compute | | 5 | #54308 | Remaining `components/interfaces/**` (Org, Billing, Auth, Support, Home, SignIn, ConnectSheet, etc.) | | 6 | #54309 | Remove `compat/next/link.tsx` shim, Vite alias, and update basePath tests/docs | Migrates `components/interfaces/{Database,TableGridEditor,Storage,SQLEditor,BranchManagement,Branching,Functions,Realtime}/` off `next/link`. **Changed:** - Replaced `next/link` across all 60 importing files in Database, TableGridEditor, Storage, SQLEditor, BranchManagement, Branching, Functions, and Realtime interfaces - Updated legacy permanent-redirect hrefs (`/reports` → `/observability`, `/database/schema` → `/database/schemas`) to their canonical TanStack routes - Dropped legacy `passHref` in `GridHeaderActions.tsx`, removed duplicate `RouterLink` alias in `ChooseFunctionForm.tsx`, and removed `vi.mock('next/link', ...)` in `ReplicationPipelineLayout.test.tsx` Addresses [FE-5108](https://linear.app/supabase/issue/FE-5108/replace-the-nextlink-shim-with-tanstack-link) ## To test - [ ] Check Table Editor, SQL Editor, Database (tables, policies, functions, triggers, replication, backups), Storage (files/analytics/vector buckets), Edge Functions, Branching, and Realtime links - [ ] Verify SQL Editor and Table Editor links with query parameters (`schema`, `content`, `search`) do not double-encode values --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
6dd7062496 |
[FE-5108] (part 2) refactor(studio): migrate layouts & shell off next/link (#54305)
Part 2 of a 6-PR stack migrating all `next/link` imports in `apps/studio` onto TanStack Router's `Link` (or plain `<a>` for known external URLs) and removing `compat/next/link.tsx`. | Part | PR | Scope | | --- | --- | --- | | 1 | #54304 | `data/prefetchers/PrefetchableLink.tsx` and `components/ui/**` | | **2** | **#54305 ← this PR** | **`components/layouts/**` and top-level shell components** | | 3 | #54306 | Database, TableGridEditor, Storage, SQLEditor, BranchManagement, Branching, Functions, Realtime | | 4 | #54307 | Integrations, Settings, Observability, LogDrains, Issues, Linter, Reports, QueryPerformance, QuerySources, ConfigDrift, DiskManagement, Compute | | 5 | #54308 | Remaining `components/interfaces/**` (Org, Billing, Auth, Support, Home, SignIn, ConnectSheet, etc.) | | 6 | #54309 | Remove `compat/next/link.tsx` shim, Vite alias, and update basePath tests/docs | Migrates all `apps/studio/components/layouts/**` files and top-level navigation shell components off `next/link`. **Changed:** - Replaced `next/link` across `components/layouts/**` (`AccountLayout`, `AppLayout`, `AuthLayout`, `BranchLayout`, `DatabaseLayout`, `EdgeFunctionsLayout`, `ExplorerLayout`, `IssuesLayout`, `LogsLayout`, `Navigation`, `ObservabilityLayout`, `ProjectLayout`, `ProjectNeedsSecuring`, `SQLEditorLayout`, `SignInLayout`, `TableEditorLayout`, `Tabs`) and top-level shell components (`Sidebar.tsx`, `UserDropdown.tsx`, `LocalDropdown.tsx`, `HomePageActions.tsx`) - Removed `vi.mock('next/link', ...)` from `LocalDropdown.test.tsx` and `ProjectNeedsSecuring.test.tsx` - Added accessible labels where external icon/logo links switched from `<Link>` to plain `<a>` (`AdminStudioButton.tsx`, `ForgotPasswordLayout.tsx`) Addresses [FE-5108](https://linear.app/supabase/issue/FE-5108/replace-the-nextlink-shim-with-tanstack-link) ## To test - [ ] Navigate across top header, left sidebar, user/local dropdown, and project/org/branch switchers - [ ] Verify mobile navigation menu items and recent-tab links navigate with expected query params - [ ] Verify sign-in and forgot-password layout links work cleanly --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
0a4cec0464 |
[FE-5108] (part 1) refactor(studio): migrate core UI & prefetchers off next/link (#54304)
Part 1 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 ← this PR** | **`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 | 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 `data/prefetchers/PrefetchableLink.tsx` and all shared `components/ui/**` components off `next/link`. **Added:** - `apps/studio/components/ui/DynamicLink.tsx` (with unit tests) — shared `forwardRef` link wrapper for dynamic URL strings that runs `splitInternalUrl` and renders a plain `<a>` for external URLs (or same-origin URLs outside the app's `basePath`) vs TanStack `<Link>` for internal paths **Changed:** - Replaced `next/link` in `apps/studio/data/prefetchers/PrefetchableLink.tsx` and all 30 importing components under `apps/studio/components/ui/**` (`InlineLink`, `CardButton`, `CommandItemLink`, `ObservabilityLink`, `ProductMenuItem`, `ResourceItem`, `UpgradePlanButton`, `ToggleSpendCapButton`, banners, AI assistant panel links, etc.) - Used typed `<Link to="..." params={...} search={...} hash="..." />` for known internal routes, `<DynamicLink href={...} />` for dynamic/untyped URL strings (whether internal with query/hash or external), and plain `<a>` for known external links - Updated `apps/studio/routes/index.tsx` `validateSearch` return type to `{ next?: string }` so `<Link to="/">` compiles without requiring `search={{ next: undefined }}` - Updated `hooks/misc/__tests__/useTableEditorFiltersSort.navigation.test.tsx`, `PolicyTableRow.utils.test.ts`, `SupportAssistantSuccessCard.test.tsx`, and `useOrganizationRestrictions.test.tsx` to render inside a TanStack Router context (`customRender` / `RouterContextProvider`) Addresses [FE-5108](https://linear.app/supabase/issue/FE-5108/replace-the-nextlink-shim-with-tanstack-link) ## To test - [ ] Click internal and external `InlineLink`, `CardButton`, `ProductMenuItem`, and `PrefetchableLink` targets and verify client-side navigation vs external anchors - [ ] Verify banner links (upgrade, resource exhaustion, queue operations) preserve query params and hashes - [ ] Confirm Studio typecheck, lint, and unit tests pass --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
477e2c136f |
[FE-5109] (part 6) chore(studio): remove next/router shims, aliases, and test mocks (#54058)
Part 6 (final) of a 6-PR stack migrating all `next/router` and `next/compat/router` imports in `apps/studio` onto TanStack Router hooks and removing the router shims. | Part | PR | Scope | | --- | --- | --- | | 1 | #54053 | Core navigation helpers, `hooks/**`, `lib/**`, `data/prefetchers/**` | | 2 | #54054 | `components/ui/**` | | 3 | #54055 | `components/layouts/**` and `state/tabs.tsx` | | 4 | #54056 | Database, Branching, Compute, Edge Functions, Explorer, SQL Editor, Storage, Table Editor | | 5 | #54057 | Remaining `components/interfaces/**` and `QueryInsightsTable` router events | | **6** | **#54058 ← this PR** | **Remove `next/router` & `next/compat/router` shims, `_router-events.ts`, Vite aliases, and test mocks** | Now that no files in `apps/studio` (or `packages/**`) import `next/router` or `next/compat/router`, deletes the router shims, `_router-events.ts`, their Vite aliases, and the obsolete router test mocks. `RouteValidationWrapper` is intentionally left for FE-3107. **Removed:** - `apps/studio/compat/next/router.ts`, `apps/studio/compat/next/compat/router.ts`, and `apps/studio/compat/next/_router-events.ts` - `'next/router'` and `'next/compat/router'` entries from `nextShims` in `apps/studio/vite.config.ts` - Global `vi.mock('next/router', ...)` and `vi.mock('next/compat/router', ...)` in `apps/studio/tests/vitestSetup.ts`, `mockNextRouter` in `apps/studio/tests/lib/route-aware-hooks.ts`, and the unused `vi.mock('next/router')` in `tests/features/logs/LogTable.test.tsx` - Obsolete shim tests and test helpers: `compat/next/router.test.ts`, `compat/next/router-navigation.test.tsx`, `tests/config/router.tsx`, and `tests/config/router.test.tsx` **Changed:** - Simplified `createNavigationHandler` in `apps/studio/lib/navigation.ts` (and `navigation.test.ts`) to accept TanStack's `UseNavigateResult<string>` only, dropping the `NextRouter` union branch - Updated `compat/next/link-basepath-navigation.test.tsx` (renamed from `router-basepath-navigation.test.tsx`), `lib/router-url-shape.test.tsx`, and `tests/lib/route-render.test.tsx` to exercise TanStack Router hooks directly instead of the removed router shim - Cleaned up stale `next/router` comments in `compat/next/link.tsx`, `lib/internal-url.ts`, `router.tsx`, and `tests/lib/route-mock.ts` **Simplified:** - Removed `routerMock` setup from about 19 tests that no longer read it. `next-router-mock` stays for now, because the test `FrameworkProvider` still feeds `useParams` from it. - `AGENTS.md` and the `vite.config.ts` error text now say only `next/link` and `next/script` are shimmed - Renamed `compat/next/router-basepath-navigation.test.tsx` to `link-basepath-navigation.test.tsx`, and removed stale router-shim references from comments Addresses [FE-5109](https://linear.app/supabase/issue/FE-5109/replace-the-nextrouter-shims-with-tanstack-router-hooks) ## To test - [ ] Confirm `git grep -E "next/(compat/)?router|_router-events" apps/studio` returns no code or config imports (only the prose guideline in `apps/studio/AGENTS.md`) - [ ] Confirm `pnpm --filter studio run typecheck`, `pnpm --filter studio run lint`, `pnpm --filter studio run build`, Knip, and the full Studio Vitest suite pass - [ ] Spot-check basePath navigation (`next/link` + `navigateToUrl`) and multi-line query param URLs in Studio --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
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> |
||
|
|
d8568215ad |
[FE-5109] (part 4) refactor(studio): migrate database, editor, storage, and functions interfaces off next/router (#54056)
Part 4 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 ← this PR** | **Database, Branching, Compute, Edge Functions, Explorer, SQL Editor, Storage, Table Editor** | | 5 | #54057 | 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 the database, branching, compute, functions, explorer, SQL editor, storage, and table editor interfaces off `next/router` and `next/compat/router`. **Changed:** - Migrated the sole `next/compat/router` consumer (`components/interfaces/Database/Replication/Destinations.tsx`) to `useNavigate` - Replaced `useRouter` across `BranchManagement`, `Branching`, `Compute`, `Database` (`Backups`, `Functions`, `Replication`, `Schemas`, `Tables`, `Triggers`), `EdgeFunctions`, `Explorer`, `Functions`, `SQLEditor`, `Storage` (`AnalyticsBuckets`, `FilesBuckets`, `VectorBuckets`, `StorageMenuV2`, `Storage.utils`), and `TableGridEditor` with TanStack Router hooks (`useNavigate`, `useLocation`, `useRoutePattern`) and `useParams` from `common` - Updated unit and component tests across `Database/Replication`, `Explorer`, `Functions`, and `Storage/FilesBuckets/DeleteBucketModal.test.tsx` to use TanStack Router **Simplified:** - `useSnippetEditor` and `useRedirectLegacyReadReplicaDestination` read search values from `useParams` instead of casting `location.search` - `resolveSourceSwitch` returns `replace: boolean` instead of a `push`/`replace` method name - `ExplorerQueryTab` and `EdgeFunctionDetails` guard on a defined ref instead of navigating with `ref ?? ''` - `useFunctionsDetailShortcuts` and `StorageMenuV2` use a local `goTo` helper for their navigation shortcuts - Tests use the shared `createTestRouter` and `customRender` router, use `toMatchObject` for search assertions, and drop duplicate assertions Addresses [FE-5109](https://linear.app/supabase/issue/FE-5109/replace-the-nextrouter-shims-with-tanstack-router-hooks) ## To test - [ ] SQL Editor: creating, renaming, moving, opening templates/examples, and keyboard shortcuts navigate between snippets cleanly - [ ] Table Editor & Database: opening tables, schema table nodes, triggers, functions, backups/PITR, and replication destination flows navigate as expected - [ ] Storage: switching between Files, Analytics, and Vector buckets and deleting a bucket navigates cleanly - [ ] Edge Functions & Explorer: opening function details/logs, explorer chat/query tabs, and branch management actions navigate properly --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
bd4912cbdc |
feat(studio): track SQL editor sidebar, snippet and editor tab usage (#54170)
## Context Adds seven PostHog events through `useTrack` for the SQL Editor to better identify usage patterns there, each fired from its click or submit handler: - `sql_editor_new_item_clicked` (`itemType`) for the "+" menu. <img width="229" height="150" alt="image" src="https://github.com/user-attachments/assets/f6281bdb-d70e-4e7c-adf3-edce0ec2116c" /> - `sql_editor_snippet_search_submitted`: once per search session, on the first keystroke into an empty search box. <img width="285" height="214" alt="image" src="https://github.com/user-attachments/assets/4c482385-cab1-49d3-9aaa-e2be1aafb1af" /> - `sql_editor_snippet_sort_updated` (`sortBy`) when the sort order changes. <img width="226" height="121" alt="image" src="https://github.com/user-attachments/assets/0e7268ee-bf4a-46d4-ba8d-f07a6e9b0675" /> - `sql_editor_snippet_action_clicked` (`action`, `isBulk`) for snippet and folder context-menu actions. <img width="254" height="275" alt="image" src="https://github.com/user-attachments/assets/7338df06-47df-47be-b44d-6fc2dd49c586" /> - `sql_editor_snippet_share_submitted` when the share modal is confirmed. <img width="531" height="309" alt="image" src="https://github.com/user-attachments/assets/997e7567-9fdb-400e-af1a-147a5dcbb7a7" /> - `sql_editor_snippet_moved` (`snippetCount`, `toNewFolder`) after a move succeeds. <img width="539" height="247" alt="image" src="https://github.com/user-attachments/assets/f0da9544-d29e-402f-a0d3-9b7f5e3fa3c6" /> - `editor_tab_closed` (`closeType`, `editor`) in the tab bar that the SQL, Table and Explorer editors share. It fires when the tabs actually close, after any unsaved-changes confirmation. <img width="147" height="64" alt="image" src="https://github.com/user-attachments/assets/96073c69-acf1-4829-8532-beb283b7f373" /> No property carries names, SQL or search text, and every event is sent with an explicit `track()` call. ## How to verify On the PR's Studio preview, with analytics consent accepted, watch the network requests to the telemetry endpoint: 1. In the SQL editor, open the "+" menu and pick a new snippet, a new folder and (when available) a new logs query. Each one sends `sql_editor_new_item_clicked` with the matching `itemType`. 2. Type into the snippet search box. One `sql_editor_snippet_search_submitted` goes out on the first character, and none on later ones. Clear the box and type again: one more goes out. 3. Change the sort to Alphabetical, then to Created At. Each change sends `sql_editor_snippet_sort_updated` with `sortBy` `name` or `inserted_at`. Picking the current sort again sends nothing. 4. Right-click a snippet and pick each action (open in new tab, rename, move, share, unshare, duplicate, add to or remove from favorites, export, delete). Each sends `sql_editor_snippet_action_clicked` with that `action` and `isBulk: false`. Shift-click several snippets and pick move or delete: `isBulk: true`. 5. Right-click a folder and pick create snippet, rename or delete: `action` is `folder_create_snippet`, `folder_rename` or `folder_delete`. 6. Confirm the share modal: `sql_editor_snippet_share_submitted` goes out. Move a snippet into a new folder: after it succeeds, `sql_editor_snippet_moved` goes out with `snippetCount: 1, toNewFolder: true`. 7. In the SQL editor and the Table editor tab bars, use Close, Close Others, Close to the Right and Close All, and the tab's X button. Each sends `editor_tab_closed` with the matching `closeType` and `editor`. If you cancel an unsaved-changes prompt, nothing is sent. --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> Co-authored-by: Joshen Lim <joshenlimek@gmail.com> |
||
|
|
c76cbaaeed |
chore: micro upgrade copy (#54348)
We are trying to move away from the "Free" copy - it is free as in no additional costs, but not FREE |
||
|
|
3dcb524f9e |
fix(studio): make OAuth access levels single-select (#54109)
## Problem The OAuth app editor has separate Read and Write checkboxes. The menu closes after each click, so choosing both scopes takes two trips through the menu. ## Solution Use Studio’s single-select control to set the full access level in one step. The current scopes determine the label on the trigger. The choices are **No access**, **Read only**, **Write**, and **Read and write**. Each choice updates the scopes for that row and preserves other rows. This is the base for #54006. The scoped personal access token editor has a companion update in #54164. | Before | After | | --- | --- | | <img width="651" height="297" alt="CleanShot 2026-11-26 at 15 33 36" src="https://github.com/user-attachments/assets/dd74666a-9a5a-42fa-97f3-d866e5394d93" /> | <img width="649" height="307" alt="CleanShot 2026-11-27 at 11 30 25" src="https://github.com/user-attachments/assets/48395dd5-032e-49eb-9663-709eeac40fc3" /> | ## Review instructions 1. Open the [OAuth Apps preview](https://studio-staging-git-dnywh-oauth-permission-acces-6a3679-supabase.vercel.app/dashboard/org/_/apps) and select **Publish OAuth app**. 2. Under **Application permissions**, try each access level on a row. Check that one selection closes the menu and updates the trigger. 3. Select **No access** and check that both scopes are cleared for that row. Check that another row’s selection stays in place. |
||
|
|
556faeab51 |
feat(studio): clarify authorized app grant details (#54284)
## Problem The grants dialog makes project coverage and each member’s permissions hard to inspect. ## Solution - Replace the dialog with a grant-details sheet. - Separate organisation and member access, with project references and permissions grouped by access level. - Move app IDs into Details and add a revoke action for authorised admins. - Build on #54285 using the existing grants API. | Before | After | | --- | --- | | <img width="1280" height="1323" alt="OAuth Apps Organization Settings Basket Supabase" src="https://github.com/user-attachments/assets/b6bb0082-9cee-48b4-adb4-058f14f10f9f" /> | <img width="1280" height="1323" alt="OAuth Apps Organization Settings Basket Supabase" src="https://github.com/user-attachments/assets/b32a7723-9fa0-452d-95f5-1762fd364163" /> | | <img width="1280" height="1185" alt="OAuth Apps Organization Settings Basket Supabase" src="https://github.com/user-attachments/assets/9a7982ba-aebe-42f4-9ac6-9308136150f7" /> | <img width="1280" height="1221" alt="OAuth Apps Organization Settings Basket Supabase" src="https://github.com/user-attachments/assets/1965f7e4-8554-4fa9-86ef-7e53af1d0038" /> | ## Review instructions 1. Sign in to staging and use an authorised app, or [authorise the test app](https://api.supabase.green/v1/oauth/authorize?client_id=75e64165-b74e-432f-bb70-80d6ae432f06&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A54321%2Fcallback&state=grant-sheet-review). The localhost callback may fail after the grant is saved. 2. Open the [preview](https://studio-staging-git-dnywh-oauth-grant-details-supabase.vercel.app/dashboard/org/_/apps#authorized-apps), select the same organisation and choose **Manage app → View access**. 3. Check the grant sections, project references and permission groups. Test narrow widths, closing the sheet and cancelling **Revoke access**. ### Mixed-grant overrides In **DevTools → Network**, override only the GET ending in `/oauth/approvals/<app-id>/grants` with this response. Save, reload and reopen the sheet. Remove any parent `/approvals` override to avoid Chrome’s file/folder clash. <details> <summary>grants.json</summary> ```json { "data": [ { "id": "22222222-2222-4222-8222-000000000001", "type": "oauth_grant", "attributes": { "approved_at": "2026-11-30T00:00:00Z", "approved_scopes": [ "database:read", "database:write", "projects:read" ], "kind": "organization_bound", "projects": null, "user": null } }, { "id": "22222222-2222-4222-8222-000000000002", "type": "oauth_grant", "attributes": { "approved_at": "2026-11-30T00:00:00Z", "approved_scopes": [ "projects:read" ], "kind": "member_bound", "projects": [ { "name": "Example storefront", "ref": "example-storefront" } ], "user": { "username": "alex", "email": "alex@example.com", "gotrue_id": "33333333-3333-4333-8333-000000000001" } } }, { "id": "22222222-2222-4222-8222-000000000003", "type": "oauth_grant", "attributes": { "approved_at": "2026-11-30T00:00:00Z", "approved_scopes": [], "kind": "member_bound", "projects": [], "user": { "username": "sam", "email": "sam@example.com", "gotrue_id": "33333333-3333-4333-8333-000000000002" } } } ], "links": { "next": null, "prev": null } } ``` </details> Check that organisation access covers all projects, Alex has only read access to Example storefront, and Sam has no projects or permissions. Disable overrides when finished. Requires `enableScopedOAuthManage` for the organisation. |
||
|
|
99a665b8d7 |
feat(studio): polish authorized app access actions (#54285)
## Problem Authorized Apps hides access details behind a menu and uses a lengthy revoke confirmation. Opening and closing these views should work consistently with a mouse and keyboard. ## Solution - Open access details from the app row, app name or **View access** menu action. - Remove the menu tooltip, use consistent labels and hide unavailable-action separators. - Use a compact **Revoke access** confirmation with focus returned to the initiating control. - Keep the existing grants dialog and table IDs; the sheet follows in #54284. | Before | After | | --- | --- | | <img width="1274" height="687" alt="CleanShot 2026-11-30 at 17 40 25" src="https://github.com/user-attachments/assets/e7eb9411-cc2e-4bf2-8599-979f06069791" /> | <img width="1273" height="679" alt="CleanShot 2026-11-30 at 17 40 05" src="https://github.com/user-attachments/assets/d6b38690-7ba2-4c8c-adfc-0e0e356f7687" /> | | <img width="576" height="284" alt="CleanShot 2026-11-30 at 17 44 18" src="https://github.com/user-attachments/assets/e2b7f015-c214-4034-b6ab-a4afc050510d" /> | <img width="424" height="207" alt="CleanShot 2026-11-30 at 17 44 36" src="https://github.com/user-attachments/assets/77df776d-bc93-4cdb-b333-2c6c54ed6554" /> | ## Review instructions 1. Use a staging test organisation with an authorised app. If needed, [authorise the existing test app](https://api.supabase.green/v1/oauth/authorize?client_id=75e64165-b74e-432f-bb70-80d6ae432f06&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A54321%2Fcallback&state=grant-sheet-review). The localhost callback may fail to load after the grant is saved. 2. In the [Studio staging preview](https://studio-staging-git-dnywh-oauth-access-list-polish-supabase.vercel.app/dashboard/org/_/apps#authorized-apps), open **OAuth Apps → Authorized Apps** at `/dashboard/org/_/apps#authorized-apps`. Click an app row or name, then use **Manage app → View access**. Each opens the existing grant-details dialog. 3. Focus the app name and press Enter or Space. Close the dialog and check focus returns to the app name. Opening from the row or menu should return focus to **Manage app**. 4. As an admin, select **Manage app → Revoke access**. Check the compact confirmation names the app and explains the organisation and member impact. Cancel it and check that grant details do not open accidentally and focus returns to the app menu. Revoke only a disposable test grant when checking submission. 5. As a user without revoke permission, check the menu has no revoke action or stray separator. Repeat the controls and confirmation at a narrow width. --------- Co-authored-by: Gildas Garcia <1122076+djhi@users.noreply.github.com> |
||
|
|
9b3435010c |
fix(studio): show client ID and app ID on OAuth apps page (#54324)
## Problem On the OAuth apps page in Studio, the table showed only the Client ID, and the edit panel showed the app ID as unlabeled `ID: ...` text under the app name. It was hard to tell the two IDs apart, or to copy the right one. That contributed to the wrong ID type being handed to the team that manages the Stripe pipeline allowlist (incident, Nov 20–23). ## Solution - **Table:** add an **App ID** column next to **Client ID**. Both are shown shortened (`65****9a71`) with a copy button. Hover an ID to show the whole value. The copy button always copies the whole value. - **Edit panel:** show **Client ID** and **App ID** as separate labeled, copiable fields (full value, not shortened), each with one line of helper text: - Client ID: "Used to identify your app when it makes OAuth requests to Supabase." - App ID: "Used to manage your app on Supabase, such as updating or deleting it." - Remove the old `ID: ...` description under the app name. - Add one small shared component, `OAuthAppId`, used by the table and the edit panel. The helper text follows the discussion in Slack: `client_id` is what the deployed app sends in OAuth requests to the Management API, and `app_id` is the primary key the app's author uses in platform APIs (for example to update or delete the app). Not in this PR: the Authorized apps table already shows its App ID with a copy button, so it is unchanged. No API or data changes. ## Please check - **Helper text wording.** Is it accurate for both IDs? - **Shortened IDs.** The first 2 and last 4 characters, with `****` between, only for IDs longer than 20 characters. ## Review instructions 1. Open **Organization → OAuth Apps** (`/org/<slug>/apps`) and create an app if there is none. 2. In **Publishable apps**, check that **Client ID** and **App ID** both show as shortened values, and that each copy button copies the full value. 3. Hover a shortened ID. It should show a tooltip with the full value. 4. Open the app's edit panel. Check that Client ID and App ID are labeled, show the full value, and copy correctly, and that the old `ID: ...` text under the app name is gone. Checked locally against the full platform stack (format, lint, type-check, and by eye). No tests added: the change is layout and display only. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: John Stokvis <345546350+stokvis-at-supabase@users.noreply.github.com> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: kemal <hello@kemal.earth> |
||
|
|
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> |
||
|
|
0c5d4d1bc1 |
fix(studio): reset selected orgs when switching scoped token resource access (#54323)
Switching resource access on the scoped access token form now clears the selected organizations as well as the selected projects, so a selection made in one mode doesn't carry over to the other. Adds a test covering the Project → Organization switch. |
||
|
|
a098c3be32 |
chore(studio): improve versioning onboarding comms (#54059)
## Problem We're going to release versioning in Public Alpha instead of Private, so we need to be more clear and loud about the new feature being introduced. ## Solution This PR makes a few changes mostly around communications and messaging: - Update `Private Alpha` badges to `Public Alpha` - Add admonitions in the feature preview modal - Prompt confirmation before enabling versioning on a bucket - Dedicated announcement banner in Storage layout - shown only to users with `storage.capabilities.object_versioning` enabled - Popover card when hovering over the Public Alpha badge See [update](https://linear.app/supabase/project/storage-object-versioning-and-lifecycle-policies-b5e5809a718e/activity#project-update-e9a50e15) for more context. ## Review instructions Functionality changes are minor so mostly check the above mentioned messaging and ui changes. |
||
|
|
418d251abe |
fix(studio): ensure we allow partial grants on all projects (#54311)
## Problem When users try to authorize all current and future projects with unsufficient permissions for an app that allows partial grants, the consent screen does not display the correct message and block them from authorizing the app. ## Solution Fix the conditions to display the proper message about missing features and allow authorization with partial grants. ## Review instructions - Configure an app that allows partial grants (must be member bound) - Configure a user without enough permissions (Read-only for instance) - Use the oauth example app to authorize the app with this user - Check that you are warned about missing features but that you can still authorize the app |
||
|
|
c2edb29076 |
fix(studio): explain Supavisor session pool limits DEBUG-43 (#53930)
## Problem When Supavisor rejects a session because its connection pool is full, Studio shows the error without explaining how to recover. ## Fix Show a troubleshooting step for the session-mode limit that explains how pool size limits concurrent clients and links to the configuration guide. ## Screenshot The Table Editor’s troubleshooting step, rendered locally with a sample session-pool error. <img width="660" alt="Expanded Supavisor session pool limit guidance in the Table Editor" src="https://github.com/user-attachments/assets/6072eec4-e243-4d53-a40f-30fb14d21d05" /> ## How to test - Display a classified MaxClientsInSessionMode error in Studio and expand its troubleshooting step. The link should open the pool size section of the database connection management guide. - Display a generic transaction-mode connection limit error. It should keep its usual fallback. - The pattern, classification and ErrorMatcher suites exercise these paths (144 tests passed locally). Fixes [DEBUG-43](https://linear.app/supabase/issue/DEBUG-43). |
||
|
|
5d6b070942 |
feat(studio): add Permission issue option to the support form (FE-5101) (#54079)
## Problem The support form's "What issue are you having?" dropdown has no option for permission problems. Users who are blocked by a permission error can't tell us that's what they're hitting, so the backend can't treat those submissions differently. Linear: https://linear.app/supabase/issue/FE-5101 ## Solution Adds a `Permission issue` option to the category dropdown. It is sent to `POST /platform/feedback/send` as `category: 'Permission_issue'`, the same way the other categories are. - `@supabase/shared-types` is an external package, so I followed the existing `Plan_upgrade` and `Others` approach and added the value to the local `ExtendedSupportCategories` type instead of the shared enum. - Added the new value to the assistant handoff zod schema so a handoff carrying this category passes validation. - Added a component test that selects the option and checks the submitted payload. This PR is frontend only. No backend behavior changes here. ## Review instructions 1. Open the support form (`/support/new`). 2. Open the "What issue are you having?" dropdown and check that `Permission issue` is listed after "Issues with logging in", with the description "Issues accessing an organization or project you should have access to". 3. Select it, fill in the summary and message, and submit. In the browser network tab, check the `POST /platform/feedback/send` request body contains "category": "Permission_issue"`. |
||
|
|
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. |
||
|
|
d86bc8fb9d |
fix(studio): keep the new MFA factor when clicking outside the verify dialog (#54223)
## Problem
On the account Security page, when you set up an authenticator app, a
click outside the "Verify authenticator app" dialog counts as a cancel
and unenrolls the factor that was just created. The dialog stays open
while that request runs, so you can still type a code and click Confirm,
and verification then fails with an unexpected server error. A page
element that stays clickable above the dialog, such as a consent banner,
triggers this easily.
## Solution
`ConfirmationModal` gets an optional `dismissOnInteractOutside` prop
(default `true`, so no other dialog changes). The authenticator verify
step turns it off. Only Cancel, the close button, or Escape cancel setup
and remove the unverified factor. The verify step also stays in its
loading state while an unenroll is in flight, so Confirm can't run
against a factor that is being deleted.
## How to verify
1. Open Account → Security and click Set up MFA. Enter a name and click
Generate QR code.
2. Click anywhere outside the "Verify authenticator app" dialog. The
dialog stays open, and the QR code and secret do not change.
3. Enter a valid code from the authenticator app and click Confirm. The
method is added ("MFA method added").
4. Repeat steps 1–2, enter a wrong code, and click Confirm. The toast
reports an invalid TOTP code, not an unexpected failure.
5. Repeat step 1, then click Cancel. The dialog closes and no unverified
authenticator remains in the list.
6. Open any other confirmation dialog in Studio and click outside it. It
still closes as before.
## Checks
Ran `pnpm turbo run typecheck --filter=studio --filter=ui-patterns`,
`eslint` (default and type-checks configs) on the changed Studio files,
`oxfmt --check` on the changed files, and `vitest run
components/interfaces/Account/TOTPFactors/AddNewFactorModal.test.tsx`.
The new test checks that an outside pointer or focus event does not
unenroll the factor and that Confirm then verifies it. It fails without
the fix.
## 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
- [x] I have added or updated tests where applicable
## Feedback for Tedd
To ask Tedd for a change to this PR, reply in Tedd's session on
[FE-5246](https://linear.app/supabase/issue/FE-5246/clicking-outside-the-mfa-setup-dialog-deletes-the-new-factor-so).
Tedd doesn't read comments on this PR.
---------
Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com>
|
||
|
|
dbe2237ad3 |
fix(studio): let Back leave a deleted project FE-5235 (#54293)
## Problem If a project was deleted while its Observability page was open, Studio redirected to the project list. Pressing Back reopened the deleted project and triggered the redirect again. [FE-5235](https://linear.app/supabase/issue/FE-5235) ## Fix Replace the inaccessible project’s browser history entry when redirecting to the dashboard. Back can then reach the page visited before the project. ## How to test 1. Open an account page and then navigate to a project’s Observability page. 2. Simulate a 404 for the project details request and refocus the tab so Studio revalidates the project. 3. After Studio redirects to the project list, press Back once. The account page should open. ## QA On the signed-in Studio staging preview for `ab907b13c0`, I opened a nonexistent project’s Observability URL from a healthy project. Studio redirected to the organization’s project list. One browser Back press restored the healthy project, and Forward reopened the project list. |
||
|
|
ce6c5e71fa |
feat(studio): OAuth app consent screen support for partial grants (#54213)
## Problem Supabase admins can enable support for partial grants on some apps but the consent screen doesn't support this scenario ## Solution Detect partial grant support and warn users when they lack some permissions, allowing them to confirm they want to authorize the app anyway <img width="846" height="2150" alt="image" src="https://github.com/user-attachments/assets/37c48da9-395b-4425-b33d-7acdc8f3dcc1" /> |
||
|
|
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 |
||
|
|
daef6f6e8d |
fix(studio): align scoped token permission controls (#54164)
## Problem The scoped token editor uses different access labels from OAuth. Its permission descriptions are smaller, and the accordion headers can cut across the rounded corners. ## Solution Use **No access**, **Read only**, and **Read and write** in the scoped token editor. Each permission keeps its existing access levels. Make descriptions easier to read, keep space around badges, and align selectors in a column on wider screens. Use the same colour for borders and dividers, and round the outside edges of the permission list and capability cards. Use sentence case for permission names in the picker and matching documentation. | Before | After | | --- | --- | | <img width="767" height="536" alt="CleanShot 2026-11-27 at 11 53 58" src="https://github.com/user-attachments/assets/f2c36703-9383-49cb-89f0-86f3da0de10c" /> | <img width="765" height="549" alt="CleanShot 2026-11-27 at 11 53 18" src="https://github.com/user-attachments/assets/c5abe728-47c9-4594-9787-aff2bc54efec" /> | ## Review instructions 1. With scoped tokens enabled, open **Account → Access Tokens** and click **Generate new token**. 2. Choose a resource and expand a permission group. Check the available access levels, the spacing around badges, and the selector alignment at desktop and narrow widths. 3. Expand and collapse the first and last permission groups. Open a scoped token’s details and check the capability card corners. |
||
|
|
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" /> |
||
|
|
f05fe34966 |
feat(ui): scroll area (#54023)
## Problem - on `/kb/guides/migrate-from-auth0` in safari 27 on macos, the mouse wheel does not scroll the page and a trackpad does - radix scroll area bar in the table of contents adds a non-passive `wheel` listener on `document` - webkit stops mouse-wheel page scroll when that listener meets `overscroll-behavior-y: none` on `html`, which kb sets ## Solution - replaces radix with base ui in the `ui` scroll area parts because base ui binds its wheel listener to the scrollbar element - replaces the radix `display: table` workarounds in the studio token sheets and the connect sheet with a reset of the base ui content `min-width` - changes the docs ask ai scroll area to use the `ui` scroll area - adds an inset focus ring to the scroll area viewport because base ui makes an overflowing viewport focusable - adds a `getAnimations` stub to the jsdom test setups because the base ui viewport calls it - adds `@base-ui/react` to the pnpm catalog + points the design system scroll area page at the base ui docs <!-- ## 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 preview [/kb/guides/migrate-from-auth0](https://kb-git-antlio-ui-scroll-area-supabase.vercel.app/kb/guides/migrate-from-auth0) in safari on macos with a mouse 2. turn the mouse wheel and make sure that the page scrolls and the table of contents marks the active heading 3. open the preview [/design-system/docs/components/scroll-area](https://design-system-git-antlio-ui-scroll-area-supabase.vercel.app/design-system/docs/components/scroll-area) and make sure that each demo shows its bar on hover and scrolls with the wheel 4. make sure that the horizontal demo scrolls sideways 5. press `tab` until a demo takes focus and make sure that it shows an inset focus ring 6. open a project in the [studio preview](https://studio-staging-git-antlio-ui-scroll-area-supabase.vercel.app/dashboard), click `Connect` and make sure that a long code line scrolls inside its code block and the sheet body does not scroll sideways 7. open the [docs preview](https://docs-git-antlio-ui-scroll-area-supabase.vercel.app/docs), press `cmd+k`, search for `auth` and make sure that the results list scrolls ## 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) |
||
|
|
4e589266af |
chore(billing): revised card errors (#54179)
- Improved error messaging around card errors and toast position to be closer to the actual action (customers often miss it in the top right) - For card errors when setting up payment methods with a direct error via the Stripe API, map to an appropriate actionable error message |
||
|
|
028d329417 |
Fix/studio observability timezone labels (#54198)
## Problem Observability date labels ignore the timezone set in the profile. They always show the browser timezone or UTC. The header range label (for example "Nov 27, 12:40pm → 12:50pm") uses bare `dayjs()`. The Data API charts (Total Requests, Error Counts, Response Speed, Network Traffic) pass `displayDateInUtc`, so the first and last timestamps under each chart always show UTC. ## Solution - Format the header range label with `useFormatDateTime()` on the Database, Auth, Storage, Realtime, PostgREST and Edge Functions observability pages. - Remove `displayDateInUtc` from the four Data API charts in `ApiRenderers.tsx`. - Use `text-xs` for the date labels in `BarChart`, so they match `ComposedChart` and `StackedBarChart`. This is a separate commit. ## Review instructions 1. Open Observability, Database, and set a timezone in your profile that differs from your browser. 2. Check that the range label next to the date picker and the tooltip show the same timezone. 3. Open Observability, Data API. Check that the labels under each chart follow the profile timezone and use the same font size as the Database charts. <details> <summary>Screenshots</summary> <img width="1124" height="844" alt="CleanShot 2026-11-27 at 13 37 14@2x" src="https://github.com/user-attachments/assets/e3d29c77-317a-4489-aa4c-1fbf4783cb57" /> font in Data API <img width="318" height="72" alt="CleanShot 2026-11-27 at 13 40 19@2x" src="https://github.com/user-attachments/assets/06e4d12f-245f-4d4e-9dc9-b7f2f7879e52" /> font in Database <img width="342" height="66" alt="CleanShot 2026-11-27 at 13 41 08@2x" src="https://github.com/user-attachments/assets/de200eb2-4351-471d-a220-bacea142b0d9" /> </details> ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill (not applicable, no docs changes) |
||
|
|
cddcdf5b41 |
Feat/studio observability chart grids (#54202)
## Problem Observability chart grids use a window breakpoint (`md:`), so with a side panel open the charts stay in two narrow columns. Several pages also stack every chart in one long column. ## Solution - Auth and Realtime: switch the chart grid from `md:` to a container query (`@4xl:`), so it follows the width of the content area. - Edge Functions, Storage and the shared API report (Data API, API Gateway sections): use the same two-column grid at `@4xl:`. - Database: two columns at `@6xl:`, because some charts are hard to read at half of 56rem. <details> <summary>Before</summary> <img width="3262" height="2168" alt="CleanShot 2026-11-27 at 15 05 58@2x" src="https://github.com/user-attachments/assets/8b7eb4da-f8c8-477d-861a-ecc5717867fb" /> <img width="3206" height="2544" alt="CleanShot 2026-11-27 at 15 06 23@2x" src="https://github.com/user-attachments/assets/de09dcdd-574a-433e-8bcd-a84e66352bfe" /> <img width="1146" height="1766" alt="CleanShot 2026-11-27 at 15 07 03@2x" src="https://github.com/user-attachments/assets/93a3a5e4-90cf-4876-847a-fa9cb96e88d5" /> </details> <details> <summary>After</summary> <img width="3146" height="2134" alt="CleanShot 2026-11-27 at 15 08 13@2x" src="https://github.com/user-attachments/assets/ef46c6b1-f9de-4256-b7ad-6d20e1d3e030" /> <img width="3168" height="2212" alt="CleanShot 2026-11-27 at 15 08 26@2x" src="https://github.com/user-attachments/assets/b83b0d8a-77f6-4ae4-a908-b29b55450e21" /> <img width="1084" height="2138" alt="CleanShot 2026-11-27 at 15 09 58@2x" src="https://github.com/user-attachments/assets/9d3b6e48-f2ef-42d2-91cf-e076136c8bcb" /> </details> ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) |
||
|
|
fb118a978c |
fix(studio): link maintenance banner titles to their status page (#54195)
## What
The incident banner links to the status page, but the in-progress and
upcoming maintenance banners had no link.
The maintenance banner titles ("Scheduled maintenance in progress",
"Upcoming scheduled maintenance") now link to that maintenance's own
status page entry (`item.url`).
To support this, `HeaderBanner`'s `title` prop now accepts `ReactNode`
instead of only `string`.
|
||
|
|
d85e9b8616 |
feat(billing): use new upcoming invoice data (#53342)
Makes use of the new data returned from the upcoming invoice endpoint and wraps it in an accordion-based layout. The current implementation is fairly bare-bones, so discussed with @kevcodez that we roll out this version first (which should already be an improvement), then talk to a designer on the team to get it polished. Ran `pnpm api:codegen:prod` from the root of the repo. The $10.01 in Compute Credits are an upstream data issue on Orb 😢 ## Testing If you'd like to test this in the browser, these are the steps: 1. checkout commit, launch local stack, create org + project; upgrade to paid 2. reach out to me so I can set up some usage and credits for your project/org 3. click around the upcoming invoice https://github.com/user-attachments/assets/6a814560-5d05-479a-a3f8-d658532b91c1 <img width="1180" height="235" alt="Screenshot 2026-11-13 at 10 03 01" src="https://github.com/user-attachments/assets/682083b7-77ea-4da8-a599-36f5063e922b" /> <img width="910" height="235" alt="Screenshot 2026-11-13 at 10 02 59" src="https://github.com/user-attachments/assets/59903f2a-2af4-4e18-8d97-35baee7401e0" /> <img width="815" height="140" alt="Screenshot 2026-11-13 at 12 03 17" src="https://github.com/user-attachments/assets/4370d10a-dc5a-4010-b03e-dcf0b23140d1" /> <img width="507" height="143" alt="Screenshot 2026-11-13 at 12 03 21" src="https://github.com/user-attachments/assets/3243855e-b02a-4e93-8139-5a7dfaad3230" /> |
||
|
|
832d238af3 | fix(logs): apply pathname exclusions when leaving the value FE-5233 (#54127) | ||
|
|
23424bec35 | fix(studio): use Databow for Warehouse connections (#54147) | ||
|
|
01c6966c9b |
chore(telemetry): add skill rules and rename three events (#54188)
The telemetry skill had no rules for mistakes I keep flagging in telemetry PR reviews, two of its sections repeated the rest of the file, and its approved verb list held verbs that no event uses or that another verb already covers. I added the rules, collapsed the repetition, cut four verbs, and renamed the three events whose verb is outside the list. **Changed:** - **New tracking rules**: I added rules for dismiss and abandonment events (a property must be able to differ at the call site), values captured at submit time, `track()` on conditionally rendered elements, debounced sends, events sent just before leaving the page, experiment exposure, and org-level events. I also added a rule for actions that change nothing: a bulk or menu action that changed nothing sends no result event, and a count property reports only the items that changed. The verify step now checks that case too. - **Shorter skill**: I changed "Review Rules" and "Implementing New Tracking" to link to the section that states each rule. I removed the verification checklist because each item duplicated a rule stated above it. - **Approved verbs**: I removed `intended` and `converted` (no event uses them) and `sent` and `moved` (one event each, both covered by another verb), and defined `created` against `added`. The skill now says the list is the authority. It used to say the list was derived from `telemetry-constants.ts`, which still holds older events with other verbs. I also stated when each verb fires: `clicked` and `submitted` in the handler, the rest once the result has happened. I updated the verb list in `.coderabbit.yaml` to match. - **Event renames**: `www_subprocessor_updates_subscribed` is now `www_subprocessor_updates_form_completed` (still sent after the successful response, so it keeps counting completed subscriptions), `realtime_inspector_broadcast_sent` is now `realtime_inspector_broadcast_submitted`, and `home_section_rows_moved` is now `home_section_rows_updated`. Nothing else in this repo references the old names. **Note:** after each app deploys, the renamed event is a new series, so a chart that spans the change needs both names. ## To test Tested on the PR preview: - [ ] On www, open `/legal/customer-resources/subprocessor-list`, submit the updates form with a test email, expect one `telemetry/event` request whose `action` is `www_subprocessor_updates_form_completed`, and no event after a failed submit. - [x] In Studio, open a project's Realtime Inspector, join a channel, send a broadcast message, expect one `telemetry/event` request whose `action` is `realtime_inspector_broadcast_submitted`. Observed: one request with that action and a 201 response, and no event after canceling the modal. - [x] In Studio, on the project home page, drag a section to a new position, expect one `telemetry/event` request whose `action` is `home_section_rows_updated` with `section_moved`, `old_position` and `new_position`. Observed: one request per drag, with `section_moved: "usage"`, `old_position: 1`, `new_position: 2`. I checked the staging analytics project: both new Studio event names showed up with matching counts, and neither old name did. ## Linear - fixes GROWTH-1584 |
||
|
|
d98f706b7c |
[FE-5109] (part 1) refactor(studio): migrate core hooks, lib, and prefetchers off next/router (#54053)
Part 1 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 ← this PR** | **Core navigation helpers, `hooks/**`, `lib/**`, `data/prefetchers/**`** | | 2 | #54054 | `components/ui/**` | | 3 | #54055 | `components/layouts/**` and `state/tabs.tsx` | | 4 | #54056 | Database, Branching, Compute, Edge Functions, Explorer, SQL Editor, Storage, Table Editor | | 5 | #54057 | Remaining `components/interfaces/**` and `QueryInsightsTable` router events | | 6 | #54058 | Remove `next/router` & `next/compat/router` shims, `_router-events.ts`, Vite aliases, and test mocks | Introduces the shared TanStack navigation helpers needed across the stack and migrates `hooks/**`, `lib/**`, and `data/prefetchers/**` off `next/router`. **Added:** - `navigateToUrl` in `apps/studio/lib/navigation.ts` (plus unit tests in `lib/navigation.test.ts`): shared helper for navigating to internal string URLs via TanStack's `useNavigate` (splitting pathname, search params, and hash via `splitInternalUrl`, and handling external/protocol-relative URLs) - `useRoutePattern` in `apps/studio/hooks/misc/useRoutePattern.ts` (plus `useRoutePattern.test.tsx`): returns the active matched TanStack route template (e.g. `/project/$ref/editor/$id`) as the replacement for Next's `router.pathname` **Changed:** - Migrated `hooks/misc/*` (`useHydratedQuery`, `useStudioCommandMenuTelemetry`, `useTableEditorFiltersSort`, `withAuth`) and `hooks/use-check-latest-deploy.tsx` to TanStack's `useLocation`, `useNavigate`, `useRoutePattern`, and `useParams` from `common` - Migrated `lib/profile.tsx` and `lib/telemetry/track.ts` off `next/router` - Migrated `data/prefetchers/project.$ref.tsx`, `project.$ref.editor.tsx`, and `project.$ref.editor.$id.tsx` to `useRouter().preloadRoute` - Wrapped `ReactQueryTestConfig` in `apps/studio/tests/helpers.tsx` with `RouterContextProvider` and updated hook/navigation tests (`useTableEditorFiltersSort*.test.*`, `useFilterLifeCycle.navigation.test.tsx`, `useTableFilter.navigation.test.tsx`, `useInboundBranding.test.ts`, `state/tabs.test.ts`) **Simplified:** - `navigateToUrl` passes `replace` straight through and documents that `url` must be an app-relative path or an external URL. `StudioFrameworkProvider`'s `push` now reuses it. - `useRoutePattern` reads matches and location in a single `useRouterState` subscription - `useTrack` and `useStudioCommandMenuTelemetry` take the pathname from `useFramework()`, the same source as pageviews, so custom events and pageviews always send the same pattern (e.g. `/project/[ref]/sql/[id]`). New tests pin the strings sent, and `toRoutePattern` now has its own unit tests. - Removed `useCurrentPath` (a one-line wrapper with one consumer): `OrganizationSettingsLayout` calls `useLocation` directly - Dropped the no-op `.catch(() => {})` on `preloadRoute` in the prefetchers (`preloadRoute` never rejects) - `useTableEditorFiltersSort` builds the next search with a spread instead of a delete loop - Added `createTestRouter()` to `tests/lib/custom-render.tsx`, and `customRender`/`customRenderHook` now return the `router`. The rest of the stack uses these instead of hand-copied `createRouter` setups. Addresses [FE-5109](https://linear.app/supabase/issue/FE-5109/replace-the-nextrouter-shims-with-tanstack-router-hooks) ## To test - [ ] Auth redirect flow (`withAuth`) still preserves `returnTo` query parameters when redirecting unauthenticated users to `/sign-in` - [ ] Table Editor sort and filter URL sync (`useTableEditorFiltersSort`) persists and clears `?sort=` / `?filter=` across table switches - [ ] Hovering project and table editor links still triggers route/data prefetching without console errors - [ ] Page view and command menu telemetry still records route patterns and paths accurately --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
aebdd909ce | fix(studio): allow Warehouse table selection for empty publications (#54185) |