mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
docs/reference-template
328
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
1550b09037 |
chore(studio): object versioning additions (#54432)
- Improve warning when public bucket and versions are being enabled on storage bucket enabling public bucket: <img width="712" height="553" alt="Screenshot 2026-12-01 at 18 56 50" src="https://github.com/user-attachments/assets/327f9e77-11dd-41b6-83b5-c3941aaf3d39" /> warning with non-public bucket: <img width="651" height="456" alt="Screenshot 2026-12-01 at 18 56 42" src="https://github.com/user-attachments/assets/0078abd7-7246-43c0-afca-2352329369ae" /> - Add "Get url" action for an object version <img width="470" height="311" alt="Screenshot 2026-12-01 at 18 54 42" src="https://github.com/user-attachments/assets/b3b2f92d-f341-4bda-93b8-473e59bf8ae6" /> - Add copy button to versionId <img width="437" height="275" alt="Screenshot 2026-12-01 at 18 53 33" src="https://github.com/user-attachments/assets/50a068a1-616b-42a2-bd23-7270bbef649e" /> - Add gh discussion link for feedback |
||
|
|
52614926a3 |
feat(studio): promote Launch Week 16 in the Banner Stack (#54512)
## Problem Launch Week 16 is promoted on www but needs the same promotion in hosted Studio. ## Solution Add a low-priority card to the existing bottom-right Banner Stack across project, organisation, and account pages. It uses the shared dot artwork from #54511, links to the Launch Week site, saves dismissal, and expires after December 11 in San Francisco. Signed-out and self-hosted Studio do not show it. | After | | --- | | <img width="995" height="584" alt="1211" src="https://github.com/user-attachments/assets/ff1a60a3-6a4e-4b32-a3df-7fdfe74f4afb" /> | | <img width="995" height="584" alt="68318" src="https://github.com/user-attachments/assets/3a41c56a-fe59-4800-ae14-82ec42c6f260" /> | ## Review instructions 1. Open a hosted project, organisation, or account page on the Studio preview. If another notice is in front, expand the Banner Stack to find **Launch Week 16**. 2. Check the artwork, copy, and **Claim your ticket** button in light and dark mode. The button opens the Launch Week site in a new tab and dismisses the card. 3. Close the card and reload. It should stay dismissed. |
||
|
|
be27ad8cf5 |
feat(studio): show apps and confirm token access changes (#53917)
> [!WARNING] > This PR relies on #53705 being merged first. ## Problem Project admins need to see authorised apps before changing token access. [DEPR-734](https://linear.app/supabase/issue/DEPR-734) ## Solution - Show Apps below Members only when authorised apps exist; hide the section while loading or empty, and retain verification errors. - Show access levels and links to each app’s access sheet. - Include members and authorised apps in toggle confirmations; wait for complete counts and offer retry on errors. | After | | --- | | <img width="725" height="560" alt="CleanShot 2026-12-02 at 14 44 13" src="https://github.com/user-attachments/assets/6f033b2f-a8b4-4a64-824f-ef0cc270ff6c" /> | | No authorised apps (no empty state) | | <img width="728" height="773" alt="CleanShot 2026-12-02 at 14 11 31" src="https://github.com/user-attachments/assets/76b31461-abca-4f9a-b76d-bb664093dd67" /> | | Loading error | | <img width="727" height="749" alt="CleanShot 2026-12-02 at 14 38 34" src="https://github.com/user-attachments/assets/0722002c-a5cf-4877-b00b-15f9e4a6524c" /> | | 1× authorised app | | <img width="418" height="222" alt="CleanShot 2026-12-02 at 14 39 27" src="https://github.com/user-attachments/assets/db5cc89a-2099-4a6f-969c-b4e2c38ac972" /> | | Disabling token access whilst 1× app is relying on it | | <img width="424" height="387" alt="CleanShot 2026-12-02 at 14 39 58" src="https://github.com/user-attachments/assets/e15c1227-8190-42f4-876b-5f55a321848b" /> | | Re-enabling token access which will immediately restore access for N members and apps | ## Review instructions 1. Open the [staging preview](https://studio-staging-git-dnywh-depr-734-temporary-acc-b81819-supabase.vercel.app/dashboard), select a project you administer, and open **Database → Settings**. Enable database token access in **Feature previews**, plus `jitDbAccess` and `enableScopedOAuthManage` in the dev toolbar’s **Flags** tab if needed. 2. Open DevTools → **Console**, paste the setup below and run it. Navigate to another Studio page (possibly outside of Database) and back to **Database → Settings**, without reloading. Check **Test Partner App** appears under Apps with **Read and write** access. 3. Turn token access off. Check the confirmation includes the app, then choose **Cancel**. 4. Run `tokenAccessReview.state = 'disabled'` in Console, then navigate away and back. Turn token access on, expand **Who will regain access?**, check the app is listed, then choose **Cancel**. 5. Run `tokenAccessReview.state = 'enabled'; tokenAccessReview.fail = true`, then navigate away and back. Check the Apps error disables the toggle. Run `tokenAccessReview.fail = false` and choose **Retry apps** to recover. 6. Run `tokenAccessReview.apps = false`, then navigate outside Database and back. Check Apps is hidden once loaded. Reload to remove the setup. The setup mocks GET responses only, requires no app authorisation, and does not change saved access. Use **Cancel** in both confirmations. Do not reload between steps; reloading removes the setup. Network’s Response tab does not show these browser-generated responses. <details> <summary>Console setup</summary> ```js (() => { if (window.tokenAccessReview) throw new Error('Review setup is already active. Reload to reset it.') const projectRef = location.pathname.match(/\/project\/([^/]+)/)?.[1] if (!projectRef) throw new Error('Open a project’s Database Settings first.') const appId = '75e64165-b74e-432f-bb70-80d6ae432f06' const grantId = 'review-org-grant' const scopes = ['database_token_access:write'] const originalFetch = window.fetch const review = window.tokenAccessReview = { state: 'enabled', apps: true, fail: false } const approvals = /\/platform\/organizations\/[^/]+\/oauth\/approvals$/ const grants = new RegExp(`/platform/organizations/[^/]+/oauth/approvals/${appId}/grants$`) const page = (data) => Response.json({ data, links: { next: null, prev: null } }) window.fetch = function (input, init) { const url = new URL(input instanceof Request ? input.url : input, location.href) const method = init?.method ?? (input instanceof Request ? input.method : 'GET') if (method.toUpperCase() === 'GET') { if (url.pathname.endsWith(`/v1/projects/${projectRef}/jit-access`)) { return Promise.resolve(Response.json({ state: review.state, appliedSuccessfully: true })) } if (approvals.test(url.pathname)) { return Promise.resolve(page(review.apps ? [{ id: appId, type: 'oauth_app', attributes: { app: { name: 'Test Partner App', icon: null, created_by: null }, last_approved_at: '', target: 'organization', org_grant: { grant_id: grantId, approved_scopes: scopes, approved_at: '' }, }, }] : [])) } if (grants.test(url.pathname)) { if (review.fail) return Promise.resolve(Response.json({ message: 'Review: apps unavailable' }, { status: 500 })) return Promise.resolve(page([{ id: grantId, type: 'oauth_grant', attributes: { kind: 'organization_bound', user: null, approved_at: '', approved_scopes: scopes, projects: [{ ref: projectRef, name: 'Review project' }], }, }])) } } return originalFetch.call(this, input, init) } })() ``` </details> --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> |
||
|
|
0c97b9789b |
[FE-3107] chore(studio): remove remaining Next.js references (#54426)
Removes the remaining Next.js dependencies, compatibility shims, test
mocks, ESLint/TypeScript presets, and webpack/Next workarounds from
Studio following the TanStack Start migration.
Addresses FE-3107.
**Removed:**
- `next` and `next-router-mock` from `apps/studio/package.json` (and
updated `pnpm-lock.yaml`)
- Orphaned `apps/studio/compat/next/script.tsx` shim, `script.test.tsx`,
`compat/**` knip entry, and `nextCompat()` / `ssr.noExternal` `/^next/`
plumbing from `apps/studio/vite.config.ts`
- `apps/studio/tests/lib/route-mock.ts` and all `next-router-mock`
setup/imports across `tests/vitestSetup.ts`,
`tests/lib/custom-render.tsx`, and 12 test files
- `apps/studio/tests/pages/` directory (moved the 3 remaining tests to
`components/interfaces/Organization/Organization.utils.test.ts` and
`apps/studio/tests/routes/`)
- Unused `'use client'` directives across 23 Studio files
- Next.js/webpack workarounds: `graphiqlViteWorkers()` in
`vite.config.ts`, webpack `import.meta.glob` `try/catch` fallback in
`ConnectStepsSection.tsx`, shell `NODE_ENV=test` override in
`vite.config.ts` / root `package.json` / `studio-e2e-test.yml`, Next
`getPathMatch` and `_next` passthrough in `redirects.shared.*`,
`window.next?.router` check in `monaco-graphiql-coexistence.spec.ts`,
and unused `ANALYZE` env var in `apps/studio/turbo.jsonc`
- Next-only Sentry/chunk-load filters (`NEXT_NOT_FOUND`,
`NEXT_REDIRECT`, Next `/org/[slug]/` regex, `/app:\/\//`, dead
`includeThirdPartyErrorFilter` plumbing, webpack chunk error regex) and
stale Next/Pages Router comments, docs, and `#__next` CSS selector
**Changed:**
- `apps/studio/eslint.config.cjs`: switched from
`eslint-config-supabase/next` to the new `eslint-config-supabase/react`
preset (dropping `@next/next/no-img-element: off`, keeping `.next` /
`next-env.d.ts` ignored for local checkouts with stale pre-migration
build artifacts)
- `apps/studio/tsconfig.json`: extends `tsconfig/base.json` directly
instead of `tsconfig/nextjs.json` (identical resolved compiler options)
- `apps/studio/.github/eslint-rule-baselines.json`: pruned 33 stale
`pages/...` and `types/next.ts` entries without changing any rule
thresholds
- `apps/studio/tests/lib/custom-render.tsx`: backed
`TestFrameworkProvider` with TanStack Router instead of
`next-router-mock`
-
`apps/studio/components/interfaces/Integrations/GraphQL/GraphiQLTab.tsx`:
imports `graphiql/setup-workers/vite` directly
- `apps/studio/styles/globals.css`: replaced `@source
'../pages/**/*.{js,ts,jsx,tsx}'` with `@source
'../routes/**/*.{js,ts,jsx,tsx}'`
- `apps/studio/turbo.jsonc`: declared `"NEXT_PUBLIC_*"` in
`tasks.build.env` now that Turborepo infers `nitro` instead of `nextjs`
-
`apps/studio/components/interfaces/Organization/Organization.utils.ts`:
narrowed `buildOrgUrl`'s `slug` parameter to `string[] | undefined`
**Added:**
- `packages/eslint-config-supabase/shared.js` and
`packages/eslint-config-supabase/react.js` (plus `presets.test.ts`),
decoupling non-Next React apps from `eslint-config-next` with verified
zero non-`@next/*` rule drift while keeping
`eslint-config-supabase/next` unchanged for the Next.js apps
## To test
- Run `pnpm --filter eslint-config-supabase run test` and confirm preset
parity tests pass
- Run `pnpm --filter studio run lint`, `pnpm --filter studio run
lint:ratchet`, `pnpm --filter studio run typecheck`, `pnpm knip
--workspace apps/studio`, and `pnpm --filter studio run test`
- Run `pnpm --filter studio run build` and verify the production build,
prerendered routes, chunk-cycle check, and GraphiQL web workers succeed
- Smoke-test Studio locally (`pnpm dev:studio`): verify GraphiQL loads
cleanly, ConnectSheet framework steps render, and Tailwind styles on
route pages are intact
---------
Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
|
||
|
|
30a1b38da0 |
feat(studio): rename temporary access to database token access (#54282)
## Problem The database access preview still uses “Temporary access” across its settings and member rules. ## Solution Use “Database token access” for the feature and “Member access” for member rules. Update the preview, settings, dialogs, feedback, member status messages and docs together. Move the guide to `/guides/platform/token-access`, permanently redirect the old URL, and preserve existing section anchors. ## Review instructions 1. Open [the Studio preview](https://studio-staging-git-dnywh-database-token-access-naming-supabase.vercel.app), then Feature previews and find **Database token access**. Enable the preview for a supported project, then open [Database Settings](https://studio-staging-git-dnywh-database-token-access-naming-supabase.vercel.app/project/_/database/settings). 2. Check the **Database token access** heading, **Allow token access** switch and **Member access** table. Open **Add rule** and an existing rule to check the sheet titles. Open a rule’s delete confirmation and cancel it. 3. With an assigned role, check the access status above the member table. As a member without management permission, check the access notice uses the same feature name. 4. Open the [database token access guide in the docs preview](https://docs-git-dnywh-database-token-access-naming-supabase.vercel.app/docs/guides/platform/token-access). Check the guide and navigation use the new name, the dashboard instructions match Studio, and the existing section links from the member guide still work. Open `/docs/guides/platform/temporary-access` and its `.md` variant to check they permanently redirect to the new URLs. | Before | After | | --- | --- | | <img width="726" height="367" alt="CleanShot 2026-11-30 at 16 06 00" src="https://github.com/user-attachments/assets/be351f0c-d578-4289-8785-5c4e69a254a7" /> | <img width="729" height="374" alt="CleanShot 2026-11-30 at 16 05 38" src="https://github.com/user-attachments/assets/f02b470d-ef1a-4b6c-bdbb-20fe10b847c6" /> | |
||
|
|
07101b6894 |
[FE-3200] chore(studio): lift bundler workarounds and stabilize hooks (#54121)
Cleans up obsolete Rolldown/Vite bundler workarounds from the TanStack Start migration and fixes unstable router selectors and inline default array props that could cause unnecessary re-renders or render loops. Addresses [FE-3200](https://linear.app/supabase/issue/FE-3200/lift-bundler-workarounds-and-fix-latent-issues-next-was-masking). **Removed:** - Emptied `KNOWN_CHUNK_CYCLES` in `apps/studio/vite.config.ts` while keeping the `assertNoChunkCycles` build guard enabled - Removed obsolete `manualChunks` workarounds (`class-variance-authority`, `ui-field`, `ui-drawer`, `ui-form`, `ui-sidebar`, `ui-slider`, `ui-avatar`), keeping the React and `lucide-react` vendor chunks so React stays a single leaf chunk and Lucide does not fan out into per-icon modulepreload requests - Removed the obsolete `sharedDefines` (`global: 'globalThis'`) substitution from `apps/studio/vite.config.ts` **Changed:** - `StudioLink` (`StudioFrameworkProvider.tsx`): split `useRouterState` into primitive `currentPathname` and `currentSearch` selectors instead of returning a fresh object on every router state tick - `useNuqsTanStackRouterAdapter` (`nuqs-tanstack-adapter.tsx`): select a serialized query string key from `useLocation` so `useQueryState` consumers do not re-render when unwatched search params change - `FilterPopover`: replaced inline `[]` defaults for `options` and `activeOptions` with shared `EMPTY_ARR` (`@/lib/void`), and guarded `setSelectedOptions` with an element-wise equality check when closed - `InputWithSuggestions`: replaced inline `[]` default for `suggestions` with shared `EMPTY_ARR` (`@/lib/void`) so `useEffect` does not loop when `suggestions` is omitted at runtime **Added:** - Regression tests covering router selector stability and default-prop render loops in `StudioFrameworkProvider.test.tsx`, `nuqs-tanstack-adapter.test.tsx`, `FilterPopover.test.tsx`, and `InputWithSuggestions.test.tsx` ## To test - Run `pnpm --filter studio run build` and verify the build passes with `KNOWN_CHUNK_CYCLES` empty and `assertNoChunkCycles` enabled - Run the new/updated unit tests in `apps/studio` (`StudioFrameworkProvider.test.tsx`, `nuqs-tanstack-adapter.test.tsx`, `FilterPopover.test.tsx`, `InputWithSuggestions.test.tsx`) - Smoke-test Studio navigation, URL search-param filters (`nuqs`), Table Editor column suggestions, `FilterPopover` interactions, and `/auth/hooks` (confirming no `global` ReferenceError) --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
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> |
||
|
|
a098c3be32 |
chore(studio): improve versioning onboarding comms (#54059)
## Problem We're going to release versioning in Public Alpha instead of Private, so we need to be more clear and loud about the new feature being introduced. ## Solution This PR makes a few changes mostly around communications and messaging: - Update `Private Alpha` badges to `Public Alpha` - Add admonitions in the feature preview modal - Prompt confirmation before enabling versioning on a bucket - Dedicated announcement banner in Storage layout - shown only to users with `storage.capabilities.object_versioning` enabled - Popover card when hovering over the Public Alpha badge See [update](https://linear.app/supabase/project/storage-object-versioning-and-lifecycle-policies-b5e5809a718e/activity#project-update-e9a50e15) for more context. ## Review instructions Functionality changes are minor so mostly check the above mentioned messaging and ui changes. |
||
|
|
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. |
||
|
|
dbe2237ad3 |
fix(studio): let Back leave a deleted project FE-5235 (#54293)
## Problem If a project was deleted while its Observability page was open, Studio redirected to the project list. Pressing Back reopened the deleted project and triggered the redirect again. [FE-5235](https://linear.app/supabase/issue/FE-5235) ## Fix Replace the inaccessible project’s browser history entry when redirecting to the dashboard. Back can then reach the page visited before the project. ## How to test 1. Open an account page and then navigate to a project’s Observability page. 2. Simulate a 404 for the project details request and refocus the tab so Studio revalidates the project. 3. After Studio redirects to the project list, press Back once. The account page should open. ## QA On the signed-in Studio staging preview for `ab907b13c0`, I opened a nonexistent project’s Observability URL from a healthy project. Studio redirected to the organization’s project list. One browser Back press restored the healthy project, and Forward reopened the project list. |
||
|
|
d98f706b7c |
[FE-5109] (part 1) refactor(studio): migrate core hooks, lib, and prefetchers off next/router (#54053)
Part 1 of a 6-PR stack migrating all `next/router` and `next/compat/router` imports in `apps/studio` onto TanStack Router hooks and removing the router shims. | Part | PR | Scope | | --- | --- | --- | | **1** | **#54053 ← this PR** | **Core navigation helpers, `hooks/**`, `lib/**`, `data/prefetchers/**`** | | 2 | #54054 | `components/ui/**` | | 3 | #54055 | `components/layouts/**` and `state/tabs.tsx` | | 4 | #54056 | Database, Branching, Compute, Edge Functions, Explorer, SQL Editor, Storage, Table Editor | | 5 | #54057 | Remaining `components/interfaces/**` and `QueryInsightsTable` router events | | 6 | #54058 | Remove `next/router` & `next/compat/router` shims, `_router-events.ts`, Vite aliases, and test mocks | Introduces the shared TanStack navigation helpers needed across the stack and migrates `hooks/**`, `lib/**`, and `data/prefetchers/**` off `next/router`. **Added:** - `navigateToUrl` in `apps/studio/lib/navigation.ts` (plus unit tests in `lib/navigation.test.ts`): shared helper for navigating to internal string URLs via TanStack's `useNavigate` (splitting pathname, search params, and hash via `splitInternalUrl`, and handling external/protocol-relative URLs) - `useRoutePattern` in `apps/studio/hooks/misc/useRoutePattern.ts` (plus `useRoutePattern.test.tsx`): returns the active matched TanStack route template (e.g. `/project/$ref/editor/$id`) as the replacement for Next's `router.pathname` **Changed:** - Migrated `hooks/misc/*` (`useHydratedQuery`, `useStudioCommandMenuTelemetry`, `useTableEditorFiltersSort`, `withAuth`) and `hooks/use-check-latest-deploy.tsx` to TanStack's `useLocation`, `useNavigate`, `useRoutePattern`, and `useParams` from `common` - Migrated `lib/profile.tsx` and `lib/telemetry/track.ts` off `next/router` - Migrated `data/prefetchers/project.$ref.tsx`, `project.$ref.editor.tsx`, and `project.$ref.editor.$id.tsx` to `useRouter().preloadRoute` - Wrapped `ReactQueryTestConfig` in `apps/studio/tests/helpers.tsx` with `RouterContextProvider` and updated hook/navigation tests (`useTableEditorFiltersSort*.test.*`, `useFilterLifeCycle.navigation.test.tsx`, `useTableFilter.navigation.test.tsx`, `useInboundBranding.test.ts`, `state/tabs.test.ts`) **Simplified:** - `navigateToUrl` passes `replace` straight through and documents that `url` must be an app-relative path or an external URL. `StudioFrameworkProvider`'s `push` now reuses it. - `useRoutePattern` reads matches and location in a single `useRouterState` subscription - `useTrack` and `useStudioCommandMenuTelemetry` take the pathname from `useFramework()`, the same source as pageviews, so custom events and pageviews always send the same pattern (e.g. `/project/[ref]/sql/[id]`). New tests pin the strings sent, and `toRoutePattern` now has its own unit tests. - Removed `useCurrentPath` (a one-line wrapper with one consumer): `OrganizationSettingsLayout` calls `useLocation` directly - Dropped the no-op `.catch(() => {})` on `preloadRoute` in the prefetchers (`preloadRoute` never rejects) - `useTableEditorFiltersSort` builds the next search with a spread instead of a delete loop - Added `createTestRouter()` to `tests/lib/custom-render.tsx`, and `customRender`/`customRenderHook` now return the `router`. The rest of the stack uses these instead of hand-copied `createRouter` setups. Addresses [FE-5109](https://linear.app/supabase/issue/FE-5109/replace-the-nextrouter-shims-with-tanstack-router-hooks) ## To test - [ ] Auth redirect flow (`withAuth`) still preserves `returnTo` query parameters when redirecting unauthenticated users to `/sign-in` - [ ] Table Editor sort and filter URL sync (`useTableEditorFiltersSort`) persists and clears `?sort=` / `?filter=` across table switches - [ ] Hovering project and table editor links still triggers route/data prefetching without console errors - [ ] Page view and command menu telemetry still records route patterns and paths accurately --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
01d4d4d430 |
[FE-5113] refactor(studio): replace next/dynamic shim with React.lazy (#54022)
## Problem
Now that Studio runs on TanStack Start, `apps/studio` still routes 13
`next/dynamic` imports through a local compatibility shim
(`apps/studio/compat/next/dynamic.tsx` aliased in
`apps/studio/vite.config.ts`). Keeping the shim adds unnecessary
indirection during the Next.js teardown (FE-5113).
## Solution
Replaces every `next/dynamic` import in `apps/studio` with `React.lazy`
+ `Suspense` (or static imports where already inside a lazy chunk), then
deletes `compat/next/dynamic.tsx` and its Vite alias.
None of the previously `ssr: false` call sites need `ClientOnly`: Studio
runs TanStack Start with `spa: { enabled: true }` and only prerenders
the signed-out auth routes (`/sign-in`, `/sign-up`, `/sign-in-sso`,
`/forgot-password`), `__root.tsx` gates `<Outlet />` behind
`canRenderPage`, and `StudioCommandMenu` is already gated by
`useCommandMenuInitiated()` (which starts `false` per render).
**Removed:**
- `apps/studio/compat/next/dynamic.tsx` and the `'next/dynamic'` entry
in `nextShims` in `apps/studio/vite.config.ts`
**Changed:**
- Migrated all `next/dynamic` call sites to `React.lazy` + `Suspense`:
- `StudioCommandMenu`, `ContextSearchResults`,
`Marketplace/OverviewTab`, `QueryDetail` (`SqlMonacoBlock`),
`SQLEditorEditorPanel` (`MonacoEditor`, `DiffEditor`),
`SupportAssistantSuccessCard`, `LayoutSidebarProvider`,
`MessageMarkdown` (`Streamdown`), and
`SupportAssistantSuccessCardContent` (`Streamdown`)
- `ConnectStepsSection`: hoisted the lazy component cache out of
`useMemo` to module scope (also clears its
`react/no-unstable-nested-components` warning)
- `Integrations.constants.tsx` and `useAvailableIntegrations.tsx`:
hoisted all lazy integration tab/page definitions (including
`GraphiQLTab`) to module scope so `navigate()` returns stable component
references, added `Suspense` boundaries with `<Loading />` at both
render points (`MarketplaceDetail` and the integration child route), and
keyed integration tab/creation sheet instances (`integration.id` in
`MarketplaceDetail` and `wrapperMeta.name` in `WrappersTab`) so state
cannot leak when switching between wrappers or OAuth integrations;
preserves `umdAmdShortCircuit`, `ssrStubGraphiql`, and
`graphiqlViteWorkers` in `vite.config.ts`
- Replaced `dynamic()` calls for `AiIconAnimation`, `Badge`, and 4
`icons` in `CreateCommands.tsx` with static imports (already inside the
lazy `CommandMenu` chunk)
- Removed the stale `next/dynamic` mention from the
`lib/chunk-load-error.ts` doc comment (`React.lazy` chunk failures
continue bubbling to the root `ErrorBoundary` reload handler)
**Added:**
- Reference-stability tests for `INTEGRATIONS.navigate` in
`Integrations.constants.test.ts` (running in Vitest's Node environment)
## Review instructions
1. Open the SQL Editor and Query Performance query detail panel, and
confirm the Monaco editor and diff view load cleanly.
2. Open the GraphQL integration's GraphiQL tab, and confirm the loading
skeleton displays while the chunk loads and GraphiQL mounts with working
autocomplete/workers.
3. Open a Wrapper integration's Wrappers tab, open the create sheet,
then navigate via history to a different wrapper's create sheet and
confirm the form resets to the new wrapper's defaults.
4. Open the Command Menu (`Cmd+K`), navigate to context search (for
example, Search Database Tables) and Create commands, and confirm icons,
badges, and search results load without flicker.
5. Open the Connect sheet and switch between frameworks/steps,
confirming step content loads with the skeleton fallback.
6. Toggle sidebars (AI Assistant, Inline SQL Editor, Advisor, Help) and
verify markdown streaming in AI Assistant.
7. Confirm CI passes `pnpm --filter studio run build` (including
prerendering and chunk-cycle checks), typecheck, lint ratchet, and
Studio tests.
---------
Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
|
||
|
|
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> |
||
|
|
d6e4089b1a |
feat(common): add FrameworkProvider and remove next imports (#53905)
Introduces a lightweight `FrameworkProvider` React context in `packages/common` (`Link`, `Image`, `pathname`, `asPath`, `isReady`, `params`, `push`), wires it up in the consuming apps, and removes the `next` dependency from `packages/common`. **Added:** - `FrameworkProvider`, `useFramework`, `FrameworkLink`, and `FrameworkImage` in `packages/common/framework.tsx`, with plain HTML defaults (`DefaultFrameworkLink` / `DefaultFrameworkImage`). `useFramework().push` always exists and falls back to `window.location.assign` - App-level framework providers wiring `next/link`, `next/image`, and router state in `www` (App + Pages routers), `docs`, `design-system`, `learn`, and `ui-library`, and native TanStack Router bindings in `studio` (`StudioFrameworkProvider`) - `StudioFrameworkProvider` reuses the common defaults (its image only applies the basePath) and reports `isReady` once the first route load commits, so the first page view carries the final route after any redirect - Unit tests for `StudioFrameworkProvider` (`useParams`, `FrameworkLink`, `FrameworkImage`, query/hash-only navigation, `isReady`) and for `PageTelemetry` route-change sends and the `TelemetryTagManager` consent gate **Changed:** - `common/hooks/useParams.ts`: read params from `useFramework()` instead of `next/compat/router` - `common/telemetry.tsx`: replace `next/script` in `TelemetryTagManager` with `useEffect` script injection, and read route state from `useFramework()` in `PageTelemetry` - `common/MetaFavicons/app-router.ts`: drop type-only `Metadata` import from `next` - Moved `MetaFaviconsPagesRouter` to `apps/www/components/MetaFaviconsPagesRouter.tsx` (its sole consumer) - Studio: `toRoutePattern` and `applyBasePath` now live once in `lib/internal-url.ts`, shared by the provider and the `compat/next` shims - `PageTelemetry` throws outside production when no `FrameworkProvider` is mounted, since it would otherwise send only the landing pageview. `useFramework()` itself still falls back to the defaults - `ui-library`: renamed its code-sample framework context to `FrameworkPreferenceProvider` / `useFrameworkPreference` so `FrameworkProvider` only means the `common` one **Removed:** - `learn`'s unused copy of that context (`useCourse` had no callers) - `next` from `packages/common/package.json` peerDependencies App Router adapters set `asPath` to the pathname only, same as the `usePathname`-based telemetry on master (reading search params at the root would opt static pages out of static rendering). ## To test - Run `packages/common` tests and typecheck, and `apps/studio` `StudioFrameworkProvider` / `route-render` / `telemetry` tests - Navigate between routes in Studio, Docs, and WWW and confirm page telemetry fires once per navigation (and does not duplicate on hash-only changes) - Load Studio at `/` (which redirects) and confirm the first page event has the final route - Verify URL params (`useParams`) continue resolving route and search params in Studio --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
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> |
||
|
|
cf223ae74a |
[FE-3106] (part 13) – chore(studio): remove next entry files and config (#53222)
Removes the Next-only entry files and config now that every page lives in `routes/**` (FE-3106). `routes/__root.tsx` already mirrors `pages/_app.tsx` (dayjs plugins, providers, telemetry, error boundary, favicons). Part 13 of the stack. **Depends on:** #53221 **Changed:** - `components/interfaces/App/{NotFoundPage,ServerErrorPage}.tsx` – the 404/500 pages, rendered by `__root.tsx`, now with native `Link`/`useNavigate` and `<img>` - `routes/api/{status-page,scoped-access-token-permissions}.ts` – App Router handlers from `app/api/**` moved in (`NextResponse.json` → `Response.json`); `buildAPIPermissionScopeMap` moves to `lib/api/` - `package.json`, `tsconfig.json` – no `next typegen` step or `.next/types` include - `packages/ui-patterns/.../InstructionBlocks.tsx` – asset map typed `StaticImageData | string`: under Vite a png import is a URL string, which Next's global image types used to hide - `vite.config.ts`, `knip.jsonc`, `turbo.jsonc` and comments across studio – Next build references removed **Removed:** - `pages/{_app,_document,404,500}.tsx`, `pages/_error.jsx`, `pages/README.md`, `app/**`, `next.config.ts`, `proxy.ts`, `instrumentation{,-client}.ts`, `sentry.{server,edge}.config.ts`, `fonts/index.ts` (next/font), `BootTimeoutFallback`, `postcss.config.cjs`, the `next/server` shim - `@next/bundle-analyzer`, `raw-loader`, `postcss`, `@tailwindcss/postcss` dev dependencies Addresses [FE-3106](https://linear.app/supabase/issue/FE-3106/move-page-bodies-into-route-files-and-delete-pages). ## To test - Open an unknown URL – the 404 page renders with working "Head back" - `/api/status-page` and `/api/scoped-access-token-permissions` on platform – same JSON and `Cache-Control` - Fonts (Inter, Manrope, Source Code Pro) still load --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
f2af7ea280 |
chore(studio): remove the terms of service update notice (#53323)
I removed the "We've updated our Terms of Service" notice from the dashboard. It was added in #51302 and has been up since early October, and it had no expiry of its own. I also removed its landing-path helper, its tests and its dismissal key. ## To test Tested on the PR preview, in a browser profile that never dismissed the notice: - [x] Open an organization's landing page (`/org/<slug>`): expect no "We've updated our Terms of Service" card in the bottom right. Observed: no card on the organizations list or on an org's landing page, with the dismissal key unset on both. ## Linear - fixes GROWTH-1494 |
||
|
|
53ffdf75c9 |
Joshenlim/fe 4945 cmd k support searching for all table (#53262)
## Context Probably the final piece for this series of changes towards resource aware Cmd K. We currently only present results for tables when searching in Cmd K, this PR adds in other entity types like views, materialized views, foreign tables, and partitioned tables (only the parent) Note that the results excludes entities created from database extensions to reduce the chance of noise <img width="500" alt="image" src="https://github.com/user-attachments/assets/27bf5026-937a-4883-b365-75694d551a39" /> ## Related changes - Tweaked the entity icon for partitioned tables a little to be blue (previously gray) and - Added an entity icon for child partition tables in the table editor that's slightly lighter than the partition table icon, currently child partition tables just render with the same icon as tables which can be confusing <img width="286" height="128" alt="image" src="https://github.com/user-attachments/assets/638af7c3-512d-4264-bfae-0a8827b3ef94" /> - Note that i'm planning to look into this separately RE how to better render child partition tables so this might go away subsequently ## Performance As always, ran a claude benchmarking session - this runs on debounced keystrokes against a live catalog, so it's benchmarked at scale: **45,653 `pg_class` rows** - 12k tables - 3,143 views - 3,002 matviews - 3,001 foreign tables) Taking a median of 15 runs, all variants measured against the same catalog in one process. | scenario | query | master | this PR | worst | |---|---|---|---|---| | exact table name | `t_500` | 19.5ms | 24.3ms | 29.1ms | | view name | `v_10` | 19.3ms | 23.7ms | 25.8ms | | foreign table name | `ft_10` | 18.9ms | 24.1ms | 26.9ms | | no match | `zzz_nothing` | 19.4ms | 24.0ms | 27.5ms | | broad prefix (~3k matches) | `t_1` | 30.8ms | 38.7ms | 45.1ms | | broad matview prefix | `mv_1` | 26.6ms | 37.5ms | 41.7ms | |
||
|
|
5eb68c5df2 |
Add indexes to cmd k related resources in table editor (#53204)
## Context We previously added a "Related resources" section in Cmd+K if you're on the Table Editor with a table opened, this included resources pertaining to the table such as policies, triggers, and functions. We're adding indexes as well in this PR - thinking that might also be appropriate to have in this context <img width="500" alt="image" src="https://github.com/user-attachments/assets/5cd383ff-6617-49ba-bdb8-6f65d8fd0680" /> ## Performance Benchmarked with Claude against the stress catalog (`PG_META_STRESS_TABLES=12000`), with master and this branch timed in the same run on the same database, median of 9. | Table | master | This PR | Worst of 9 | |---|---|---|---| | Hub table — 8 indexes, policy, many FK triggers | 1.6 ms | 2.3 ms | 2.8 ms | | Policy + user trigger | 1.0 ms | 1.3 ms | 2.0 ms | | Mid-chain table | 1.1 ms | 1.5 ms | 1.7 ms | | Deliberately over-indexed table — 20 indexes | 0.8 ms | 2.0 ms | 4.6 ms | | Table that doesn't exist | 1.1 ms | 1.5 ms | 4.5 ms | |
||
|
|
44573b7a5c |
feat(studio): rename Advisors to Issues in navigation (#52993)
Part 5 of 6: #52989 → #52990 → #52991 → #52992 → #52993 → #53138 Switches Studio navigation between Advisors and Issues with `issuesInbox`. With the flag off, the existing Advisors sidebar, pages, command menu entries, shortcuts, header panel, and contextual finding links remain available. With it on, these entry points show Issues and legacy Advisor URLs forward to the matching Issues category while preserving finding context. Direct Issues routes remain accessible in either state. The homepage section remains hidden when the flag is off. Telemetry event names are unchanged. ## How to test 1. Turn `issuesInbox` off: desktop and mobile navigation show Advisors, the header opens Advisor Center, and Security, Performance, and enabled Health Advisor pages remain usable. 2. Turn it on: navigation and the header show Issues. Legacy Advisor category URLs forward to matching Issues lists. 3. `G` then `V` opens the active variant. `V` then `S`, `P`, or `H` follows the active category links; shortcut reference labels match. 4. Table Editor finding links open the legacy finding when off and its issue when on. 5. Direct Issues routes remain usable with the flag off; the homepage section stays hidden. ## Validation - Broad navigation/layout/redirect/shortcut regression suite: 456 tests passed, retries disabled. - Focused suite: 181 tests passed with shuffle seed 52993, retries disabled. - Full Studio TypeScript, scoped ESLint, and changed-file Prettier pass. - Behavioral mutation probes detect broken flag guards, finding links, and redirect destinations; source restored afterward. [DEBUG-255](https://linear.app/supabase/issue/DEBUG-255/replace-advisor-terminology-with-issues-throughout-studio) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Jordi Enric <jordi.err@gmail.com> |
||
|
|
f87de2f0d0 |
Joshenlim/fe 4593 cmd k related resources while in table editor (#53079)
## Context Building on towards resource-aware Cmd K, the changes done up so far have all been to allow users to search for database resources from anywhere in the project, with the intention to get you to the resource quickly without having to go through the navigation hierarchy of the dashboard. This PR explores a way to quickly glance related resources for a table in the Table Editor through Cmd K for that same intention, but listing out the policies, triggers or functions that run on the table that you're currently viewing in the Table Editor. E.g here we've got the `blog_authors` table opened: <img width="500" alt="image" src="https://github.com/user-attachments/assets/78c9b85f-cd30-4564-a264-c1a2a596d5c2" /> Policies and triggers are fairly straight forward since we can determine what's related by their target table. Functions are a bit more fuzzy as we're trying to find what's related by checking the function definition, if it does anything to the table. For e.g based on the screenshot above, `blog_handle_new_user` has this definition which was why it was flagged <img width="500" alt="image" src="https://github.com/user-attachments/assets/fb8f3be4-05df-4d87-8440-8b75d95546ae" /> We're also deliberately decoupling loading of policies + triggers and functions since searching functions takes slightly longer, so opting to load results of policies + triggers first, then lazy load functions subsequently once results are ready ## Performance As usual, ran a benchmarking session with Claude just to make sure that the added SQL doesn't cause any performance issues, these are aggregates of 4–5 runs. **Catalog size (stress catalog)** | Query | 2,000 tables | 10,000 tables | |---|---|---| | Policies and triggers, hub table (many FKs) | 0.1 ms | 0.5–1.3 ms | | Policies and triggers, ordinary table | ~0 ms | ~0 ms | | Functions, every body matches | 1.4 ms | 4–8 ms | | Functions, no match (full scan) | 1.8 ms | 7.3–7.7 ms | | Functions, table not visible | 0 ms | 0 ms | **Large function bodies** (random text, 2,000 tables plus 2,000 small functions, plus the large ones added) | Function source | Largest function | Functions: no match (full scan) | Functions: every body matches | |---|---|---|---| | 56 MB (600 functions) | 94 KB | ~50 ms | 2 ms | | 103 MB (+10 multi-MB) | 4.7 MB | ~92 ms | 2 ms | ## To test Use a project with a table that has at least one policy, one trigger, and a function that mentions the table in its body. - [ ] Open that table in the Table Editor and press Cmd+K. A **Related resources** section appears at the top with its policies, triggers, and functions. - [ ] Click a policy, a trigger, and a function. Each opens its editor on the right resource. - [ ] A trigger's function does not also appear under the functions rows. - [ ] Type part of one of those names. The section narrows to matching rows and the project-wide entity results appear below. A resource can appear in both. - [ ] Type something that matches nothing in the table. The section disappears rather than showing empty. - [ ] Clear the input. The full section comes back without a loading flicker, since the data is cached. - [ ] Open the table editor on a table with no policies, triggers, or referencing functions. Cmd+K shows no empty **Related resources** section. - [ ] Switch to a different table and press Cmd+K. The section shows that table's resources, not the previous table's. - [ ] Open Cmd+K from a non-Table Editor page, such as the SQL Editor. The section is not shown. - [ ] In the network tab, check that opening the menu sends one query for policies and triggers and one for functions. Typing sends no additional ones for this section. |
||
|
|
597d1ce56e |
fix(studio): pass caller options to grant-gated query factories (#53088)
## Context Grant-gated query factories returned `queryFn: skipToken` when the caller had no grant. TanStack Query keeps one options object per cache entry, overwritten by whichever observer rendered last. When that was a grant-less observer, invalidation refetched with `skipToken` and failed with `Missing queryFn`, breaking the query for every other observer on the key. #53075 patched two call sites; this fixes the factories. ## Changes - New `grantedQueryOptions` helper (`data/granted-query-options.ts`). Without a grant, the factory sets `queryFn: undefined` instead of `skipToken`, so TanStack borrows the query function from a subscribed observer that has one. The caller's `enabled` applies only when the factory has a query function. - `apiKeysQueryOptions`, `revealedApiKeysQueryOptions`, `branchesQueryOptions`, `branchQueryOptions` and `branchDiffQueryOptions` take caller options as a second argument. Call sites change from `useQuery({ ...f(vars), enabled })` to `useQuery(f(vars, { enabled }))`, so callers can't override the grant gate. - New type-aware `fga/no-spread-granted-query-options` lint rule (error). `grantedQueryOptions` returns a type-only brand, and the rule flags any spread or `Object.assign` of a branded value, however it was built or named. - Restores typed linting as a separate pass (`eslint.type-checks.config.cjs`, run by `pnpm lint` via `lint:type-checks`), as #44678 did. Enabling type info in the main config changes what other plugins report, so it stays separate. - `studio-queries` skill documents the pattern. Callers still pass their own grant, so the UI gates on the same grant the request carries. ## Testing - `data/api-keys/api-keys-query.test.tsx`: a granted and a grant-less component share the key, with the grant-less one rendering last; invalidation via the delete mutation refetches successfully. Fails on master with `Missing queryFn`. - `data/granted-query-options.test.ts`: `enabled` gating, factory fields win over caller fields, `select` type inference. - Lint rule cases in `scripts/__tests__/fga-eslint-rules.test.ts`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) |
||
|
|
06d43f6881 |
Joshenlim/fe 4721 cmd k support searching for triggers (#52755)
## Context Building off from [here](https://github.com/supabase/supabase/pull/52751) to make Cmd+K resource-aware so finding and inspecting anything in a project doesn't depend on knowing where it lives in the dashboard. Specifically looking into database entities for now - end state would be that you could search for a table name for example, and Cmd K will pull up everything related to that table for you to skim (e.g Policies, Functions, Triggers, etc). Changes in this PR sets up searching for **database triggers**, and will probably be the last database entity that we'll add into context aware cmd K for now given that we'll have tables, policies, functions and triggers which are the primary building blocks for a project. <img width="500" alt="image" src="https://github.com/user-attachments/assets/242ec517-88cd-4f3d-96ce-741edaa8560d" /> Triggers will also match if it's function matches the search input, and its description will tweak slightly as well <img width="500" alt="image" src="https://github.com/user-attachments/assets/65f515df-b875-4b92-95b7-00389d8a070b" /> ## Performance Had Claude do some benchmarking against `getSearchEntitiesSql` (`EXPLAIN ANALYZE`, median of 5 runs, local Postgres, warm cache) on one synthetic catalog: - 12,000 tables (36,651 `pg_class`), 6,001 policies, 27,261 `pg_proc` (12,000 user + 12,000 extension-owned functions), 56,304 `pg_trigger` - 3,500 user triggers, 500 of which run one shared function; the rest are internal FK triggers - 297,921 `pg_depend`. Compared against master (tables + policies) and the functions PR (before triggers). | Search | What it exercises | master | functions PR | this PR | Δ this PR | |---|---|---|---|---|---| | `t_1` | broad table match | 12ms | 26ms | 30ms | +4ms | | `p_1` | broad policy-name match | 15ms | 27ms | 35ms | +8ms | | `fn_1` | broad function match | 10ms | 26ms | 33ms | +7ms | | `trg_1` | broad trigger-name match | 9ms | 23ms | 32ms | +9ms | | `trg_` | every user trigger matches by name | 10ms | 25ms | 40ms | +15ms | | `audit_row_fn` | function match; its 500 triggers match only through the function | 9ms | 24ms | 31ms | +7ms | | `ri_constraint` | only internal FK triggers match | 9ms | 24ms | 30ms | +6ms | | `stress.fn_1` | schema-qualified | 12ms | 33ms | 40ms | +7ms | | `zzz` | no match | 9ms | 22ms | 27ms | +5ms | - Triggers add +4 to +15ms over the functions PR. The worst case is a search matching every user trigger, at 40ms in total. - Matching triggers through their function shares the single `pg_trigger` pass the name search already does, with no extra scan. A separate pass measured about 30ms more on every search. ## To test - [ ] Search a table name: Tables first, then policies, and functions, and triggers - [ ] Search a trigger name: it appears under triggers and opens the editor panel in database/triggers - [ ] Search a function name: trigger results should appear if the trigger uses that function - [ ] Trigger outside public: schema filter switches and the trigger opens |
||
|
|
1fcd420530 |
feat(studio): suggest enabling Explorer preview on notebook pages (#53060)
## Problem Direct notebook links open even when the Explorer feature preview is off, while the navigation item stays hidden. Users who land on a notebook this way get no hint that the Explorer preview exists or how to turn it on. Resolves FE-4939: https://linear.app/supabase/issue/FE-4939/suggest-enabling-explorer-preview-when-opening-notebook-links ## Solution - Add `ExplorerPreviewSuggestion`, an admonition titled "Explorer is a feature preview" with the text "Enable the Explorer preview to find notebooks from the navigation bar." and an "Enable Explorer" button. The button opens the feature preview modal on the Explorer entry. - Render it below the notebook toolbar in `ExplorerNotebookTab`, only in the loaded notebook state. - Show it only on platform, when the `explorer` flag is on and the user has not opted in to the preview. It is not dismissible and disappears once the preview is enabled. ## Testing - Existing Explorer component tests pass. - Lint ratchet passes. - Manual check: with the `explorer` flag on and the preview off, open a notebook URL directly, confirm the notice appears, and confirm the button opens the feature preview modal. ## Review instructions 1. Enable the `explorer` flag and make sure the Explorer feature preview is off. 2. Open a notebook URL directly. 3. Confirm the "Explorer is a feature preview" notice appears below the notebook toolbar. 4. Click "Enable Explorer" and confirm the feature preview modal opens on the Explorer entry. 5. Enable the preview and confirm the notice disappears. ## 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: Joshen Lim <joshenlimek@gmail.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" /> |
||
|
|
ebe8849f8b |
Skip resource aware search in cmd k while in a sub page (#52773)
## Context Related to the resource aware CMD K changes, this just skips the request for the resource aware search when searching in the CMD K field input if the user is on any sub page, as the search will no longer be relevant. |
||
|
|
5152899fac |
Joshenlim/fe 4720 cmd k support searching for functions (#52751)
## Context Building off from [here](https://github.com/supabase/supabase/pull/52678) to make Cmd+K resource-aware so finding and inspecting anything in a project doesn't depend on knowing where it lives in the dashboard. Specifically looking into database entities for now - end state would be that you could search for a table name for example, and Cmd K will pull up everything related to that table for you to skim (e.g Policies, Functions, Triggers, etc). Changes in this PR sets up searching for **database functions**. <img width="607" height="531" alt="image" src="https://github.com/user-attachments/assets/b4a2cd15-9874-4e80-80d4-d343d8c70fc3" /> ## Performance Ran a Claude session to benchmark `getSearchEntitiesSql` against the version on master (tables and policies only), on the same synthetic catalog: - 12,000 tables (36,651 `pg_class`), 6,001 policies, 27,258 `pg_proc` (12,000 user + 12,000 extension-owned functions), 290,915 `pg_depend`. - Median of 5 runs, `EXPLAIN ANALYZE`, local Postgres (warm cache). | Search | Matches | master | this PR | |---|---|---|---| | `t_1` | ~1/9 of tables | 12ms | 23ms | | `p_1` | broad policy-name match | 13ms | 25ms | | `fn_1` | user + extension functions | 8ms | 23ms | | `fn_` | every function | 8ms | 29ms | | `stress.fn_1` | schema-qualified | 10ms | 30ms | | `zzz` | nothing | 9ms | 22ms | - Adding functions costs +11 to +21ms at this scale - Most of it is fixed (+13ms even for a query that matches nothing): one pass over `pg_proc`, plus building the set of extension-owned functions. It doesn't grow with the number of matches. ## To test - [ ] Search a table name: Tables first, then policies, and functions - [ ] Search a function name: it appears under Functions and opens the editor panel in database/functions - [ ] Function outside public: schema filter switches and the function opens |
||
|
|
7bc32a82fd |
feat(studio): gate api keys settings UI on api-keys grants (#52724)
Part 2 of 4 in a stack for [FE-4694](https://linear.app/supabase/issue/FE-4694/pilot-split-api-keys-queries-and-add-first-refinement-reveal-variant). Based on #52723. ## Stack 1. #52723 Reveal refinement and split api-keys queries 2. 👉 #52724 API keys settings UI and command menu 3. #52727 Database and edge functions consumers that reveal secret keys 4. #52728 Storage, cron, and Realtime consumers; remove the transitional reveal path ## Changes Moves the API keys settings UI off the V2 permission checks and onto `useGrant('GET /v1/projects/{ref}/api-keys')` with the new query options: - `PublishableAPIKeys`, `SecretAPIKeys`, `Project/APIKeys`, and the api-keys settings page use a plain grant. They never requested revealed keys; individual secrets still come from the per-key endpoint. - The command menu's API keys commands use the `reveal` grant, since they copy secret key values. - Each consumer renders loading, denied (`NoPermission`), permission-check error (`AlertError`), and the existing data states. `Project/APIKeys` now shows `NoPermission` when denied instead of a skeleton that never resolved. ## Testing - Migrates `PublishableAPIKeys.test.tsx`, `CommandMenu/ApiKeys.test.tsx`, and the api-keys settings page test to MSW and `customRender`, without mocking the data module or the V2 permissions hook. - Adds `PublishableAPIKeys.platform.test.tsx` and `CommandMenu/ApiKeys.platform.test.tsx` for granted, denied, and error states. The denied test waits for the denied grant before asserting that no api-keys request was made. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
d727bb0081 |
feat(studio): add reveal refinement for api-keys and split queries (#52723)
Part 1 of 4 in a stack for [FE-4694](https://linear.app/supabase/issue/FE-4694/pilot-split-api-keys-queries-and-add-first-refinement-reveal-variant). Later PRs migrate the api-keys consumers onto grants. ## Stack 1. 👉 Reveal refinement and split api-keys queries 2. #52724 API keys settings UI and command menu 3. #52727 Database and edge functions consumers that reveal secret keys 4. #52728 Storage, cron, and Realtime consumers; remove the transitional reveal path ## Changes - Adds a `reveal` variant for `GET /v1/projects/{ref}/api-keys` in `lib/fga-refinements.ts`. It requires `api_gateway_keys_secret_read` on top of the base annotation, and owns the `reveal` query param: the fetch wrapper sets it to `'true'` for a reveal grant and `'false'` otherwise (including `unguarded`), so passing `reveal` by hand is a type error. - Splits the query into `apiKeysQueryOptions` (plain grant) and `revealedApiKeysQueryOptions` (reveal grant). Both use `skipToken` without a grant, and the grant stays out of the query key. - `useAPIKeysQuery` and `useAPIKeys` stay as deprecated transitional hooks that mint the matching grant with `useGrant`. They can't use `unguarded.migrating`: with `reveal` owned by the wrapper, that would silently return unrevealed keys to consumers that need secrets. - Marks the variant type parameter `const` in `getGrant`, `useGrant`, `ensureGrant`, and `testGrant`. Adding a second refinement with variants widened inference of the branch variants to a union. - Adds `tests/lib/project-grant-mocks.ts` for component tests that need `useGrant` to resolve, and updates tests that partially mocked the V2 permissions hook. ## Testing Adds the type and runtime tests deferred from FE-4689 to `data/guarded-fetch.test.ts`: type equality with the raw client for plain and reveal grants, `reveal` rejected as a caller-supplied param, a reveal grant rejected on an endpoint without that variant, brand invariance, `guardMethod` setting `reveal` from the grant, and `assertGrant` throwing on an unknown variant. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
2b55f7db9a |
Joshenlim/fe 4719 cmd k support searching for policies (#52678)
## Context Continue to build off from [here](https://github.com/supabase/supabase/pull/52205) to make Cmd+K resource-aware so finding and inspecting anything in a project doesn't depend on knowing where it lives in the dashboard. Specifically looking into database entities for now - end state would be that you could search for a table name for example, and Cmd K will pull up everything related to that table for you to skim (e.g Policies, Functions, Triggers, etc). Changes in this PR sets up searching for RLS policies. <img width="609" height="525" alt="image" src="https://github.com/user-attachments/assets/212a430a-314d-48c4-a27c-2f9bb06e8457" /> Policies are matched on, in priority, its name and the target table. ## Performance checking Just ran a check with Claude just to make sure that the added SQL doesn't cause any performance degradation on the database. Plan guard passes at 12,000 tables, under its 500ms budget. Also benchmarked locally with a 3-character query matching every policy, results look good so should be alright: | Catalog | Worst-case search | No-match baseline | |---|---|---| | 36k policies | ~52–64ms | ~16ms | | 120k policies | ~118–134ms | ~63ms | ## To test - [x] Search a table name: Tables first, then its policies, under Policies - [x] Search a policy name: it appears under Policies and opens the editor panel in database/policies - [x] Policy outside `public`: schema filter switches and the policy opens |
||
|
|
0b9e8bdea4 |
Joshenlim/fe 4882 make the new integrations UI the default (#52683)
## Context Makes the one-click integrations feature preview the new default + cleans up all the old integrations code that's no longer used with this change ## To test - [ ] Verify that the project integrations page is using the new UI |
||
|
|
5912394ffc |
chore(studio): improve object versioning feature preview (#52689)
Improve copywriting and add image for the Storage Object Versioning feature preview. |Before | After | |--|--| | <img width="1096" height="717" alt="Screenshot 2026-11-03 at 11 05 30" src="https://github.com/user-attachments/assets/88a7f13e-4762-48cd-89db-57e2c51f7613" /> | <img width="1075" height="693" alt="Screenshot 2026-11-03 at 11 06 28" src="https://github.com/user-attachments/assets/bab3a2ef-f8bf-4188-865a-701e482347f1" /> | ## How to review 1. Open `Storage object versioning` feature preview 2. See feature preview 3. Acknowledge feature preview 4. Approve --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> |
||
|
|
3d76559cec |
chore(studio): remove logs.all deprecation banner (#52491)
## Problem The `logs.all` Management API endpoint retired on September 23, and the deprecation banner stopped rendering on September 24 because of its hardcoded expiry. The banner's code is now dead weight in the bundle. Resolves GROWTH-1104. ## Solution Removes the banner and everything it pulled in: - Deletes `BannerLogsAllDeprecation.tsx`, plus its mount effect, expiry timer, and exposure tracking in `AppBannerWrapper.tsx`. - Removes `isLogsOrObservabilityPath` (only this banner used it) and its tests. - Removes `BANNER_ID.LOGS_ALL_DEPRECATION`. `BannerStackProvider.test.tsx` used it as an arbitrary ID, so those tests now use `BANNER_ID.EXPLORER`. The tests themselves are unchanged. - Removes the `LOGS_ALL_DEPRECATION_2026_09_23` local storage key and the two `logs_all_deprecation_banner_*` telemetry events. The dismissal key stays in users' browsers, which is harmless because nothing reads it anymore. ## Review instructions 1. Open a project's Logs or Observability page on the preview and confirm no `logs.all` notice appears and the page renders normally. 2. Open an organization's landing page and confirm the Terms of Service banner still behaves as before. ## 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) |
||
|
|
7d63d764fc |
Joshenlim/fe 4712 cmd k support searching for database tables (#52205)
## Context Looking into some kaizen improvements for Cmd+K, with the overarching idea to make Cmd+K resource-aware so finding and inspecting anything in a project doesn't depend on knowing where it lives in the dashboard. Specifically looking into database entities for now - end state would be that you could search for a table name for example, and Cmd K will pull up everything *related* to that table for you to skim (e.g Policies, Functions, Triggers, etc). Changes in this PR sets the foundation here by starting with just the tables. <img width="500" alt="image" src="https://github.com/user-attachments/assets/65054781-2385-416c-aed9-f142380e4454" /> This might be similar to how we currently support searching for database entities via these "Queries" section, but these only search within the context of the entity category, not across (e.g only tables, only policies) <img width="500" alt="image" src="https://github.com/user-attachments/assets/66ca16c6-9551-4134-b1e1-0b0c4b004085" /> The idea isn't to replace this, but provide another way to find your database entities so that - You can see related entities to what you're searching at a glance - You don't need to go to a 2nd level nav in Cmd K Also fwiw the bulk of the LOC changes in here are mainly tests actually, actual LOC changes are +385, -22 |
||
|
|
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> |
||
|
|
27e6259a39 |
chore(studio): remove legacy status banner and incidentIoStatusPage flag (#51852)
## Summary The incident.io status page is now the only status banner for everyone, so the legacy status banner path is removed: - Removed the `incidentIoStatusPage` ConfigCat flag. The incident.io path is unconditional. - Deleted the legacy status banner code (`StatusPageBanner` and its utils/visibility hook) and its tests. - Deleted the legacy API endpoints `/api/incident-banner`, `/api/incident-status`, and `/api/status-override` (pages, app, and routes variants), along with their data hooks, query keys, and lib helpers. - Removed `STATUSPAGE_*` env vars from the Turbo config and the `INCIDENT_BANNER_DISMISSED_IDS` local storage key from `packages/common`. - Updated the AI tools and SQL generation endpoint that read the flag. `NEXT_PUBLIC_ONGOING_INCIDENT` / the `ongoingIncident` override is kept. The `incident_status_cache` table and its migration are intentionally untouched. Studio no longer reads it, and dropping it is a separate cleanup. ## Testing - Studio typecheck passes. - Related vitest suites pass (414 tests). |
||
|
|
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> |
||
|
|
25708ed67a |
chore(studio): storage versioning override conflict (#51593)
## Problem When uploading a file with same name of already existing file, the ui automatically creates a new file with incremental number and doesn't consider the scenario of giving the possibility of storing the new upload as a version of the already existing file. ## Solution Provide modal to chose the behaviour when name conflict happens when uploading a file: - Replace existing file (same file with version history) - Keep both (new file with incremental numbering) https://github.com/user-attachments/assets/ee192be9-4087-4e14-89f1-1c82acf550cd Manage edge case of clashes with files created when bucket had versioning enabled (so with `is_versioned` flag to true) and clashing upload happens when bucket is in SUSPENDED state. https://github.com/user-attachments/assets/00694c77-07c1-405e-bd54-bdf0bf99d274 Unrelated fix: - add "Delete permanently" action when selecting multiple files with versioning enabled <img width="510" height="203" alt="Screenshot 2026-10-13 at 15 59 27" src="https://github.com/user-attachments/assets/5692fc23-2fd3-4259-9de2-3932aecbccd0" /> |
||
|
|
cd00775dd7 |
feat(studio): add the pipeline creation wizard preview foundation (#51425)
## Problem The redesigned pipeline creation flow (mega branch being worked on in #49243) needs an incremental rollout while the existing creation sheet remains the default. ## Solution - Register **Pipeline creation wizard** in Feature Previews, with visibility controlled by the `pipelineCreationWizard` ConfigCat flag. - Require the flag and an explicit user opt-in (via Feature previews dialog) before enabling the preview. This adds the preview registration, copy, storage key, and gate. It does not change creation routing or ship the wizard. The complete gated flow can be tested on #49243. The ConfigCat flag is configured as follows: - **Local/staging:** true for everyone. - **Production:** false by default, true for the **Supabase Team Email** segment. The flag makes the preview visible; it does not opt anyone in. Users enable it once in Feature Previews. No dev toolbar override is needed in local/staging. ## Review instructions 1. In local or staging hosted Studio, open **Feature previews**. Find **Pipeline creation wizard**. With no saved preference, it should be off by default. 2. Toggle it on and reload. The opt-in should persist. Toggle it off and reload to confirm opt-out persists. **Add pipeline** still opens the sheet in this foundation PR. |
||
|
|
b5c865521f |
feat(studio): notify users about the Terms of Service update (#51302)
## Problem Dashboard users need a notice about the Terms of Service update alongside #51106 and #51107. ## Solution Reuse the organisation landing-page notice pattern from #50397. A compact “We've updated our Terms of Service.” notice opens the explanation and agreement link through **Learn more**. Closing the notice or choosing **Got it** remembers dismissal in the browser with a new version-specific key. ```text Organisation landing page Notice → Learn more → Explanation and Terms of Service link Close / Got it → Remember dismissal ``` | After | | --- | | <img width="628" height="444" alt="CleanShot 2026-10-06 at 14 47 46@2x" src="https://github.com/user-attachments/assets/72922712-321f-4972-b20c-1a075e0745d0" /> | | _Banner_ | | <img width="1078" height="718" alt="CleanShot 2026-10-06 at 16 58 18@2x" src="https://github.com/user-attachments/assets/2109c2ab-e9b7-4855-8acb-42d5232cd002" /> | | _Dialog_ | ## Review instructions 1. Open `/organizations` or an organisation's `/org/<slug>` landing page in the hosted Studio preview. Expect the compact notice. 2. Click **Learn more**. Expect the explanation and a link to the Terms of Service. Escape closes the dialog without dismissing the notice. 3. Choose **Got it**, then reload. The notice stays dismissed. Repeat in a fresh browser profile using **Close banner**. 4. Open a project or an organisation settings page. The notice should not appear. |
||
|
|
ab383421c5 |
fix(studio): show sign-in banner based on Dashboard component [FE-3443] (#51283)
## Summary * Makes sign-in banner visible on unauthenticated pages * Show only when one of the affected components is Dashboard * Works only when new status page (under feature flag) is being used * Regression fix: Auth pages without the status banner (sign-up, sign-in-mfa, sign-in-recovery-code, sign-in-sso, sign-in-partner, forgot-password, forgot-password-mfa, reset-password) no longer reserve dead space at the top for a banner they don't render ## Test plan - [X] TypeScript: `tsc --noEmit` passes clean, no type errors - [X] Unit tests: All new/existing tests pass in `apps/studio/lib/status-page/status-page.utils.test.ts` and `apps/studio/components/layouts/AppLayout/StatusBanner.utils.test.ts` (697 files / 7833 tests, no regressions) - [X] Manual verification: Sign-in page still renders the banner correctly when an incident affecting Dashboard is active; no layout regression **Related:** [FE-3443](https://linear.app/supabase/issue/FE-3443/only-show-sign-in-incident-banner-when-relevant) |
||
|
|
089133cc2c |
feat(storage): add bucket object versioning form fields (FE-4161) (#49203)
| # | Branch | Base | | - | ------ | ---- | | 1 | `feat/storage-versioning-private-alpha` — merged | `master` | | 2 | `feat/storage-versioning/002-bucket-form-fields` ◀ | `master` | | 3 | `feat/storage-versioning/003-bucket-modals` | 2 | | 4 | `feat/storage-versioning/004-object-versions-data` | 3 | | 5 | `feat/storage-versioning/005-file-preview-versions` | 4 | | 6 | `feat/storage-versioning/006-billing-storage-retention` | 5 | | 7 | `feat/storage-versioning/007-archived-objects-data` | 6 | | 8 | `feat/storage-versioning/008-archived-rows` | 7 | | 9 | `feat/storage-versioning/009-archived-preview-pane` | 8 | | 10 | `feat/storage-versioning/010-replace-file` | 9 | ## [2/10] Storage object versioning: bucket form fields The object versioning + lifecycle policy form section for the create and edit bucket modals. Mounted onto the ui in PR 3 #49205 - `BucketVersioningFields` — the versioning switch and the suspension / public-bucket / retention-tightening warnings - `LifecyclePolicySection` — the retention window and version cap inputs - `ExpirationModeToggle` — how the two conditions combine (and / or) - `BucketVersioningFields.schema.ts` — zod fields the parent modals spread into their own schema, plus `superRefineBucketVersioning` - `BucketVersioningFields.utils.ts` — retention-tightening detection - `StorageVersioning.constants.ts` — versioning state and expiration mode types, the prefill defaults, and `getBucketVersioningState` Note: a single s3 lifecycle policy expects both `version_expiry_days` and `max_noncurrent_versions` and always evaluate the two fields within the same policy with an AND logic. To enable both AND and OR/EITHER logic, we save two distinct s3 policies so we can enforce the OR logic. See demos and how to reproduce in #49205 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary * **New Features** * Eligible projects with the preview enabled can configure object versioning for storage buckets, including version expiration, retained-version limits, and “and/or” lifecycle conditions. * Settings default to 30 days and 10 retained versions, with validation for retention values and requirements for setting a version limit. * Notices highlight public buckets, missing lifecycle conditions, suspending existing versioning, and changes that tighten retention limits. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com> |
||
|
|
20d6f2197f |
chore(studio): remove privacy policy notice (#51299)
I removed the Studio Privacy Policy update notice that #50397 added on 2026-09-16, when Privacy Policy v4 took effect. It has been up for almost three weeks, and the ToS v4 banner (#51109) goes out next. I did the same in #44380, removing the March 2026 privacy notice after 15 days. This is the exact inverse of #50397: the banner component and its test, the banner ID, the dismissal local storage key, and the org-landing path helper that only this notice used. ## To test Tested on Vercel preview: - [ ] In a fresh browser profile (no `privacy-policy-update-2026-09-16-dismissed` key), open `/organizations`: expect no Privacy Policy notice - [ ] Open `/org/<slug>`: expect no Privacy Policy notice and the project list renders normally - [ ] Open a project's Logs page: expect the logs deprecation banner behavior unchanged (only shows before its expiry) ## Linear - fixes GROWTH-1322 |
||
|
|
0cb8bd95dd |
feat(studio): add spot colour control to Appearance (#50782)
## Problem The theme's primary hue can change in CSS, but Appearance had no way to try other spot colours. That makes it hard to find controls whose colour still depends on the fixed Supabase brand palette. ## Solution Add a **Spot color** control under Appearance → Theme colors (employee-only via ConfigCat `appearanceSpotColor`, targeted to Supabase Team Email). ### Spot color UX - Rainbow spectrum track with a thin outline so pale tracks stay visible - Live trifecta swatches for `--primary-solid`, `--primary`, and `--primary-bright` (darkest → lightest) next to the degree readout - Drag updates are rAF-batched so React paint and CSS preview stay to one frame ### Canvas tint coupling - `--surface-hue` is derived in CSS as `calc(var(--primary-hue) + var(--surface-hue-offset))` - Dark: offset `0` (same hue as spot) - Light: offset `180` (complementary canvas tint; brand green ≈157.5° → rose ≈337.5°) - No JS override of `--surface-hue`. Changing Spot color moves primary controls and the low-chroma canvas tint together ### Other theme sliders - Renamed **Color intensity** → **Surface tint** (it only drives the neutral ramp via `--chroma`, not spot chroma) - Meaning-shaped tracks for every knob (spectrum, grey→tint, soft→hard, dark→light, flat→lift) - Same outline treatment on those tracks | Before | After | | --- | --- | | <img width="1476" height="2174" alt="CleanShot 2026-10-05 at 15 02 21@2x" src="https://github.com/user-attachments/assets/d08b0fa8-32af-450e-adce-861f59c9d6ca" /> | <img width="1474" height="2354" alt="CleanShot 2026-10-05 at 14 56 35@2x" src="https://github.com/user-attachments/assets/9a1e6183-a4ba-4c8e-a458-bb0eea946db8" /> | | _Anyone else_ | _With staff flag, custom settings_ | ## Review instructions 1. Confirm ConfigCat flag `appearanceSpotColor` is on for your staff account (or flip it in the Dev Toolbar). 2. Open `/account/me` → **Appearance → Theme colors**. 3. Without the flag: Spot color is hidden; other theme sliders still work. 4. With the flag: drag Spot color in light and dark. Primary controls and canvas tint should move together; Supabase brand assets should stay fixed. 5. Raise Surface tint and confirm the canvas hue follows the complementary (light) or same-hue (dark) offset. 6. Refresh, switch modes, and use **Reset** to check persistence and defaults. |
||
|
|
ba82106697 |
chore(www + studio): remove expired Select 2026 promo banners (#51245)
## Problem Supabase Select 2026 has finished. The promo banners already hide via the scheduled expiry from #51006, but the campaign code, assets, and wiring are still in the tree. ## Solution Remove the Select 2026 sitewide promotion across www and Studio: - Delete shared `Select26*` banner code, font, and tests from `ui-patterns` - Delete Studio `BannerSelect2026*` and its Banner Stack registration - Unmount the www announcement banner and revert the State of Startups spacing that only existed for it - Drop the Select-only session-replay `data-band` allowlist entry and lint ratchet baseline Event go pages, blog posts, and other Select content are left alone. The `Announcement` shell stays for the next campaign. ## Review instructions 1. Open the www homepage on the deploy preview. Confirm there is no Select announcement bar above the nav. 2. Open `/state-of-startups` on the deploy preview. Confirm the hero still looks correct with no extra top gap from the removed banner. 3. Open a hosted Studio dashboard page on the deploy preview. Confirm the Banner Stack no longer shows a Select card. ## 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) |
||
|
|
ed692f6905 |
feat(select): schedule livestream banners (#51006)
## Problem The Select banners on www and Studio still promote attendance. They need to keep serving the waitlist until the event, promote the livestream during the requested window, and disappear after the event. ## Solution Use a shared three-phase clock: existing promotion before 8:00am PT on 2 October, livestream promotion from 8:00am to 5:30pm PT, and no banner afterwards. Both livestream CTAs lead to `select.supabase.com`, where viewers can choose a stage. Separate dismissal keys let someone who dismissed the earlier promotion see the livestream. Open pages set a timer for the next boundary and recheck on visibility, focus, or page restore. | `www` | | --- | | <img width="736" height="136" alt="CleanShot 2026-09-29 at 16 27 38@2x" src="https://github.com/user-attachments/assets/1281bcf0-ece4-41fc-99d2-1f9ab6e1b3f5" /> | | _Until Friday 8am PT_ | | <img width="734" height="138" alt="CleanShot 2026-09-29 at 16 28 06@2x" src="https://github.com/user-attachments/assets/05b8779a-9961-4886-ad7d-96ba31c8b4f7" /> | | _Friday 8am to 5:30pm PT_ | | `studio` | | --- | | <img width="612" height="454" alt="CleanShot 2026-09-29 at 16 26 51@2x" src="https://github.com/user-attachments/assets/0d9a8bbb-c636-41dc-aa76-381196c149c2" /> | | _Until Friday 8am PT_ | | <img width="616" height="440" alt="CleanShot 2026-09-29 at 16 27 09@2x" src="https://github.com/user-attachments/assets/458afdb9-6576-4699-9419-947ca5312bcd" /> | | _Friday 8am to 5:30pm PT_ | ## Review instructions 1. Open the [www homepage](https://zone-www-dot-com-git-dnywh-select-2026-livestre-93dab1-supabase.vercel.app/) and a [hosted Studio dashboard](https://studio-staging-git-dnywh-select-2026-livestream-05b822-supabase.vercel.app/) in separate tabs. If the Privacy Policy update card is in front in Studio, close it (only) to reveal the Select banner. 2. In each tab's DevTools console, paste this helper: ```js window.selectRealNow = Date.now window.showSelectAt = (iso) => { Date.now = () => new Date(iso).getTime() window.dispatchEvent(new Event('focus')) } ``` 3. Run `showSelectAt('2026-10-02T07:59:00-07:00')`: both banners keep the existing “Apply to attend” CTA. 4. Run `showSelectAt('2026-10-02T08:00:00-07:00')`: www shows “Supabase Select 2026” and “Watch the livestream”; Studio shows the same title, the description “Keynote, main stage, and build stage, streamed all day.” and “Watch livestream”. Both CTAs link to `https://select.supabase.com/`. 5. Run `showSelectAt('2026-10-02T17:30:00-07:00')`: neither banner is visible. Restore the clock with `Date.now = window.selectRealNow; window.dispatchEvent(new Event('focus'))`. The console clock override affects only the current tab and is lost on reload. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - The Select 2026 banner switches from waitlist messaging to livestream details and a “Watch livestream” link during the livestream period. - Livestream banner dismissals are tracked separately from waitlist banner dismissals. - Promotion banners end at 5:30 p.m. Pacific on October 2, 2026, and update when the promotion changes phase, including after returning to an open tab. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
0daafca2ca |
feat(studio): status page banner (incident / maintenance / upcoming) (#51044)
## Summary * Adds a new global status banner (`StatusBanner`) driven by the [incident.io](<http://incident.io>) status page data, showing at most one of: an active incident, in-progress maintenance, or upcoming maintenance, in that priority order. * All three types are independently dismissible (persisted to a new localStorage key, `status-banner-dismissed-keys`); dismissal hides the banner for items still active, and a new incident reappears even if a related item was previously dismissed. * Only shows to users who are actually affected (based on their projects' regions) or when region data is incomplete (fails open), and is bypassed entirely by the existing emergency incident override. * Behind the existing `incidentIoStatusPage` ConfigCat flag — `AppBannerWrapper` renders this new banner instead of the legacy `StatusPageBanner` only when the flag is on; default behavior is unchanged. * This is PR 5b in a stacked series for Linear [FE-4057](https://linear.app/supabase/issue/FE-4057) — see that issue for full design context. ## Test plan * New unit tests (`StatusBanner.utils.test.ts`) covering banner-selection priority, dismissal-key handling, and copy generation * New MSW component test (`StatusBanner.test.tsx`) covering loading state, dismiss-and-persist, and the emergency-override path * `pnpm --filter studio run typecheck`, `lint:ratchet`, `pnpm knip --workspace apps/studio`, `pnpm test:prettier`, and relevant vitest suites all pass 🤖 Generated with [Claude Code](<https://claude.com/claude-code>) Co-Authored-By: Claude [noreply@anthropic.com](<mailto:noreply@anthropic.com>) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added status banners for relevant incidents and scheduled maintenance, including incident details, maintenance timing, and links to the status page. * Banners can be dismissed, and dismissed items stay hidden while new incidents or maintenance updates can still appear. * Upcoming maintenance banners appear within the relevant lead time, and maintenance timing is shown when available. * Emergency overrides display a warning banner without a dismiss option. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |