mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 15:39:13 +00:00
docs/auth-rate-limits-reference
721
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. |
||
|
|
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> |
||
|
|
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> |
||
|
|
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. |
||
|
|
434c00cb14 |
Joshenlim/fe 5196 move off scaffold components for remaining (#53911)
## Context
Final clean up of deprecated Scaffold components, just touches
- Account audit logs
- Project home page
- Database -> Column privileges
- Storage -> Analytics bucket details
- Storage -> Vector bucket details
- Settings -> Infrastructure -> Disk management
- Settings -> Infrastructure -> Read replica details
- Integrations -> Wrappers overview (Only for non supported integration
UI)
- Edge functions -> Empty state
- Auth -> Performance
Also replaces usage of `ScaffoldDivider` with just the `Separator`
component
And also adjusts the page container sizes of database pages from large
to default - these only have visual differences on viewport widths
larger than a laptop
Testing just needs a quick sweep of all these surfaces to make sure
nothing looks weird - will do so on my end too once the builds go
through!
For @supabase/security's review - review requirement was triggered as
`Documents.tsx` was updated in the organization settings page. But it
was just to change the Divider component 🙏
|
||
|
|
87b9d0562e |
[FE-5111] refactor(studio): replace next/image shims with plain img (#54011)
Replaces all remaining `next/image` and `next/legacy/image` imports in `apps/studio` with plain `<img>` elements and deletes both compat shims and their Vite aliases (following #53906, which removed the last `next/image` import from `packages/ui-patterns`). **Changed:** - Replaced 26 `next/image` and 3 `next/legacy/image` call sites across `apps/studio` with plain `<img>` elements (every local `src` already prepends `BASE_PATH` / `router.basePath`, and none used `loader`, `priority`, `placeholder`, `quality`, or `onLoadingComplete`) - Converted `fill` / `layout="fill"` usages in `IntegrationCard`, `MarketplaceFeaturedHeroGrid`, `Integrations.constants`, `useAvailableIntegrations`, and `IntegrationPanels` to Tailwind sizing classes, and dropped no-op `layout="fixed"` props in `FormContents` and `HookList` - Replaced invalid `layout="fill" objectFit="cover"` props passed to `next/image` in `HelpPanel` with `absolute inset-0 h-full w-full object-cover` - Cleaned up image accessibility across the touched call sites (accurate alt text on feature preview screenshots and `HookList`, `alt=""` + `aria-hidden="true"` on decorative icons/illustrations next to visible labels) **Removed:** - `apps/studio/compat/next/image.tsx` - `apps/studio/compat/next/legacy/image.tsx` - `'next/image'` and `'next/legacy/image'` aliases from `apps/studio/vite.config.ts` ## To test - Confirm `git grep -E "next/(legacy/)?image" apps/studio/` has no remaining imports - Check images render as expected across the updated surfaces: - **Integrations marketplace** (`/project/_/integrations`): featured hero covers (`MarketplaceFeaturedHeroGrid`), integration icons in cards, sidebar, and wrapper rows (`Integrations.constants`, `useAvailableIntegrations`) - **Help panel**: Discord card background illustration - **Account & settings**: Account Connections GitHub icon, Add-ons cards (IPv4 / PITR / Custom Domain), Spend Cap card & side panel, user profile avatars (`ProfileImage`), and Feature Previews modal images - **Database Webhooks** (`FormContents`, `HookList`) and Third-Party Auth provider dropdown/cards --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
548abae3e9 |
fix(auth): open matching logs from Overview API errors FE-5191 (#53854)
## Problem On Auth Overview, following a failed sign-in from the Auth API Errors table opens a legacy text search. That search can miss the requests behind the count or include requests with a different method or status. ## Fix Open unified logs for the current project with the gateway source, HTTP method, path, and status from the selected row. Use the start and end timestamps of the query that produced the count. Closes [FE-5191](https://linear.app/supabase/issue/FE-5191). ## How to test 1. Open Authentication → Overview on a project with Auth API errors. 2. Follow the logs link on a failed sign-in row such as `POST /auth/v1/token`. 3. Check the project, API Gateway source, method, path, and HTTP status in Logs. The time range should match the 24-hour window used to fetch the row, even if the page has been open for a while. ## Compatibility and verification Explicit legacy Logs preferences still open the legacy gateway view. In unified logs, existing Path equals and Path does not equal filters now compare the complete path on both backends. Use Contains or Does not contain for substring matching. All 211 focused tests passed with retries disabled, along with Studio typecheck and formatting. Restoring the old substring predicates made the exact-path tests fail on both backends. Verified the click-through on the Studio staging preview for `c9186d34c0`. A `POST /auth/v1/signup` row with status 401 opened unified logs on the same project with the four expected filters. The time window was exactly 24 hours and the visible results matched the row. The component regression covers `POST /auth/v1/token` on both analytics backends. |
||
|
|
8728c41ad3 |
feat(studio): raise passkey relying party origins limit to 10 (#53735)
Raises the relying party origins limit in the Passkeys settings form and the passkeys guide from 5 to 10. |
||
|
|
48c90094d9 |
feat(studio): show Warehouse query activity in Observability (#53495)
## Problem Warehouse query activity is not available in Observability. ## Solution Add a Warehouse report showing query rate over the last hour, with loading, setup, no-data and request-error states. The report uses live project metrics and appears in navigation for projects with Warehouse access. | After | | --- | | <img width="2548" height="1416" alt="CleanShot 2026-11-17 at 16 55 33@2x" src="https://github.com/user-attachments/assets/4d6796e0-72f1-45d5-b6b7-2cd4a3577496" /> | | <img width="2552" height="1390" alt="CleanShot 2026-11-17 at 16 56 18@2x" src="https://github.com/user-attachments/assets/d96efdfd-4ca9-42fe-ac30-9cb4667c95d7" /> | | <img width="2544" height="1388" alt="CleanShot 2026-11-17 at 16 32 11@2x" src="https://github.com/user-attachments/assets/bc80af8d-0468-4229-98d0-ac2681823059" /> | | <img width="2560" height="1344" alt="CleanShot 2026-11-17 at 16 59 53@2x" src="https://github.com/user-attachments/assets/1ed70348-c2fc-4673-85a7-530d9734886c" /> | Visitor | What they see -- | -- Signed-in customer without Warehouse access | No Warehouse entry in Observability Customer with Warehouse access, not configured | “Warehouse is not set up” empty state and setup button Customer with Warehouse disabled | “Warehouse is disabled” empty state and setup button Customer with active Warehouse | Query rate chart, or the relevant loading/empty/error state ## Review instructions 1. Open the [Studio staging preview](https://studio-staging-git-dnywh-warehouse-metrics-client-supabase.vercel.app) with a staging project that has Warehouse access. 2. Go to **Observability > Warehouse**, or `/project/<ref>/observability/warehouse` ([example](https://studio-staging-git-dnywh-warehouse-metrics-client-supabase.vercel.app/dashboard/project/yirnfrgkxmnqgexikhfc/observability/warehouse)). 3. Check the query-rate chart after running Warehouse queries. A project without measurements shows an explicit last-hour empty state. 4. Open the report on a project where Warehouse is not set up and check the setup link. --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> |
||
|
|
27578cdfb5 |
fix(telemetry): send search query shape instead of raw text (#53500)
Search telemetry sent whatever people typed, and search boxes are a place where people paste credentials and personal data. I replace the raw text with a description of it. #53336 added the raw `query` to `kb_search_submitted`; docs search and the command menu already sent it. **Changed:** - **I send a description of the search term**: `kb_search_submitted`, `docs_search_v2_search_submitted`, `docs_search_v2_result_clicked` and `command_menu_search_submitted` now send `queryLength` and `queryWordCount`, measured after trimming and collapsing repeated whitespace. - **Text only for keywords**: the term itself (`query`, `value`, and `search_query` on `command_menu_command_clicked`) is sent only when it is up to 4 letters-only parts of at most 16 letters each, 40 characters in total. Keys, tokens, emails, IDs, project refs and connection strings never match. Over the last 30 days that shape covers about 96% of command menu searches, 88% of docs searches and 73% of KB searches, so term-level analysis such as no-result queries keeps most of its data. - **I removed `keywords` from the auth users search event**: `auth_users_search_submitted` no longer carries it. Those terms identify customers' end users, and I confirmed nothing downstream reads them. - **The `keywords` URL parameter is redacted wherever telemetry copies a URL**: the Auth users page keeps the search term in its URL, so I replace the value with `keywords=redacted` in the page URL, query string and referrer we send, and in the posthog-js `before_send` hook for the URL properties the SDK fills in on its own (`$session_entry_url`, `$initial_current_url`, `$referrer`, `$initial_referrer`). The URL in the browser is unchanged. **Note:** a letters-only name or passphrase still matches the keyword shape, and longer questions lose their text. I opened this in place of #53435, which removed `query` from the KB event only. ## To test Tested on the PR previews (docs, kb, studio-staging), reading the request bodies sent to `/platform/telemetry/event`: - [x] Docs: open search and type `auth`, expect `docs_search_v2_search_submitted` with `query: "auth"`, `queryLength: 4` and `queryWordCount: 1`. Observed exactly that, with `hasResults: true`. - [x] Docs: type `person@example.com`, expect the same event with `queryLength: 18` and no `query`. Observed, and no telemetry body in that step contained the address. - [x] KB: search `how do I reset my database password`, expect `kb_search_submitted` with `queryLength: 35`, `queryWordCount: 7` and no `query`. Observed. - [x] KB: search `storage policies` with two spaces, expect `kb_search_submitted` with `query: "storage policies"` and `queryLength: 16`. Observed, with `queryWordCount: 2`. - [x] Studio: open the command menu and type `abcdefghijklmnopqrst`, expect `command_menu_search_submitted` with no `value`, then type `auth` and expect `value: "auth"`. Observed both, with `queryLength` 20 and 4. - [x] Studio: on Auth > Users, search `person@example.com`, expect `auth_users_search_submitted` with no `keywords`. Observed: `trigger`, `sort_column`, `sort_order`, `providers` and `filter_column` only. - [x] Studio: with `?keywords=person%40example.com` in the Auth > Users URL, reload, then trigger an event on the page, expect `page_url` and `ph.search` in the request body to carry `keywords=redacted` and the address bar to keep the real term. Observed on all three events from that page, and the address bar kept the term. - [x] Studio: from that URL, do a full page load to another project page and trigger an event, expect `ph.referrer` to carry `keywords=redacted` while `document.referrer` keeps the real term. Observed on all three events from the new page. - [x] Studio: after that session, query the staging analytics project for events from the preview host, expect no property value to carry the address or anything but `keywords=redacted`. Observed: none of the events in the test window carried the address, and the SDK's own `$set`, `$pageview` and `$pageleave` events arrived with `keywords=redacted` in `$current_url`, `$referrer` and `$initial_current_url`. The session started on a page without the parameter, so `$session_entry_url` was not exercised here; the unit test on the `before_send` hook covers it. ## Linear - fixes GROWTH-1501 |
||
|
|
bbb0af65cb |
[FE-3106] (part 14) – refactor(studio): drop the dual-runtime shims and aliases (#53223)
Drops the remaining Next-era shims and aliases that only existed for the dual runtime (FE-3106). Part 14 of the stack. **Depends on:** #53222 **Changed:** - ~45 files – import Sentry from `@sentry/react` directly instead of the aliased `@sentry/nextjs` - `hooks/ui/usePreventNavigationOnUnsavedChanges.ts` – is now the TanStack `useBlocker` implementation (previously swapped in by a Vite alias) - `components/interfaces/App/RouteValidationWrapper.tsx` – `next/router` → `useNavigate` + the leaf route's `fullPath` (`/project/$ref/sql/$id`) for the exempt-route and last-visited checks - `hooks/misc/withAuth.tsx` – no `getLayout` forwarding - `TemplateEditor.test.tsx` – renders inside a router for the unsaved-changes blocker **Removed:** - `compat/sentry-nextjs.ts` and its Vite alias, the `usePreventNavigationOnUnsavedChanges` alias and Next hook, `types/next.ts` (`NextPageWithLayout`), the `@sentry/nextjs` dependency The `compat/next/*` shims for `link`, `router`, `head`, `image`, `navigation`, `dynamic` and `script` stay: about 300 components outside `routes/**` still import them. Addresses [FE-3106](https://linear.app/supabase/issue/FE-3106/move-page-bodies-into-route-files-and-delete-pages). ## To test - Trigger an error (e.g. a failing query) – it reaches Sentry as before - Edit an email template or edge function and navigate away – the unsaved-changes prompt appears - Open an org you don't belong to – toast and redirect home; open a SQL snippet, leave and come back – last snippet is restored --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
d31c7d1603 |
[FE-5104] fix(studio): validate site url and redirect urls (#53492)
The Auth URL Configuration page saved Site URLs and redirect URLs containing spaces or backslashes. `SiteUrl` only checked that the value was non-empty. `urlRegex()` in `Auth.constants.ts` wasn't anchored, so any valid prefix passed (`https://foo bar.com`, `http://localhost:3000\`). This isn't a TanStack regression: both gaps go back to before the migration (#44803, #30138), and the Next and TanStack routes render the same `SiteUrl`/`AddNewURLModal` components. **Changed:** - `urlRegex()` is anchored and rejects whitespace and backslashes. This also tightens its other callers (provider forms, SMTP host), which now reject trailing junk after a valid prefix. The localhost branch also accepts `?`/`#` right after the host, so scheme-less values such as `localhost:3000?x=1` that pass today still pass. - New `getUrlCharacterError` and `getSiteUrlError` helpers give specific inline errors ("can't contain spaces/backslashes/wildcards", "Please provide a valid URL, such as https://example.com"). - `SiteUrl` still trims, then rejects interior whitespace, backslashes, wildcards and non-absolute URLs. `getSiteUrlError` also rejects the `javascript:`, `data:`, `file:` and `vbscript:` protocols and requires `scheme://`. Without that, a scheme-less `localhost:3000` would parse with `localhost:` as its scheme. Custom app schemes such as `myapp://callback` still work. `onSubmitSiteUrl` is now typed instead of `any`. - The Azure, GitLab, Keycloak, WorkOS and SAML URL fields in `AuthProvidersFormValidation.tsx` now `.trim()` before checking `urlRegex()`, so a trailing space no longer fails the now-anchored regex. - `AddNewURLModal` shows the specific character error before falling back to "Please provide a valid URL". **Added:** - Unit tests for `urlRegex()`, `getUrlCharacterError` and `getSiteUrlError`, including unsafe protocols and scheme-less `host:port`. - `AuthProvidersFormValidation.test.ts`: each provider URL field trims surrounding whitespace and rejects interior spaces. - Component tests for `SiteUrl` and `AddNewURLModal` covering spaces, backslashes, wildcards and invalid URLs, plus saving every supported redirect URL form. The new rejection tests fail without the fix. - `AddNewURLModal.test.tsx` now uses MSW (`customRender` + `addAPIMock`) instead of `vi.mock('@/data/...')`. Addresses [FE-5104](https://linear.app/supabase/issue/FE-5104/dashboard-allows-spaces-in-the-site-url). ## To test - [ ] Auth > URL Configuration, set Site URL to `https://my app.example.com` and save – "Site URL can't contain spaces", nothing saved - [ ] Site URL `http://localhost:3000\` – "Site URL can't contain backslashes" - [ ] Site URL `https://*.example.com` – "Site URL can't contain wildcards" - [ ] Site URL `example.com` or `localhost:3000` – "Please provide a valid URL, such as https://example.com" - [ ] Site URL `javascript:alert(1)` – "Site URL can't use the javascript: protocol" - [ ] Site URL `myapp://callback` – saves - [ ] Site URL ` http://localhost:3000 ` – saves as `http://localhost:3000` - [ ] Add URL, enter `https://my app.example.com` – "URL can't contain spaces"; `myapp://callback\` – "URL can't contain backslashes" - [ ] Sign In / Providers > Keycloak, enter a Realm URL with a trailing space and save – no "Must be a valid URL" error; saved without the space - [ ] Add URL, paste `https://*.example.com/** http://localhost:3000/* com.example.app://callback chrome-extension://abcdefghijklmnop` – splits into 4 rows and saves all 4 Ran typecheck, lint ratchet, knip, Prettier, and the Auth vitest suites. --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
07574deea7 |
chore(studio): refine log detail panel (#52750)
<img width="823" height="614" alt="image" src="https://github.com/user-attachments/assets/1c1ac47f-07e2-4bbe-a91e-5690e849e519" /> ## Problem The log detail panel felt cramped. The header split across two lines, contrast between the header, tabs and properties was weak, and long values overflowed their column. Edge function logs also had no path in the unified logs query, so their title fell back to the raw event message, which repeated the status and cut off the function name. The panel also moved under the user. Clicking a Timeline step jumped to Overview, so stepping through a request meant switching back each time, and an "Enriching log..." row pushed the details down while they loaded. ## Solution - **Header:** one line with the type icon, status badge, method and path. The log type name moves to the icon's tooltip. Long paths clip from the start so the most specific segment stays visible. - **Type and spacing:** 15px title, 12px property labels and values, 40px section and "Logged" rows, and more room around the tabs. The panel uses the card background. - **Long values:** wrap inside their column instead of overlapping the label. - **Edge function paths:** the ClickHouse query now reads `request.pathname` for `function_edge_logs`, matching the BigQuery query. - **Timeline:** clicking a step keeps the Timeline tab open, while the header, actions and other tabs follow the clicked log. A single hidden step is shown instead of "+1 more", and the first step shows its absolute time in place of the "Request started" row. - **Loading:** the header's type icon becomes a spinner of the same size while the log's details load, replacing the "Enriching log..." row. - **User tab:** the "No signed-in user" state uses the same centered empty state as the Timeline tab. Side effects to check: - Edge function rows now fill the Path column, so function-scoped tables can show that column. Path filters and facets include these rows, and Timeline steps show method and path. - Audit Logs and the Auth Users panel share these components. Audit Logs picks up the taller section rows, and Auth Users fields drop to 12px. ## How to test On `/project/<ref>/logs`: 1. Select an API Gateway log. The header is one line: icon, status badge, `METHOD /path`. The icon spins while details load, and nothing below it shifts when it stops. 2. Open **Timeline** and click a few steps. The tab stays on Timeline while the header and highlight follow each click, and Overview then shows the clicked log. The first step shows a time instead of `+0 ms`. 3. Select an edge function log. The title shows `METHOD /functions/v1/<name>` and the Path column is filled. Filtering by part of that path matches these rows. 4. Select a Postgres log. The title shows the message, and its **User** tab shows a centered empty state like Timeline's "No related logs". 5. Select a log with a long URL in a narrow panel. Values wrap inside their column and the title clips from the start. This has only been checked in Chromium. 6. Open an entry in Audit Logs and a user in Auth > Users, and check the spacing and type. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
ad69889569 |
feat(studio): show Google client IDs one per line when read-only (#53321)
## Problem In the Google sign-in provider settings, the Client IDs field is a single-line input. When several comma-separated IDs are configured, the value overflows the input, so it is hard to tell whether an ID is already present. Linear: FE-4476 ## Solution Show the IDs one per line when the field is not being edited, and the original comma-separated string while it is focused. - Not focused: the field is read-only and shows one ID per line, in the stored order. - Focused: the field is editable and shows the exact stored string. - The stored value, the validation, and the API payload are unchanged. Typing does no conversion. - If the field is read-only or disabled, it stays in the one-per-line view. It adds a small `CommaSeparatedListInput` component and a new `comma-separated-list` field type, used only for the Google Client IDs field. ## Review instructions 1. Open a project and go to Authentication > Sign In / Providers > Google. 2. Enable Google sign-in and enter several client IDs separated by commas, then save. 3. Reload the page and reopen Google. Check that the IDs show one per line, in the order you saved. 4. Click into the field and check that it shows the original comma-separated string. 5. With Google enabled, add a trailing comma or a space and click Save. Check that the validation error appears and no request is sent. |
||
|
|
acde41a2e2 |
feat(studio): add magic link and email OTP toggle to email provider settings (#53308)
## What changed Adds an "Enable magic links and email OTP" toggle to the Email provider settings in Auth. It maps to the new `EXTERNAL_EMAIL_MAGIC_LINK_DISABLED` auth config field, inverted in the UI the same way `SMS_AUTOCONFIRM` is (via `doubleNegativeKeys`). ## Notes - `packages/api-types` does not include the new field yet; the form reads config values untyped, so this works before the types are regenerated. - Typecheck shows no errors under `Auth/`. Not yet verified in the UI against a backend that returns the field; no tests added. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
0ed90ae460 |
fix(ui): split button divider (#53258)
## Problem - in dark mode split button shows a middle divider that is lighter and heavier than the outer edge, and the design system `button-split-dropdown` example has the same bug - button edge is a translucent inset shadow over a translucent fill, so the `-ml-px` overlap stacks two edges and two fills in one column - light mode has the same defect on hover and with the menu open, because the hover fill is translucent too ## Solution - adds a `SplitButtonGroup` component to `ui`, so a split button has a `role="group"` wrapper and one shared divider - fixes the divider color in both themes, because only one button paints the shared border column - changes the shared column to follow the hovered button, so the divider takes its edge color in a fixed place - removes the press scale from buttons in the group, so no gap opens between the two buttons - changes the design system split button docs to `SplitButtonGroup` | before | after | | -------|------| | <img width="428" height="219" alt="image" src="https://github.com/user-attachments/assets/4cbc5dc9-3575-4eef-83b9-a6141796ccc8" /> | <img width="428" height="219" alt="image" src="https://github.com/user-attachments/assets/9c5b283d-e6bd-428a-bee1-7f59249aeb83" /> | | <img width="428" height="219" alt="image" src="https://github.com/user-attachments/assets/046338f9-6dfd-4c32-8e33-30c1b0f84715" /> | <img width="428" height="219" alt="image" src="https://github.com/user-attachments/assets/c79e1c7a-e1ac-4682-a898-1a36c6b028fc" /> | <!-- ## Preview links If relevant, include links to changed pages for easy review access. Copy the preview base URL from the Vercel bot comment on this PR. Use the following table as an example template. | Site | Live | Preview | Search for | | -------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ----------------------------- | | WWW | [/blog/your-post](https://supabase.com/blog/your-post) | [/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post) | unique phrase from the change | | Docs | [/docs/guides/your-page](https://supabase.com/docs/guides/your-page) | [/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page) | unique phrase from the change | | Studio | [/dashboard](https://supabase.com/dashboard) | [/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard) | unique phrase from the change | | Design system | [/design-system](https://supabase.com/design-system) | [/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system) | unique phrase from the change | | UI library | [/library](https://supabase.com/library) | [/library](https://ui-library-git-branch-name-supabase.vercel.app/library) | unique phrase from the change | | Knowledge base | [/kb/guides/your-page](https://supabase.com/kb/guides/your-page) | [/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page) | unique phrase from the change | --> <!-- ## Additional context Optionally add any other context or screenshots. --> ## Review instructions 1. open the [/design-system/docs/components/button](https://design-system-git-antlio-fix-split-button-divider-supabase.vercel.app/design-system/docs/components/button#split-with-dropdown) preview in dark mode, and zoom in on the split example 2. make sure that the divider has the same color and weight as the outer edge 3. hover the primary action, and make sure that the divider takes its edge color and stays in the same place 4. hover the chevron and open the menu, and make sure that the divider takes the chevron edge color 5. switch to light mode, and repeat steps 2 to 4 6. press and hold the primary action, and make sure that it does not shrink 7. tab to the chevron, and make sure that the focus ring shows on all four sides and that Enter opens the menu 8. open the [/design-system/docs/fragments/admonition](https://design-system-git-antlio-fix-split-button-divider-supabase.vercel.app/design-system/docs/fragments/admonition#split-button-with-dropdown) preview at a narrow width, and make sure that the split fills the row with one divider 9. open the [/dashboard/project/\_/settings/log-drains](https://studio-git-antlio-fix-split-button-divider-supabase.vercel.app/dashboard/project/_/settings/log-drains) preview, and make sure that the `primary` split looks the same as on master ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
395a54f2b7 |
feat(studio): gate jwt signing keys, legacy api keys, and third-party auth on grants (#53241)
Resolves [FE-4732](https://linear.app/supabase/issue/FE-4732/grants-rollout-jwt-signing-keys-legacy-api-keys-and-third-party-auth). ## Changes Gates the JWT signing keys, legacy API keys, and third-party auth endpoints on grants instead of `unguarded.migrating`, and replaces their V2 permission guards with `useGrant`: - **Data layer (11 sites):** `data/jwt-signing-keys/*`, `data/api-keys/legacy-api-keys-status-query`, `data/api-keys/legacy-api-key-toggle-mutation`, and `data/third-party-auth/*`. Queries become grant-gated query option factories; mutations take the grant in their variables. - **Consumers:** the JWT settings page, the JWT signing keys table and its dialogs, `jwt-settings`, `ToggleLegacyApiKeys`, `Project/APIKeys`, and the third-party auth page, form, and create dialogs. Each consumer renders denied and error states. - **JWT signing keys table:** - It's gated only on the signing keys reads (`GET signing-keys` and `GET signing-keys/legacy`, both `auth_signing_keys_read`). - The legacy API keys status is only used by the revoke dialogs. If it can't be read, revoking the legacy JWT secret fails closed: the user sees the "disable legacy API keys first" warning, with copy explaining why, instead of the confirm modal. - **Legacy JWT secret query:** a 404 (secret not imported as a signing key yet) resolves to `null` and shows the "Migrate JWT secret" panel. Other errors now render an error instead of being treated as "not migrated". - **Write actions:** - `getWriteGrantTooltip` moves from `APIKeys.utils` to `lib/grants` and takes a resource noun. Disabled write actions use it to explain why they're disabled. - New `getWriteGrantToastMessage`: handlers that run without a grant now show a toast instead of silently doing nothing. This includes the API keys handlers from #52966. ## Permission changes - **Legacy API keys toggle and status** (`GET`/`PUT /v1/projects/{ref}/api-keys/legacy`): the guard moves from `auth_signing_keys_read`/`_write` to the endpoint annotation, `api_gateway_keys_read`/`_write`. The annotation was confirmed against the backend controller (FE-4728). As a result, the JWT signing keys table's legacy revoke check now depends on `api_gateway_keys_read`. - **API keys last-used analytics** (`/platform/projects/{ref}/analytics/endpoints/api_keys.last_used.otel`): this endpoint uses legacy permissions (`analytics:Read` on `logflare`), not FGA. Its check moves from the V2 `auth_signing_keys_read` check to `useAsyncCheckPermissions(PermissionAction.ANALYTICS_READ, 'logflare')`. - Every other guard already matched its annotation: - `auth_signing_keys_read`/`_write` for signing keys - `auth_config_read`/`_write` for third-party auth ## Testing - Data layer: `jwt-signing-keys.test.ts`, `legacy-api-keys.test.ts`, and `third-party-auth.test.ts` cover every migrated fetcher, check that factories stay disabled without a grant, and cover legacy-key 404 vs. 500. - `jwt-secret-keys-table/index.platform.test.tsx`: - Legacy status denied: the table still renders, and revoking the legacy key shows only the warning. - Legacy status known enabled or disabled. - Signing keys read denied. - Legacy key 404 vs. 500. - `create-key-dialog.platform.test.tsx`: triggering create without a grant shows the toast and sends no request. - `ToggleLegacyApiKeys.platform.test.tsx`, `ThirdPartyAuthForm.platform.test.tsx`, and `settings/jwt/index.platform.test.tsx`: granted, denied, error, and partial-permission cases. - `lib/grants.test.ts`: the tooltip and toast helpers. 🤖 Generated with [Claude Code](https://claude.com/claude-code) |
||
|
|
653dfb7104 |
Fix client crash when landing on new project page (#53206)
## Why it's happening
Opening `/new/[slug]` on the TanStack/Vite dev server crashes with
`TypeError: Cannot read properties of undefined (reading 'from')`. It is
thrown from `.vite/deps/randombytes.js`, inside a `<Lazy>` boundary.
From what I understand it's happening as:
- `lib/project.tsx` imports `generate-password-browser`, which imports
`randombytes`, which imports `safe-buffer`.
- `safe-buffer` calls `require('buffer').Buffer.from`.
- In dev, Vite swaps the Node `buffer` built-in for an empty stub, so
`Buffer` is `undefined`.
Fix is to alias `buffer` to the `buffer` npm package in
`vite.config.ts`, and add `buffer` as a direct Studio dependency.
It's oddly only happening on local but not staging/prod which I'm not
too sure why honestly. Afaict from investigating with Claude, prod
builds already bundle the real `buffer` package, so `Buffer.from` exists
there, but not exactly sure how the build finds it, since nothing in the
repo declared it.
## To test
Only on local:
- [ ] First verify if the client crashes when landing on `/new/[slug]`
- Please let me know if this isn't happening on your end in which case
it might be something on my machine then perhaps
- [ ] Then checkout this branch and verify that client doesnt crash when
landing on `/new/[slug]`
---------
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
f314e6dc19 |
feat(studio): one click attribute filters in the unified logs overview panel (#53170)
## Problem Filtering via properties in the Overview tab of Unified Logs had a couple of clicks to it. ## Solution Attribute rows now expose equals and not-equals directly, through one shared code path. - **Hover devices** (`(hover: hover) and (pointer: fine)` above `md`): hovering or keyboard-focusing a row reveals borderless icon buttons at its right edge — equals, not equals, copy — following the same reveal pattern as the "Only" button on the sidebar filters. The value fades out behind them so nothing is occluded or reflowed. - **Touch devices and small viewports**: unchanged dropdown, now listing "Filter: equals", "Filter: not equals" and "Copy <attribute>" instead of the single "Add filter". - Only rows that can actually be filtered get filter actions; everything else gets copy alone. | Before | After | |--------|--------| | <img width="451" height="191" alt="Screenshot 2026-11-09 at 16 12 08" src="https://github.com/user-attachments/assets/ffc68a34-4373-44ea-8922-8f5b3dd436a0" /> | <img width="465" height="148" alt="Screenshot 2026-11-09 at 16 12 25" src="https://github.com/user-attachments/assets/0bf41014-25d7-4390-ba5f-ab7a796ec1de" /> | ## Review instructions 1. Open the preview, go to a project's Logs, and click a log row to open the detail dock on the Overview tab. 2. Hover a filterable row (Path, Method, Status, or any attribute). Equals, not-equals and copy buttons fade in at the right edge; the value fades out. Tab into them to check the focus rings and tooltips. 3. Click the equals button on Path. The filter appears in the filter bar and the log list updates. Do the same with not-equals on another row and confirm the chip uses `<>`. 4. Hover a row that can't be filtered (for example Host or Client). Only the copy button appears, and no filter action is offered. 5. Apply the same filter twice — no duplicate chip. Then apply the opposite operator on that column — the chip's operator is replaced rather than mixed. 6. Narrow the window below 768px (or use a touch device). The hover buttons disappear and clicking a row opens the dropdown with "Filter: equals", "Filter: not equals" and "Copy <attribute>". |
||
|
|
2c871b42b7 |
fix(studio): show OAuth app client secret in a blocking modal (#53167)
## Problem After creating a confidential OAuth app or regenerating its client secret, the credentials appeared in a small dismissible banner above the apps table. The secret can't be retrieved again, so a missed banner meant regenerating the secret and breaking existing integrations. ## Change - Replace `NewOAuthAppBanner` with `NewOAuthAppModal`, following the pattern of the S3 access key `CreateCredentialModal`. - The modal shows the client ID and client secret with copy buttons and states the secret won't be shown again. - It can only be closed with Done. Outside clicks, Escape and the close button are blocked. - Public apps (no client secret) and plain edits behave as before: no modal. - Create and both regenerate entry points (row menu and sheet) feed the same modal, so no data-layer changes. Step 1: <img width="420" height="251" alt="Image" src="https://github.com/user-attachments/assets/74430837-90fd-49e9-9441-234abc97588a" /> Step 2: <img width="420" height="375" alt="Image" src="https://github.com/user-attachments/assets/92ab3786-8bd1-46cf-a4b4-b2643f288e65" /> ## Testing - Added `NewOAuthAppModal.test.tsx`: credentials and warning render, no modal for public or missing apps, only Done dismisses. - Manual: Authentication → OAuth Apps → create a confidential app, and regenerate from the row menu and the sheet. Closes #53116 Linear: FE-4976 |
||
|
|
c0e92057a6 |
feat(studio): split SQL errors into user and Studio SQL (#53059)
Part of FE-4772. ## Why Errors from the pg-meta query endpoint didn't say who wrote the SQL, so a Sentry issue like SUPABASE-APP-KXE couldn't tell a user's query from one Studio composed. That event came from the assistant's `execute_sql` tool and was captured by the Vercel AI integration on the server, so it skipped `reportStudioError` and had no fault tags. The Postgres message also went to Sentry as-is, and it can contain user SQL and data. ## What - **`sqlOrigin` is required on `executeSql`.** `'user'` covers SQL the user or an AI agent wrote, in whole or in part: SQL editor, editor panel, Explorer, AI `execute_sql` and `run_notebook`, report blocks, Query Insights EXPLAIN, the policy, function, and cron editors, and running a stored cron job. Everything else is `'studio'`. The policy, function, and cron mutation hooks and `useDbQuery` take `sqlOrigin` too. - **`classifySqlResponseError`** turns a 400 from the query endpoint into `UserSqlError` (`user`, `user_sql`) or `StudioSqlError` (`studio`, `studio_sql`). Pattern rules (connection timeouts) and other statuses keep their classes. - **`UserSqlError` never reaches Sentry.** Its routing is `SAMPLE_NEVER`, `alwaysCapture` doesn't override it, and `beforeSend` drops it. - **`StudioSqlError` is redacted.** Error classes can set `sentryMessage`; for `StudioSqlError` it is the SQLSTATE and the query's `queryName`, a static name that `executeSql` requires for Studio SQL. The query key is never reported, since its segments can hold IDs, schemas, and search terms. `applyStudioErrorPolicy` applies it from `beforeSend` on the client and the server, so it holds however the error was captured. The server config gets a `beforeSend` for this. Events get `query_name` and `sql_state` tags and are grouped by both, since every SQL error shares the `executeSql` stack. - **A custom `handleError` gets the classified error**, matching its declared type. The SQL editor, editor panel, and policy editor rethrow it, so their errors are now `UserSqlError` instead of being reported as `UnexpectedError`. The error keeps Postgres's `position` for the editor's line highlight. The error message, `formattedError`, and `position` stay on the error for the UI. The query-performance Sentry context no longer carries the raw error message, which bypassed redaction. ## Known gaps - Index advisor queries run users' query text from `pg_stat_statements` but are marked `'studio'`. Redaction keeps the text out of Sentry, but their failures count as Studio faults. - 5xx responses for user SQL are still `PlatformError` and keep their message. - The self-hosted MCP `executeSql` calls `executeQuery` directly and isn't covered. ## Testing - Unit tests for `classifySqlResponseError`, `applyStudioErrorPolicy`, and the client `beforeSend`. - Full Studio vitest suite passes except `useReportDateRange.test.ts` (169 vs 168 hourly buckets across the DST change), which this PR doesn't touch. |
||
|
|
fe7b3ad6af |
chore: bump @graphql-codegen and its deps (#52785)
## Problem `@graphql-codegen/cli` and related packages in `apps/studio` and `apps/docs` were pinned to old major versions (`cli` 5.0.5, `typescript` 4.1.6, `typescript-resolvers` 4.5.0). ## Solution - Bump `@graphql-codegen/cli` to `^7.0.0` and `@graphql-codegen/typescript-resolvers` to `^6.0.0`. Drop the explicit `@graphql-codegen/typescript` dependency from `apps/docs`. - Regenerate the Studio GraphQL output in `apps/studio/data/graphql/` with the new codegen. The generated files now include an `index.ts` export change, and `graphql.ts` is much smaller. - Refresh `apps/studio/scripts/schema.graphql`, which picks up the new `ManagementApiReference` search result type. - Update `.prettierignore` (ignore `apps/studio/.output`, `apps/studio/dist`, and all of `apps/ui-library/public`) and run Prettier on the regenerated files. ## Review instructions 1. Check the dependency bumps in `apps/studio/package.json` and `apps/docs/package.json`. 2. Re-run the Studio codegen and confirm it produces no diff in `apps/studio/data/graphql/`. 3. Run `pnpm typecheck` and confirm the GraphQL consumers in Studio still compile. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
6d08d66b7d |
Add eslint rule for google translate dynamic spans + address all issues (#52949)
## Context We've been seeing many `NotFoundError: Failed to execute 'removeChild' on 'Node'` and `NotFoundError: Failed to execute 'insertBefore' on 'Node'` events on Sentry which are historically known to be caused by Google Translate in the browser. There's technically no _right way_ to address this unfortunately, but one of the solutions which should address most of these issues is to wrap any dynamic text within a span - we've considered that quite a while back tbh but never took the time to do this until today with the help of Claude. Although just a heads up that it might not necessarily completely eradicate those issues. Also added an eslint rule which should prevent future occurences of this <img width="1264" height="192" alt="image" src="https://github.com/user-attachments/assets/b2c32ea0-45a2-4ccd-82fe-1a859905fc29" /> |
||
|
|
7c52a9b539 |
Joshenlim/fe 3931 re phone mfa enrollment repeatedly force disabled despite (#52629)
## Context In Authentication -> Multi Factor, if you've set SMS MFA to any status apart from "Disabled" and refresh the page, the UI seemingly doesn't render the right value in the dropdown as such: <img width="1114" height="160" alt="image" src="https://github.com/user-attachments/assets/d3353628-0b9a-4347-b81f-3a968a87b5c2" /> Was happening as the form mounted with placeholder values (for SMS MFA, default status was "Disabled"), and the real value was only applied afterwards by a `useEffect` which called `reset`. This changed the `Select`'s value after mount, in Radix then fires an event on that change through `onValueChange` which set `value` as an empty string `''`. It happens as well for TOTP, if you set any value other than "Enabled" which is the default status. ## Changes involved - Am also opting to breakdown `MfaAuthSettingsForm.tsx` into smaller components as it's a single file handling 3 different forms at the moment - (Main fix) Derive the form values via `defaultValue` instead of via `useEffect` which prevents the unintended firing of `onValueChange` for the `Select` |
||
|
|
86848fc036 |
docs: move the production security checklist to its own page (#52466)
Closes DOCS-1494 ## Problem The Security section of the Production checklist is split out as a part of the Information Architecture plan laid out in Option 1 of the [Docs navigation architecture proposal](https://app.notion.com/p/supabase/Q4-2027-Proposal-Docs-navigation-architecture-3f25004b775f81f49dbad710a732ef61). ## Solution - **Structure:** move `## Security` to `guides/security/production-checklist`. The production checklist keeps the heading, and its `#security` anchor, with a one-sentence pointer. The page is in the Security sidebar under Guides, after Production Checklist. - **Option 1 navigation:** the "Production security checklist" entry in Run and manage, Security and compliance, points to the new page. The Option 1 test no longer expects the anchor. - **Page shape:** a value-statement opener with the situations that call for the checklist, then the items grouped under Database, Account and organization, Auth, and Threat review. Each group opens with a lead-in that says what its checks protect. - **Inbound links:** two Studio linter entries for OTP settings, the Studio Auth providers form, and `auth/auth-email-passwordless` now point to `production-checklist#auth`. The password length lint points to the password security guide instead, since the checklist has no password item. They used to land on `going-into-prod#security`, which is a pointer now. - **Claim fixes:** - The replication item told readers to enable replication on sensitive tables. It now says to enable RLS on replicated tables that hold sensitive data. - The Auth items named **Authentication > Providers**. The Dashboard label is **Sign In / Providers**. - **Terminal path:** the Auth group links the Management API endpoint for its settings. The Database items link to guides that carry CLI or SQL paths. - **Review fixes:** a note that RLS doesn't filter Postgres Changes `DELETE` events, a SQL path for publications, and the other email links the OTP expiry controls. - **Agent prompt:** after the opener, a copyable `AiPrompt` that has an agent audit the project read-only and report each item as pass, fail, or can't check. It reads Security Advisor and the tables through the Supabase MCP server, and SSL, network restrictions, Auth settings, and org members through Management API GET endpoints. `includeInMarkdown` is on, so the `.md` carries the prompt as a fenced text block. - **Cross-links:** Testing auth flows points to the checklist's Auth group, and the Security overview and Product configuration pages link the checklist. The custom SMTP item links the SMTP guide. ### Not verified - **Deferred samples:** none. The page has no code samples. - **Agent prompt:** its endpoints and fields match `api_v1_openapi.json`, and `Owner` matches Studio's role name. No agent has run it against a hosted project. - **Studio:** the link changes are strings only. Studio tests and build run on this PR because it touches `apps/studio`. ## Manual testing 1. Open [Production security checklist](https://docs-git-docs-production-security-checklist-supabase.vercel.app/docs/guides/security/production-checklist). See the agent prompt below the opener and four groups of checks. Click **Copy** and see the prompt text. 2. Open [Production checklist](https://docs-git-docs-production-security-checklist-supabase.vercel.app/docs/guides/deployment/going-into-prod#security). See the Security heading with a one-sentence pointer to the new page. 3. In the Security sidebar under Guides, click **Production security checklist**. See the new page open. |
||
|
|
7867f22522 |
feat(studio): link log users and show Auth activity timelines (#50837)
Add a User tab that resolves the signed-in user from the selected log or a related request step. It shows the shared Auth profile, offers filtering from the User ID row, and explains anonymous, external, or deleted users. When unified logs are enabled, the Auth user's Logs tab shows the user's 10 most recent logs in `EmbeddedLogsTable`, with the Logs page's columns and row styling. A row opens that log on the Logs page, filtered to the user, and View more in Logs opens the rest. Other configurations retain the existing Logs view. Shared user presentation is isolated in #50841; this PR contains the log/Auth integration and resolves missing-user queries to null. The list uses the #50953 helpers instead of its own: `createUnifiedLogsSearch` builds the query search, `buildUnifiedLogsUrl` builds the links (it now takes a `logId` to open a log), and the query asks for only the 10 rows it shows via `pageSize`. At the panel's default width the table is wider than the panel, so Event message needs a horizontal scroll; the empty state renders outside the table so it stays in view. Issue: [DEBUG-222](https://linear.app/supabase/issue/DEBUG-222/build-correlated-log-and-user-connections-in-studio) ### How to test 1. With the Unified Logs preview and `otelUnifiedLogs` enabled, open a signed-in user's log and select User. Check the profile, copy the User ID, and use Add filter to filter logs to that user. 2. Use Open in Authentication, then open the user's Logs tab. Select a row and confirm it opens the matching log; check that View more in Logs preserves the user filter. 3. Open an anonymous request and confirm the explanatory state. For correlated, external, and deleted-user cases, run the fixtures: `pnpm --filter studio exec vitest run components/interfaces/UnifiedLogs/components/LogUser.platform.test.tsx`. 4. In the log's User tab, focus User ID and press Enter, Arrow Down, Enter. Confirm it copies the ID without changing the selected log. Arrow Down should navigate logs again after the menu closes. ### Validation - Latest head: `8e4a9993b0db52ec5e611e55233b5ed77f67e358`, based on `master`, with conflicts resolved and independent review complete. - Local baseline and shuffled verification passed 324 tests across 26 files with retries disabled (shuffle seed `5083710`). An independent affected-suite run passed 29 tests with retries disabled and shuffle seed `5083730`. - Live QA found and reproduced a keyboard collision: field-menu Arrow Down also selected the next log. The shared menu now keeps keyboard events inside the menu. The regression fails when the guard is removed and passes after restoration. - On the verified latest-head preview, keyboard User ID copy, mouse copy, Add filter, Escape, navigation after closing the menu, and adjacent Auth email copying passed. No browser console errors were observed; browser network telemetry was unavailable. - Full signed-in activity, matching log/profile, Authentication navigation, View more filtering, anonymous state and deleted-user handling passed on `311206f9ef`. The subsequent change only affects menu keyboard propagation, which was revalidated on the latest head. - The disposable staging user was deleted and absence verified. Temporary key files were removed and the clipboard cleared. - Current CI: all E2E suites, unit tests, formatting, lint, Docker and deployments passed; typecheck is still running. Local full typecheck exhausted Node's heap, so no local full pass is claimed. ### Stack All prerequisite log-decoupling and request-correlation PRs, including #50841, are merged into `master`. This is the final code PR in the stack. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Jordi Enric <jordi.err@gmail.com> |
||
|
|
bd62dec2e2 |
refactor(studio): share Auth user cards and detail fields (#50841)
Extract shared Auth user cards and copyable detail fields, and use the shared raw-JSON display in the user panel. The existing Logs view remains available; unified activity timelines and log-user filtering arrive separately in #50837. This includes display-name/initials coverage and the Auth panel's component and browser tests. The browser test now verifies keyboard copying and Escape panel dismissal separately: the existing Auth Escape shortcut closes the details panel, so expecting it to restore focus to a field was incorrect. Its Raw JSON check reads the copied JSON's fields, since the code view's text includes line numbers. `UserCard` is Studio's first `Avatar`, so `vite.config.ts` pins `avatar.tsx` to its own chunk, like `field`, `drawer` and `slider`. Otherwise Rolldown pools it into the Auth `users` page chunk that the `ui` barrel then imports back, a chunk cycle that fails the TanStack build. ### How to test 1. Open an existing user in Authentication → Users. Check the profile card, overview fields, and name/avatar fallbacks for a user without profile metadata. 2. Open a copyable field using both mouse and keyboard (Enter), choose Copy, and check the clipboard value. 3. Open Raw JSON, scroll, and use the floating copy button. Confirm the existing Logs tab still opens and Escape closes the user panel. ### Validation - Final head `f4f8cb22e97fefac56c68b4676184d8358d8080e` targets master without conflicts. - Focused local tests: 13 passed across three files, retries disabled, including independent shuffled seed 5084131. Real panel/MSW tests cover field copying and complete nested JSON; fallback and Unicode regressions detect the original broken behavior. - Browser QA passed on `6b49434339`: nameless profile fallback, overview fields, mouse/keyboard copying, Raw JSON scrolling/copying, existing Logs tab, and Escape dismissal. Later commits change only the E2E test; application code is identical. - All GitHub checks passed on the final head, including four unit-test shards, four Next/TanStack E2E shards, typecheck, formatting, lint ratchet, knip, and Studio Docker build. - Independent review found no remaining issues; all review threads are resolved. - Fresh final-head studio-staging preview is blocked during dependency installation: the registry returns HTTP 451 for `react-hook-form@7.72.1`. The earlier matching application preview passed browser QA; this deployment failure remains visible. ### Stack Based on the logs table building blocks stack, which merges first: #50953 → #50954 → #50955 → #50957 → #50958 → #52281. Then merge in order: 1. #50835 — grouped log overviews and raw JSON 2. #50840 — request correlation queries 3. #50836 — request timeline UI and folding 4. #50841 — shared Auth user details 5. #50837 — log user correlation and Auth activity --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Jordi Enric <jordi.err@gmail.com> |
||
|
|
254e24b170 |
feat(studio): require grants in fetch wrappers for FGA-annotated endpoints (#52238)
## Problem Resolves FE-4689 and FE-4690. Builds on #52105. Studio's fetch wrappers don't know which FGA permissions an endpoint requires, so a UI guard and the request it protects can drift apart. This makes the `grant` minted by `useGrant`/`getGrant`/`ensureGrant` part of the request itself: calling an annotated endpoint without a matching grant is a compile error. ## Solution ### What changed - **Fetch wrappers** (`data/fetchers.ts`, `data/guarded-fetch.ts`): `get`/`post`/`put`/`patch`/`del` keep their names, so no imports change. - The `grant` option is required for endpoints annotated with `x-fga-permissions`, and forbidden for unannotated ones. - It accepts a `Grant` for that exact endpoint (or one of its variants) or `unguarded`. - The wrapper strips the grant before calling openapi-fetch. - `head`/`trace`/`options` are unchanged. - **Owned params**: refinements can declare query params the wrapper sets from the grant's variant (`ownedQuery`). These params are removed from the init type (`Omit<Query, Owned> & { [K in Owned]?: never }`), so callers can't pass them. Nothing uses this yet: the api-keys `reveal` variant is the first. - **`assertGrant`** runs in development only and throws `GrantAssertionError`. It checks: - the endpoint; - a missing grant; - the variant against `when(init)` predicates; - the path `ref` against the grant's project, also accepting the parent project ref for a grant minted on a branch; - the path `slug` against the grant's organization. - **Escape hatches**: - `unguarded.migrating` for unmigrated call sites. - `unguarded.byDesign('reason')` for calls that intentionally skip the check. - **Grants** now record `permissionsProjectRef`, the ref permissions were evaluated against. It's required once the scope is resolved. - **Readable errors**: a missing or wrong grant reports the caller's own init type plus the expected `grant` type, instead of openapi-fetch's full options type. Under `noErrorTruncation`, the old message was tens of KB per call site. - **`executeSql`** now requires a grant for `POST /platform/pg-meta/{ref}/query`, so every caller counts as unmigrated. - **Codemod**: added `grant: unguarded.migrating` at every existing call site that hits an annotated endpoint, including all `executeSql` callers. No behavior change. A follow-up lint rule ratchets the count down. - **Dependencies**: adds `openapi-typescript-helpers` (the version openapi-fetch already uses) for the helper types. Only openapi-fetch's unexported `InitParam` is copied locally. ### Type-level notes - The grant is checked in the parameter type rather than in `Init`'s constraint. That way `Init` is still inferred from the argument, which keeps both the return type and the error message tied to the caller's code. - The grant is replaced rather than intersected. Intersecting a wrong grant with the expected one can reduce the init type to `never`, which then accepts the call. - `NoInfer<Path>` stops a grant's endpoint from becoming an inference candidate for the path. ## Review instructions ### Tests - `data/guarded-fetch.test.ts`: - Type equality with the raw client: required params and body, template-literal paths, `parseAs`, `signal`/`headers`, optional-init endpoints, and `unguarded`. An openapi-fetch upgrade that breaks the local `InitParam` copy fails typecheck. - Negative type cases: - a missing or `undefined` grant; - a missing init on an annotated endpoint; - a grant for a different path or method; - any grant or `unguarded` on an unannotated endpoint; - a forged grant; - params and body still checked; - an unknown path. - `guardMethod` and `assertGrant` runtime behavior, including branch-parent refs and org slugs. - Variant and owned-param tests are deferred to the api-keys (`reveal`) and pg-meta (`read`/`write`) PRs, since no refinements exist yet. 1. Run `pnpm typecheck` and confirm Studio passes. Then remove a `grant: unguarded.migrating` and check that the error is short and names the expected grant. 2. Run `pnpm test:studio`. 3. Skim the codemod commit: it only adds `grant: unguarded.migrating` and the `unguarded` import. ## Checklist Check all before review: - [ ] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
60b51d74d5 |
Audit existing unit tests + Remove redundant ones (#52215)
## Context
_TLDR: Changes here speeds up unit tests on CI from ~14 minutes to ~3
minutes_ 😂
_TLDR 2: The file changes are solely only test files +
`studio-unit-tests.yml`_
We've currently got a lot of unit tests in the repository which while
great for coverage, hasn't been ideally written. There's a lot of
redundancy + overly specific tests that break easily, and our current
unit test takes about 15 minutes to run in the GHA per PR. Hence am
doing a audit clean up of all existing unit tests in the studio repo.
## Changes involved
- `.test.ts` files now run in `node`, `.test.tsx` in `jsdom`
- jsdom costs about 1s of setup per file. A `.ts` test that needs the
DOM opts in with `// @vitest-environment jsdom` (46 files do).
- Removed redundant and over-specific tests
- Duplicates are merged into `test.each`. Tests that only covered
libraries, existed for coverage, or asserted class names and snapshots
are deleted. 19 files are merged into a sibling or deleted.
- Fixed about 15 tests that couldn't fail
- Examples: unawaited assertions, fixtures equal to the default, and a
`semverGte` test calling `semverLte`.
- Sped up the slowest files
- Real sleeps are replaced with fake timers, `user.type` with paste, and
Radix option queries are scoped to the open listbox. For example,
`RestoringState` went from 18s to 0.3s and
`useTableEditorFiltersSort.navigation` from 20s to 3s.
- These ^ already shave down the unit tests time from 14 mins to 9 mins,
but am also sharding unit tests across 4 jobs to increase speed up
further which then shaves down time to 3 mins now
|
||
|
|
70fe3de074 |
docs: move social login URLs to social sign-in (#52111)
## Problem [supabase/supabase#52102](https://github.com/supabase/supabase/pull/52102) and [supabase/supabase#52109](https://github.com/supabase/supabase/pull/52109) rename *social login* to *social sign-in* in visible text, so every sign-in method follows the same pattern. The URLs still say `social-login`, and the Expo quickstart's says `social-auth`. Keeping feature names consistent includes the URLs: readers see them in the address bar, in search results, and in links shared between docs, the Dashboard, and the marketing site. Part of [DOCS-1459](https://linear.app/supabase/issue/DOCS-1459). ## Solution | Old URL | New URL | | --- | --- | | `/docs/guides/auth/social-login` | `/docs/guides/auth/social-sign-in` | | `/docs/guides/auth/social-login/*` (18 provider pages) | `/docs/guides/auth/social-sign-in/*` | | `/docs/guides/auth/quickstarts/with-expo-react-native-social-auth` | `/docs/guides/auth/quickstarts/with-expo-react-native-social-sign-in` | | `/features/social-login` | `/features/social-sign-in` | - **Redirects:** `apps/www/lib/redirects.js` has a permanent redirect for each old URL. One `:path*` entry covers the provider pages. Existing redirects that pointed at the old URLs point straight at the new ones, so no URL redirects twice. - **Links:** docs content, navigation, provider data, and SDK specs, Studio's Auth provider settings (29 "Learn more" links), the marketing site, the UI library docs, and the knowledge base use the new paths. - **Code name:** the docs navigation list `SocialLoginItems` is `SocialSignInItems`. Intentionally unchanged: - **Blog posts:** their links keep the old URLs and use the redirects. - **Sitemaps:** the `refresh-sitemaps.yml` workflow regenerates them. - **Image file names:** for example, `social-login.png` and `supabase-expo-social-auth-login.png`. Readers don't see them. - **UI library blocks:** the blocks are named `social-auth`, and the name is part of their install commands, so renaming them is a decision for the UI library's owners. ## Related PRs The rename spans three PRs, so the feature has one name on every surface: - [supabase/supabase#52102](https://github.com/supabase/supabase/pull/52102) (merged): the docs. - [supabase/supabase#52109](https://github.com/supabase/supabase/pull/52109) (merged): the marketing site, the Dashboard command menu, the UI library docs, the knowledge base, and the Docker configuration comments. - **This PR:** the URLs, including the Expo quickstart's, move to `social-sign-in` with redirects. ## Verification - Docs typecheck and the guides Markdown build pass. - `redirects.js` loads with 841 entries and no conflicting sources. - No `social-login` path remains outside blog posts, snapshots, generated files, the redirect sources, and image file names. To check the redirects, use the marketing site's preview, because `www` applies the docs redirects and the docs preview doesn't. If that preview serves production docs, the redirected page shows as missing until the new paths deploy. The redirect itself is what to check: - [/docs/guides/auth/social-login](https://zone-www-dot-com-git-alexisa-docs-1459-urls-supabase.vercel.app/docs/guides/auth/social-login) - [/docs/guides/auth/social-login/auth-google](https://zone-www-dot-com-git-alexisa-docs-1459-urls-supabase.vercel.app/docs/guides/auth/social-login/auth-google) - [/docs/guides/auth/quickstarts/with-expo-react-native-social-auth](https://zone-www-dot-com-git-alexisa-docs-1459-urls-supabase.vercel.app/docs/guides/auth/quickstarts/with-expo-react-native-social-auth) - [/features/social-login](https://zone-www-dot-com-git-alexisa-docs-1459-urls-supabase.vercel.app/features/social-login) ## Preview links - [Social sign-in](https://docs-git-alexisa-docs-1459-urls-supabase.vercel.app/docs/guides/auth/social-sign-in) - [Sign in with Google](https://docs-git-alexisa-docs-1459-urls-supabase.vercel.app/docs/guides/auth/social-sign-in/auth-google) - [Expo quickstart](https://docs-git-alexisa-docs-1459-urls-supabase.vercel.app/docs/guides/auth/quickstarts/with-expo-react-native-social-sign-in) - [Social sign-in feature page](https://zone-www-dot-com-git-alexisa-docs-1459-urls-supabase.vercel.app/features/social-sign-in) |
||
|
|
9be9e570c3 |
feat(studio): adopt shared inline code defaults (#51981)
## Problem Studio relies on repeated classes to style inline code. Bare `<code>` elements can miss those styles. ## Solution Import the shared styles from #51980 and remove the repeated classes. Keep Markdown renderer behaviour and existing size overrides. Use `data-code-style="plain"` for webhook headers, CLI and upgrade commands, configuration comparisons and connected-resource labels that have their own layout. ## Review instructions Dashboard review: this PR changes Studio only. 1. Open [Database > Extensions](https://studio-staging-git-dnywh-depr-707-code-studio-supabase.vercel.app/dashboard/project/_/database/extensions). Search for `pg_trgm` or another disabled extension and turn on its toggle to open the Enable dialog. Check the Extension and Schema values and the help text under “Install in a different schema”. The SQL block should keep its highlighting and copy control. Close without installing. 2. Open [Edge Functions > Secrets](https://studio-staging-git-dnywh-depr-707-code-studio-supabase.vercel.app/dashboard/project/_/functions/secrets). Scroll to “Default secrets” and check `SUPABASE_URL` and `SUPABASE_DB_URL`: both should use the bordered inline-code style. Hover a name to see “Click to copy”, then click it and confirm the name is copied. No custom secret or deployed function is needed. 3. Compare light and dark themes at narrow and desktop widths. | Before | After | | --- | --- | | <img width="812" height="1066" alt="CleanShot 2026-10-19 at 15 35 10@2x" src="https://github.com/user-attachments/assets/e4a21310-1fac-4143-9ee6-d2452ab4f314" /> | <img width="812" height="1068" alt="CleanShot 2026-10-20 at 15 39 20@2x" src="https://github.com/user-attachments/assets/d2c91ef6-7836-4c71-8f15-d0c0df8e969d" /> | |
||
|
|
fffb1e23ca |
feat: implement profile permissions v2 api (#50966)
## Problem Migrating Studio's permission checks from the old RLS json logic to openfga backed permissions. ### New hooks and helpers - `usePermissionsQueryV2` fetches the new profile openfga permisisons - `useAsyncCheckPermissionsV2` the replacement for the old check hook; takes an FGA permission string (or a list) - `FGA_PERMISSIONS` permission constants derived from `@supabase/shared-types`. At the moment, the hook also accepts plain strings for permissions not yet published in the package - `useAsyncCheckUserContentPermissions` new hook for permission checks on user content (SQL snippets, reports, log snippets). This wraps ``useAsyncCheckPermissionsV2` and adds existing content level rules on top of the fga permission check ### Notes - ~~Need api to support new permissions: project_operations_write, billing_read/write, audit_logs_read~~ [DONE] - ~~Still need to support: organization_config_read/write, auth hooks and users permissions~~ [DONE] --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com> |
||
|
|
0ca1774997 |
Fix not showing phone based users in auth page for legacy search (#51942)
## Context Resolves https://github.com/supabase/supabase/issues/51761 For projects that aren't using the improved search in the Auth → Users page, the UI shows "No users in your project" when no user has an email (phone-only, anonymous, etc.), even though users exist. With the default "Email address" filter and an empty search box, the legacy query runs `where lower(email) >= ''`. That evaluates to NULL for users without an email, so they're excluded and the page looks empty. ## Changes involved - Only apply the column-based search when there are keywords. With an empty search box, the legacy path falls back to the plain listing query (no email/phone condition). So users will be correctly displayed - Same gating for improved search. Its SQL already ignored the column without keywords, but `column` is part of the query key, so changing the filter dropdown with an empty search box refetched an identical query. ## To test - Project with only phone/anonymous users (e.g. create one via `POST /auth/v1/admin/users` with `phone` + `phone_confirm`), improved search off (ref below's curl snippet) - Open Auth → Users with the default "Email address" filter → users are listed - Type a keyword → still prefix-searches the selected column - Improved search on: switching filter column with an empty search box makes no additional request ``` curl -X POST 'https://[ref].supabase.red/auth/v1/admin/users' \ -H 'apikey: <SECREY_KEY>' \ -H 'Authorization: Bearer <SECREY_KEY>' \ -H 'Content-Type: application/json' \ --data-raw '{"phone":"+15551234572","password":"asdasd","phone_confirm":true}' ``` |
||
|
|
97bd456842 |
fix: consolidate SMTP minimum interval into Rate Limits page (#51784)
## What Moves the "Minimum interval per user" (SMTP_MAX_FREQUENCY) setting from the Custom SMTP page to the Rate Limits page. The field is always visible there now, disabled with a tooltip when Custom SMTP isn't configured, linking to the SMTP settings page. ## Why This setting can cause `over_email_send_rate_limit` errors even when all settings on the Rate Limits page allow more traffic, because it lived only on the SMTP page. Consolidating it onto Rate Limits makes the actual rate-limiting behavior visible in one place. Fixes FE-4627 ## Testing - Verified field is disabled with explanatory tooltip when Custom SMTP is off - Verified field becomes editable and saves correctly once Custom SMTP is configured - Confirmed field no longer appears on the SMTP settings page - Ran typecheck, lint, and SmtpForm unit tests locally |
||
|
|
4c7014745c |
feat(studio): add custom OIDC option to third-party auth providers (#51612)
<!-- claude-slack-attribution --> _Requested by **Stojan Dimitrovski** · [Slack thread](https://supabase.slack.com/archives/C022071RB2L/p1791475016175969?thread_ts=1791475016.175969&cid=C022071RB2L)_ ## Problem The Management API accepts any OIDC issuer for third-party auth (`POST /v1/projects/{ref}/config/auth/third-party-auth` with `oidc_issuer_url`), but the Dashboard only offers Firebase, Clerk, WorkOS, Auth0 and Amazon Cognito. Users with another OIDC provider have no way to register it from the Dashboard. Studio also hides any issuer it does not recognize: `IntegrationCard` returns `null` for the `custom` type, so an issuer added through the API never shows up in the list and cannot be deleted from the Dashboard. ## Solution - Add a "Custom OIDC" item to the Add provider menu on the Third-Party Auth page. - New `CreateCustomOidcDialog` with a single required Issuer URL field. It reuses `useCreateThirdPartyAuthIntegrationMutation`, so query invalidation and the error toast behave like the other providers. The URL is sent as typed after trimming whitespace. - New `isValidOidcIssuerUrl` helper in `ThirdPartyAuthForm.utils.ts`: the value must be an `https://` URL with a host, no query string, no fragment, and no embedded credentials. - The dialog copy is kept short: a one-line description and a single helper line noting that signing keys are found at the issuer's `/.well-known/openid-configuration`. - `IntegrationCard` now renders custom issuers (badge-check icon, "Custom OIDC" label, Issuer URL, Delete integration) instead of hiding them. Delete uses the existing flow and permission check. - The `custom` label changes from "Custom" to "Custom OIDC". - New docs page `apps/docs/content/guides/auth/third-party/custom-oidc.mdx` (served at `/docs/guides/auth/third-party/custom-oidc`). It covers the Dashboard flow, the Management API alternative, the `role` claim, client setup, and RLS. It is linked from the third-party auth overview and added to the docs sidebar. This supersedes the draft docs PR #51611. Not included: UI for `jwks_url` and `custom_jwks`. The page and menu keep the same feature gate (`authentication:third_party_auth`) and the same permission checks as the other providers. Before: the Add provider menu lists five providers. An issuer that is not one of them is registered only through the API and does not appear in the Dashboard. After: the menu has a sixth item, Custom OIDC. It opens a dialog that takes an issuer URL, rejects non-HTTPS values with an inline message, and registers the issuer. The new provider appears in the list and can be deleted from there. ## Review instructions 1. Open a project's Authentication > Third-Party Auth page and open Add provider. Check for the new Custom OIDC item. 2. Enter `http://example.com` and submit. The field shows an inline error and no request is sent. 3. Enter a valid HTTPS issuer URL that serves an OIDC discovery document and submit. A success toast appears and the provider shows in the list as Custom OIDC with its Issuer URL. 4. Enter an issuer the API rejects. The API error shows in the existing error toast and the dialog stays open. 5. Delete the provider with Delete integration and confirm it disappears from the list. 6. Read the new docs page and check that its Dashboard steps match the UI. Local checks: - `vitest --run components/interfaces/Auth/ThirdPartyAuthForm`: 20 tests pass (validation helper unit tests plus dialog component tests with MSW). - `tsc --noEmit` in `apps/studio`: no new errors. - ESLint on the directory: no warnings in the new or changed code. - Prettier is clean on the changed files, including the docs page. The typos check is clean on the docs page and overview. I did not run the dialog in a browser against a real project, so there are no screenshots. The docs app was not built or rendered locally. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) 🤖 Generated with [Claude Code](https://claude.ai/code/session_011HY2zckzPLcvXd28JPSqBe) https://claude.ai/code/session_011HY2zckzPLcvXd28JPSqBe --- _Generated by [Claude Code](https://claude.ai/code/session_011HY2zckzPLcvXd28JPSqBe)_ --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
09a1f431bc |
Mass update for all lucide icon imports to use the component with Icon suffix (#51659)
## Context This is largely just a mechanical change here: Opting to use lucide icons with the `Icon` suffix across all icon imports within `studio` - so that it’s clearer which components are icons + reduces the possibility of name collision with our own components - e.g <User /> vs <UserIcon /> Also added a eslint rule for this: <img width="1069" height="167" alt="image" src="https://github.com/user-attachments/assets/7f36f443-5ca2-4bf6-8d22-86e774513bfc" /> And updated `AGENTS.md` as such: ``` Icons come from `lucide-react`, always imported with the `Icon` suffix (`import { CheckIcon, Trash2Icon } from 'lucide-react'`) — never the bare names (`Check`) or `Check as CheckIcon` aliases (lint-enforced). ``` |
||
|
|
f1082e28c7 |
chore: migrate Framer Motion imports to Motion (#51520)
## Problem Closes #31221. The applications and shared UI packages still import the former `framer-motion` package instead of Motion's React entry point. ## Solution Replace runtime imports, type imports, and three test mocks with `motion/react` across the consuming workspaces. Replace the seven direct dependency declarations with `motion: ^11.18.2`. Preserve the existing animation engine version and all other dependency resolutions, including the asynchronous `domMax` feature loader. Historical blog examples remain as published; `framer-motion` remains a transitive implementation dependency of Motion. ## Review instructions 1. Run `pnpm install --frozen-lockfile` and check the seven dependency replacements in the lockfile. 2. Open the WWW Auth page and Docs homepage at desktop and mobile widths, with normal and reduced motion preferences. 3. Open the mobile navigation, expand Product on WWW, and close the menu using Escape and the close button. 4. Check the existing animation components, shared form validation, and Studio tests for unchanged behavior. Validation: - Studio: 731 test files, 8,334 passing tests and one expected failure, with `--maxWorkers=4`. - Shared UI, UI patterns, WWW, and UI library: 615 passing tests. - `pnpm run typecheck --concurrency=1`: all 16 repository tasks pass. - All six application source lint scripts and lint ratchets pass; generated Docs example copies are excluded from local lint. - Repository Prettier source check, lockfile formatting, and case hazard check pass. - WWW: 10 existing end-to-end checks across nine pages. - Docs: 5 existing guide link and accessibility checks across Database and Auth. - WWW and Docs mobile navigation pass at desktop/mobile sizes with normal/reduced motion; SQL-to-REST translation tabs exercise the asynchronous feature loader without browser errors. - Frozen-lockfile installation passes; all existing package and snapshot resolutions are unchanged. - Learn and UI library command palettes open, filter results, and close with Escape without browser errors. - Independent code review finds no actionable defects. - `npm run build -- --filter=www --filter=docs --filter=studio --filter=learn --filter=library --concurrency=1 --continue=always`: all five affected applications build successfully (9 tasks including prerequisites); asset uploads disabled for local validation. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) (no docs topics changed) --------- Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com> |
||
|
|
eeae6027d5 | fix: don't warn about SMS MFA charges on branch projects (#51459) | ||
|
|
692b14d47b |
fix(ui): opaque sticky table column hover (#47668)
## Problem
On tables with a sticky last column (Database Extensions, OAuth Apps,
Custom Auth Providers), hovering a row lets scrolled cell content show
through the sticky column.
Root cause: row hover uses `bg-surface-200`, which maps to `--muted`
(alpha). That works for normal cells (nothing behind them) but sticky
cells sit above horizontally scrolled content, so the tint is
see-through.
## Solution
In `ShadowScrollArea` when `stickyLastColumn` is set:
- Keep an opaque `bg-surface-100` base on sticky cells
- Composite the muted hover tint via `background-image` so hover matches
`TableRow` without becoming transparent
Also:
- Extensions: use `Table containerProps={{ stickyLastColumn: true }}`
instead of nesting a second `ShadowScrollArea` (same pattern as OAuth /
Custom Auth)
- OAuth Apps and Custom Auth Providers: drop redundant per-cell
`bg-surface-100` / `hover:bg-surface-200` so sticky hover comes only
from `ShadowScrollArea`
| Before | After |
| --- | --- |
| <img width="1042" height="98" alt="27097"
src="https://github.com/user-attachments/assets/204a7dc4-d5ac-40b7-87fb-fdb03982eaad"
/> | <img width="1084" height="101" alt="94456"
src="https://github.com/user-attachments/assets/c6db3607-6bbe-4488-a0a5-81f5a0436d66"
/> |
## Review instructions
1. Open Database Extensions. Narrow the viewport or scroll the table
horizontally so the Enabled column is sticky.
2. Hover a row while Links or description content sits under the Enabled
column. The sticky cell should stay opaque and match the row hover tint
(light and dark).
3. Optionally repeat on Auth → OAuth Apps and Auth → Custom Providers
(actions column).
Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>
|
||
|
|
4205c4103d |
fix(studio): make detail panel close buttons clickable (#51455)
The close button on the Auth users detail panel (and the queue message panel) is absolutely positioned, but `TabsList` is `position: relative` and comes later in tree order — so it painted on top of the button and swallowed every click. The button looked fine and did nothing. Stacks the button above the tab list, adds an accessible name to the users panel button, and covers it with an E2E test (Playwright does real hit-testing, so it fails without the fix). Fixes FE-4519 |
||
|
|
a4910196b8 |
fix(studio): use Badge for auth provider enabled state (#51310)
## Problem
Auth Providers uses a bespoke Enabled/Disabled chip that mixes brand
tokens with primary colour. Custom Auth Providers already uses the
standard `Badge` for the same meaning.
## Solution
Replace the bespoke chip with the existing `Badge`:
```tsx
<Badge variant={isActive ? 'success' : 'default'}>
{isActive ? 'Enabled' : 'Disabled'}
</Badge>
```
No new status primitive in this PR. Built-in providers now match Custom
Providers.
| Before | After |
| --- | --- |
| <img width="958" height="1568" alt="CleanShot 2026-10-06 at 17 19
40@2x"
src="https://github.com/user-attachments/assets/08850f4e-528a-4e47-958f-207e72783b16"
/> | <img width="934" height="1482" alt="CleanShot 2026-10-07 at 11 46
41@2x"
src="https://github.com/user-attachments/assets/232903f7-86bd-4c5c-ae1d-d873cddcf67b"
/> |
## Review instructions
1. Open Auth → Providers (built-in list). Confirm each provider shows a
small `Enabled` / `Disabled` Badge, with no brand/primary token mash-up
or oversized pill.
2. Optional: open Auth → Providers → Custom and compare the Enabled
column; it should feel like the same Badge treatment.
## Checklist
- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
|
||
|
|
e143c94e5f |
fix(studio): clarify SMTP password field UX when a password is already saved (#50794)
## What The custom SMTP password field showed a "Reveal" and "Copy" button next to text saying "this password cannot be viewed once saved" — contradictory, since those buttons implied there was something to reveal or copy. In reality the backend never returns the saved password, so the field was always blank and those buttons acted on an empty string. ## Why Reported in FE-3765: users found it confusing whether saving other fields would blank out their password, and the Reveal/Copy buttons appeared broken. ## Fix - Removed the non-functional Reveal/Copy buttons from the password input. - When a password is already saved, the field now shows a `••••••••••••••••` placeholder and copy reading "Stored password is hidden. Enter a new password to replace it." — matching the existing `STORED_SECRET_PLACEHOLDER` pattern already used in the Replication destination forms (BigQuery, ClickHouse, Snowflake, etc). - No behavior change: leaving the field blank on save still preserves the existing password (unchanged logic). ## Testing - Manually verified in the running app. - Added a component test (`SmtpForm.test.tsx`) covering both the "password already saved" and "fresh setup" states. - `tsc --noEmit`, `eslint`, and `prettier --check` all pass with no new errors/warnings. Fixes [FE-3765](https://linear.app/supabase/issue/FE-3765/custom-smtp-password-field-ux-issues) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Updates** * Configured SMTP passwords are masked, with a notice that entering a new password will replace the stored one. * For new SMTP setups, the password field prompts for the SMTP server password and does not show the stored-password notice. * The SMTP password field no longer provides controls to reveal or copy the password. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
01321d9222 | feat(studio): migrate auth log links to OTEL (#50718) | ||
|
|
ec53175b8a |
refactor(ui): rename text-brand to text-primary (#50564)
## What kind of change does this PR introduce? Refactor. Follow-up to #49871. ## What is the current behavior? Branded (green) text still uses the `text-brand` classname while the colour comes from `--primary`. ## What is the new behavior? **Rename-only:** `text-brand` → `text-primary` across callsites and docs. Leftover `bg-brand` / `border-brand` alias to `brand-default`. No intentional colour changes in this PR. This better matches how we treat our green in other components and props, like `variant="primary"` for green buttons. ## To test On light mode: smoke-test that branded text still looks like #49871 (readable green, not the bright fill). - [Homepage](https://zone-www-dot-com-git-dnywh-depr-316-text-brand-de2380-supabase.vercel.app/): “Scale to millions” uses `text-primary` - [Docs homepage](https://docs-git-dnywh-depr-316-text-brand-to-primary-supabase.vercel.app/docs): branded links like “More on self-hosting” are still readable - [Typography docs](https://design-system-git-dnywh-depr-316-text-brand-to-primary-supabase.vercel.app/design-system/docs/typography): documents `text-primary` - [Colour usage](https://design-system-git-dnywh-depr-316-text-brand-to-primary-supabase.vercel.app/design-system/docs/color-usage): `text-primary` is visibly darker than `bg-brand-default` _on light mode_ - [Studio auth providers](https://studio-staging-git-dnywh-depr-316-text-brand-to-60fa6c-supabase.vercel.app/dashboard/project/_/auth/providers): enabled provider badge text readable; status dot stays bright green <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Style** * Updated branded text, link hover states, icons, badges, indicators, and highlighted content across the Design System, Docs, Studio, Learn, UI Library, and marketing experiences to use the primary theme color. * Updated syntax highlighting and table-of-contents styling for consistent primary-color presentation. * Refined brand color fallback behavior for bright fills and borders. * **Documentation** * Updated color-usage and typography guidance to recommend the primary text utility. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
a31ca2bad0 |
fix(ui): make brand text readable across themes (#49871)
## What kind of change does this PR introduce? Bug fix and design-system update. Resolves DEPR-316. Follow-up rename (`text-brand` → `text-primary`) is in a dedicated PR (https://github.com/supabase/supabase/pull/50564) stacked on this one. ## What is the current behavior? `text-brand` resolves to the canonical bright brand green in places that need readable text, which fails WCAG AA on light surfaces. A separate `text-brand-display` token adds another green for large type. ## What is the new behavior? - `text-brand` maps to accessible `--primary` (light mode darkened to meet ~4.5:1 AA) - `--hue` / `--primary-hue` aligned to 157.5 - `text-brand-display` removed; former display callsites use `text-brand` - Bright fills/borders stay on `brand-default` - Design-system colour and typography docs updated | Before | After | | --- | --- | | <img width="514" height="112" alt="CleanShot 2026-09-02 at 11 13 09@2x" src="https://github.com/user-attachments/assets/4e0138a9-a32d-4e4c-a426-90736706e1e7" /> | <img width="512" height="138" alt="CleanShot 2026-09-21 at 11 42 05@2x" src="https://github.com/user-attachments/assets/164cc5b1-a0c5-4e93-95f1-80016641a114" /> | | <img width="864" height="266" alt="CleanShot 2026-09-02 at 11 13 53@2x" src="https://github.com/user-attachments/assets/3c1ca53f-bf9e-431e-bc15-816b4a275b8e" /> | <img width="882" height="248" alt="CleanShot 2026-09-21 at 11 41 37@2x" src="https://github.com/user-attachments/assets/24828e7b-ed6b-44cb-b9dc-becc3398bdfc" /> | | <img width="782" height="692" alt="CleanShot 2026-09-02 at 11 16 30@2x" src="https://github.com/user-attachments/assets/fc871977-77bc-47fb-9e0e-9284e0ecd5cc" /> | <img width="730" height="690" alt="CleanShot 2026-09-21 at 11 42 52@2x" src="https://github.com/user-attachments/assets/bf479515-d5f9-471e-b82d-f097c0f4b56c" /> | | <img width="480" height="306" alt="CleanShot 2026-09-02 at 11 18 53@2x" src="https://github.com/user-attachments/assets/03f341f4-f02e-44f8-a2b2-8c31670d0427" /> | <img width="470" height="300" alt="CleanShot 2026-09-21 at 11 43 19@2x" src="https://github.com/user-attachments/assets/9df18217-d5e6-48b8-ba0b-579d2664b94b" /> | | <img width="960" height="300" alt="CleanShot 2026-09-02 at 11 32 04@2x" src="https://github.com/user-attachments/assets/6b1d9373-7a71-4247-81ff-26441604b09d" /> | <img width="980" height="306" alt="CleanShot 2026-09-21 at 11 44 13@2x" src="https://github.com/user-attachments/assets/41ad4784-02ec-4b29-b860-32af9fa79aa8" /> | | <img width="924" height="214" alt="CleanShot 2026-09-02 at 11 34 44@2x" src="https://github.com/user-attachments/assets/1de661fe-c7b6-499b-a94f-e4737436ec79" /> | <img width="752" height="162" alt="CleanShot 2026-09-21 at 11 44 56@2x" src="https://github.com/user-attachments/assets/1811890f-0660-4445-84e9-447720954fa1" /> | ## To test Test each callsite **in light mode** (dark mode is largely unchanged). ### WWW - [Homepage](https://zone-www-dot-com-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/): “Scale to millions” uses readable brand text (display token is gone) - [Careers](https://zone-www-dot-com-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/careers): small “Careers” eyebrow readable; green dividers stay bright `brand-default` - [Contact](https://zone-www-dot-com-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/contact-us): email / policy links use readable brand text - [Regions](https://zone-www-dot-com-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/regions): “Ask about early access to BYOC” readable ### Docs - [Docs homepage](https://docs-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/docs): “DOCS” wordmark and resource links readable - [Database overview](https://docs-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/docs/guides/database/overview): nav / footer brand links readable - [JavaScript reference](https://docs-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/docs/reference/javascript/introduction): active sidebar treatment readable ### Design system - [Typography](https://design-system-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/docs/typography): documents `text-brand` only (no display) - [Colour usage](https://design-system-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/docs/color-usage): `text-brand` vs `bg-brand-default` - [Design-system homepage](https://design-system-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/): brand text examples across themes ### Studio - [Auth providers](https://studio-staging-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/dashboard/project/_/auth/providers): enabled provider badge text readable; status dot stays bright - [Database policies](https://studio-staging-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/dashboard/project/_/database/policies?new=true): template hover text more legible - [Database connections](https://studio-staging-git-dnywh-depr-316-brand-text-tokens-supabase.vercel.app/dashboard/project/_/observability/connections): “Live” status readable; animated dot stays bright green --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> |
||
|
|
5104754018 |
Fix types master (#50345)
## Context Just needed to adjust the API types import - the name likely changed somewhere `AnalyticsResponse` -> `AnalyticsResponse_Output` Verified the typecheck locally <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Updated analytics test typing to align with the current analytics response schema. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
d2ed60da27 |
fix(auth): migrate overview errors to clickhouse (#50174)
## Problem
Auth overview error tables call the legacy logs endpoint through
fetchLogs defaults, even with the ClickHouse migration enabled.
Success-rate cards also show zero when there are no requests and
misleading relative changes between small rates.
## Fix
Select matching BigQuery or ClickHouse queries with otelLegacyLogs,
separate caches by engine, and normalize numeric results.
Show No data for success rates without requests and omit comparisons
when either period has no requests. Show success-rate changes in
percentage points: 0% to 0.2% displays +0.2 pp. Omit undefined relative
changes from a zero baseline for activity and sign-up counts. Show
explicit errors for failed log requests, including error payloads
returned with HTTP 200, instead of empty tables.
## Validation
- Auth overview error tables compared against staging with matching
data.
- 84 focused tests passed across four suites, including 25 direct
formatter tests.
- 12 MSW integration tests exercise both endpoint/SQL pairs, HTTP and
embedded API failures, and rendered No data, genuine 0%, and +0.2 pp
states.
- Unit tests cover missing periods, zero requests, percentage-point and
relative changes, SQL structure, and numeric result parsing.
- Formatting and diff checks passed; code review found no actionable
issues.
- Full local lint/typecheck are limited by shared checkout dependencies.
Browser comparison confirmed the deployed rate display uses percentage
points and shows No data without a comparison for absent server
requests; populated error rows match staging. The final formatter
extraction (
|
||
|
|
476d4a5851 |
refactor(ui): drop redundant Button variant="default" props (#50161)
## What kind of change does this PR introduce? Mechanical cleanup on top of the Button default-variant change (#50160). ## What is the current behavior? Many callsites still pass `variant="default"` even though that is now the component default. ## What is the new behavior? Removes redundant static `variant="default"` from legacy `Button` and `ButtonTooltip` callsites. Keeps explicit defaults where they document the API: - `button-default.tsx` and `button-sizes.tsx` demos - `DocsButton`, which pins neutral styling at the wrapper boundary ## To test Studio: - [Auth → Rate Limits](https://studio-staging-2s957kwc4-supabase.vercel.app/dashboard/project/_/auth/rate-limits): dirty the form so Cancel appears; Cancel stays neutral, Save stays green - [Project Settings → API Keys](https://studio-staging-2s957kwc4-supabase.vercel.app/dashboard/project/_/settings/api-keys): `DocsButton` in the header actions stays neutral Design system: - [Design system → Button](https://design-system-git-dnywh-dc924ac1-supabase.vercel.app/design-system/docs/components/button): `button-default` / `button-sizes` still show explicit default styling; Primary (green) is restricted to the Primary section (and `asChild`) WWW: - [www → Brand assets](https://zone-www-dot-com-git-dnywh-dc924ac1-supabase.vercel.app/brand-assets): Download logo kit / Download button kit stay neutral |
||
|
|
1966209483 |
chore(deps): upgrade vitest to v5 (#49994)
Upgrades Vitest from 4.1.4 to 5.0.0 across the monorepo, fixes the handful of things v5 turned into hard errors, and drops the `vi.clearAllMocks()` boilerplate that v5's `clearMocks` default makes redundant. **Changed:** - `vitest`, `@vitest/ui`, `@vitest/coverage-v8` 4.1.4 → 5.0.0 (catalog) - `vi.mock` calls that lived inside `beforeAll`/`beforeEach`/test bodies moved to module scope (v5 throws on nested calls). Affects the Studio and docs setup files and four Studio tests. - `detectBrowser` test restores `navigator` via `vi.unstubAllGlobals()` instead of assigning `global.navigator`, which now reaches jsdom's getter-only property. - `RowEditor.utils.test.ts` restores its `JSON.stringify` spy. It used to leak a throwing mock for the rest of the file, which v5's coverage provider now trips over. A later test in the same file had been asserting the leak's side effect (valid JSON reported as invalid) and now asserts the correct behavior. - `@testing-library/jest-dom` 6.6 → 7.0.1. Its vitest type augmentation resolves through a peer now, so it lands on each package's own `vitest` instead of whichever copy pnpm hoisted. Fixes `toBeInTheDocument` type errors in dev-tools after the reshuffle. - `@testing-library/react` 16.0.0 → 16.3.3 for the React 19 peer range. - `vite: catalog:` added to dev-tools, www, and common. Without it they resolved a newer vite than the catalog pin, which forked a second vitest instance in the lockfile. There's now one. - ai-commands custom matcher types use v5's `Matchers<R, T>` form. - 110 test files: `vi.clearAllMocks()` removed from `beforeEach`/`afterEach` hooks, along with hooks that only did that and the imports they left unused. Calls that also reset/restore mocks are untouched. Second commit, mechanical. **Added:** - `.vitest/` to the root gitignore (v5 writes JSON/JUnit/HTML reporter output there) **Removed:** - `vite-tsconfig-paths` catalog entry and deps. Vitest 5 resolves tsconfig paths itself. Release-age note: this sat in draft with a temporary `minimumReleaseAgeExclude` entry for `vitest` and `@vitest/*` while 5.0.0 was inside the workspace's 3-day `minimumReleaseAge` window. That window has closed, so the exclusion is gone and nothing bypasses the release-age gate. **Perf** (local, medians of 3 runs, same machine): | Suite | v4.1.4 | v5.0.0 | |---|---|---| | studio | 144.1s | 141.7s (-2%) | | studio `--coverage` | 156.9s | 146.4s (-7%) | | ui-patterns | 6.27s | 5.07s (-19%) | | ui `--coverage` | 3.35s | 2.14s (-36%) | | www | 0.89s | 0.47s (-47%) | Studio is dominated by jsdom environment setup per file, which v5 doesn't change. `vitest doctor` recommends keeping the current pool config: the vm pools and `isolate: false` all break tests. ## To test - `pnpm install --frozen-lockfile` succeeds with no `minimumReleaseAgeExclude` entry for vitest. - CI: Studio unit tests, ui, ui-patterns, www, docs, and typecheck/lint should all be green. The lint ratchet was checked locally: warning counts on touched Studio files are identical to master. - `pnpm test:studio` locally passes with coverage (588 files, 6240 tests). - Open a Studio test that uses `toBeInTheDocument` in your editor and confirm no type errors on jest-dom matchers, in Studio and in `packages/dev-tools`. - Known pre-existing failures unrelated to this PR: one dev-tools test (`getEventCountBadge` capped pill) fails on master too. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Tests - Improved test coverage for JSON validation and mobile navigation behavior. - Updated test setup, cleanup, environment configuration, and matcher support across application and shared package suites. - Removed obsolete coverage for alternate MCP transport selection. ## Chores - Streamlined TypeScript path resolution and Vitest reporter output handling. - Updated testing libraries and Vitest tooling across documentation, Studio, website, and shared packages. - Added Vitest reporter output to ignored files. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com> |
||
|
|
1131e3e2ce |
fix(ui): default Button variant to default instead of primary (#50160)
## What kind of change does this PR introduce? Bug fix / design-system alignment for the legacy `Button` from `ui`. ## What is the current behavior? Omitting `variant` on the legacy `Button` falls back to brand-green `primary`. That makes accidental greens easy, and it is hard to spot the real main action on busy pages. ## What is the new behavior? - Legacy `Button` now defaults to neutral `default` - Intentional primary CTAs (create, save, submit, marketing CTAs, and matching `ButtonTooltip` usages) now set `variant="primary"` so their appearance is unchanged - Neutral actions that previously relied on the old fallback (cancel, close, back, dashboard nav, and similar) become grey/white - Design-system docs updated; regression tests cover the new default `Button_Shadcn_` is unchanged. It already uses its own CVA default. This is PR 1 of 2 in a stack. PR 2 drops now-redundant `variant="default"` props. ## To test Studio (http://localhost:8082): - `/sign-in`: Sign in stays green - Open a project → Database → Tables: New table stays green - Auth → Users → Invite: Invite user stays green; Cancel / dismiss controls stay neutral - Project Settings → General: edit a field so Cancel and Save appear. Cancel is neutral, Save is green Design system (http://localhost:3003): - Components → Button: default demo is neutral; primary demo is green; featured preview is the default variant Marketing (optional): - www header: Start your project stays green; logged-in Dashboard is neutral <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Style** - Buttons now default to a neutral style, while primary actions across Studio, documentation, marketing pages, forms, dialogs, and error states use prominent primary styling. - Updated button examples and previews clarify the distinction between default and primary variants. - Event registration now includes a directional arrow icon. - **Tests** - Added coverage confirming default button styling and explicit primary styling behave as expected. - Updated related test fixtures to use primary styling where appropriate. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |