mirror of
https://github.com/supabase/supabase.git
synced 2026-12-03 23:18:57 +00:00
docs/tutorial-template
347
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 |
||
|
|
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>
|
||
|
|
e0635f2f38 |
[FE-5108] (part 3) refactor(studio): migrate database, editors & storage off next/link (#54306)
Part 3 of a 6-PR stack migrating all `next/link` imports in `apps/studio` onto TanStack Router's `Link` (or plain `<a>` for known external URLs) and removing `compat/next/link.tsx`. | Part | PR | Scope | | --- | --- | --- | | 1 | #54304 | `data/prefetchers/PrefetchableLink.tsx` and `components/ui/**` | | 2 | #54305 | `components/layouts/**` and top-level shell components | | **3** | **#54306 ← this PR** | **Database, TableGridEditor, Storage, SQLEditor, BranchManagement, Branching, Functions, Realtime** | | 4 | #54307 | Integrations, Settings, Observability, LogDrains, Issues, Linter, Reports, QueryPerformance, QuerySources, ConfigDrift, DiskManagement, Compute | | 5 | #54308 | Remaining `components/interfaces/**` (Org, Billing, Auth, Support, Home, SignIn, ConnectSheet, etc.) | | 6 | #54309 | Remove `compat/next/link.tsx` shim, Vite alias, and update basePath tests/docs | Migrates `components/interfaces/{Database,TableGridEditor,Storage,SQLEditor,BranchManagement,Branching,Functions,Realtime}/` off `next/link`. **Changed:** - Replaced `next/link` across all 60 importing files in Database, TableGridEditor, Storage, SQLEditor, BranchManagement, Branching, Functions, and Realtime interfaces - Updated legacy permanent-redirect hrefs (`/reports` → `/observability`, `/database/schema` → `/database/schemas`) to their canonical TanStack routes - Dropped legacy `passHref` in `GridHeaderActions.tsx`, removed duplicate `RouterLink` alias in `ChooseFunctionForm.tsx`, and removed `vi.mock('next/link', ...)` in `ReplicationPipelineLayout.test.tsx` Addresses [FE-5108](https://linear.app/supabase/issue/FE-5108/replace-the-nextlink-shim-with-tanstack-link) ## To test - [ ] Check Table Editor, SQL Editor, Database (tables, policies, functions, triggers, replication, backups), Storage (files/analytics/vector buckets), Edge Functions, Branching, and Realtime links - [ ] Verify SQL Editor and Table Editor links with query parameters (`schema`, `content`, `search`) do not double-encode values --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
477e2c136f |
[FE-5109] (part 6) chore(studio): remove next/router shims, aliases, and test mocks (#54058)
Part 6 (final) of a 6-PR stack migrating all `next/router` and `next/compat/router` imports in `apps/studio` onto TanStack Router hooks and removing the router shims. | Part | PR | Scope | | --- | --- | --- | | 1 | #54053 | Core navigation helpers, `hooks/**`, `lib/**`, `data/prefetchers/**` | | 2 | #54054 | `components/ui/**` | | 3 | #54055 | `components/layouts/**` and `state/tabs.tsx` | | 4 | #54056 | Database, Branching, Compute, Edge Functions, Explorer, SQL Editor, Storage, Table Editor | | 5 | #54057 | Remaining `components/interfaces/**` and `QueryInsightsTable` router events | | **6** | **#54058 ← this PR** | **Remove `next/router` & `next/compat/router` shims, `_router-events.ts`, Vite aliases, and test mocks** | Now that no files in `apps/studio` (or `packages/**`) import `next/router` or `next/compat/router`, deletes the router shims, `_router-events.ts`, their Vite aliases, and the obsolete router test mocks. `RouteValidationWrapper` is intentionally left for FE-3107. **Removed:** - `apps/studio/compat/next/router.ts`, `apps/studio/compat/next/compat/router.ts`, and `apps/studio/compat/next/_router-events.ts` - `'next/router'` and `'next/compat/router'` entries from `nextShims` in `apps/studio/vite.config.ts` - Global `vi.mock('next/router', ...)` and `vi.mock('next/compat/router', ...)` in `apps/studio/tests/vitestSetup.ts`, `mockNextRouter` in `apps/studio/tests/lib/route-aware-hooks.ts`, and the unused `vi.mock('next/router')` in `tests/features/logs/LogTable.test.tsx` - Obsolete shim tests and test helpers: `compat/next/router.test.ts`, `compat/next/router-navigation.test.tsx`, `tests/config/router.tsx`, and `tests/config/router.test.tsx` **Changed:** - Simplified `createNavigationHandler` in `apps/studio/lib/navigation.ts` (and `navigation.test.ts`) to accept TanStack's `UseNavigateResult<string>` only, dropping the `NextRouter` union branch - Updated `compat/next/link-basepath-navigation.test.tsx` (renamed from `router-basepath-navigation.test.tsx`), `lib/router-url-shape.test.tsx`, and `tests/lib/route-render.test.tsx` to exercise TanStack Router hooks directly instead of the removed router shim - Cleaned up stale `next/router` comments in `compat/next/link.tsx`, `lib/internal-url.ts`, `router.tsx`, and `tests/lib/route-mock.ts` **Simplified:** - Removed `routerMock` setup from about 19 tests that no longer read it. `next-router-mock` stays for now, because the test `FrameworkProvider` still feeds `useParams` from it. - `AGENTS.md` and the `vite.config.ts` error text now say only `next/link` and `next/script` are shimmed - Renamed `compat/next/router-basepath-navigation.test.tsx` to `link-basepath-navigation.test.tsx`, and removed stale router-shim references from comments Addresses [FE-5109](https://linear.app/supabase/issue/FE-5109/replace-the-nextrouter-shims-with-tanstack-router-hooks) ## To test - [ ] Confirm `git grep -E "next/(compat/)?router|_router-events" apps/studio` returns no code or config imports (only the prose guideline in `apps/studio/AGENTS.md`) - [ ] Confirm `pnpm --filter studio run typecheck`, `pnpm --filter studio run lint`, `pnpm --filter studio run build`, Knip, and the full Studio Vitest suite pass - [ ] Spot-check basePath navigation (`next/link` + `navigateToUrl`) and multi-line query param URLs in Studio --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
d8568215ad |
[FE-5109] (part 4) refactor(studio): migrate database, editor, storage, and functions interfaces off next/router (#54056)
Part 4 of a 6-PR stack migrating all `next/router` and `next/compat/router` imports in `apps/studio` onto TanStack Router hooks and removing the router shims. | Part | PR | Scope | | --- | --- | --- | | 1 | #54053 | Core navigation helpers, `hooks/**`, `lib/**`, `data/prefetchers/**` | | 2 | #54054 | `components/ui/**` | | 3 | #54055 | `components/layouts/**` and `state/tabs.tsx` | | **4** | **#54056 ← this PR** | **Database, Branching, Compute, Edge Functions, Explorer, SQL Editor, Storage, Table Editor** | | 5 | #54057 | Remaining `components/interfaces/**` and `QueryInsightsTable` router events | | 6 | #54058 | Remove `next/router` & `next/compat/router` shims, `_router-events.ts`, Vite aliases, and test mocks | Migrates the database, branching, compute, functions, explorer, SQL editor, storage, and table editor interfaces off `next/router` and `next/compat/router`. **Changed:** - Migrated the sole `next/compat/router` consumer (`components/interfaces/Database/Replication/Destinations.tsx`) to `useNavigate` - Replaced `useRouter` across `BranchManagement`, `Branching`, `Compute`, `Database` (`Backups`, `Functions`, `Replication`, `Schemas`, `Tables`, `Triggers`), `EdgeFunctions`, `Explorer`, `Functions`, `SQLEditor`, `Storage` (`AnalyticsBuckets`, `FilesBuckets`, `VectorBuckets`, `StorageMenuV2`, `Storage.utils`), and `TableGridEditor` with TanStack Router hooks (`useNavigate`, `useLocation`, `useRoutePattern`) and `useParams` from `common` - Updated unit and component tests across `Database/Replication`, `Explorer`, `Functions`, and `Storage/FilesBuckets/DeleteBucketModal.test.tsx` to use TanStack Router **Simplified:** - `useSnippetEditor` and `useRedirectLegacyReadReplicaDestination` read search values from `useParams` instead of casting `location.search` - `resolveSourceSwitch` returns `replace: boolean` instead of a `push`/`replace` method name - `ExplorerQueryTab` and `EdgeFunctionDetails` guard on a defined ref instead of navigating with `ref ?? ''` - `useFunctionsDetailShortcuts` and `StorageMenuV2` use a local `goTo` helper for their navigation shortcuts - Tests use the shared `createTestRouter` and `customRender` router, use `toMatchObject` for search assertions, and drop duplicate assertions Addresses [FE-5109](https://linear.app/supabase/issue/FE-5109/replace-the-nextrouter-shims-with-tanstack-router-hooks) ## To test - [ ] SQL Editor: creating, renaming, moving, opening templates/examples, and keyboard shortcuts navigate between snippets cleanly - [ ] Table Editor & Database: opening tables, schema table nodes, triggers, functions, backups/PITR, and replication destination flows navigate as expected - [ ] Storage: switching between Files, Analytics, and Vector buckets and deleting a bucket navigates cleanly - [ ] Edge Functions & Explorer: opening function details/logs, explorer chat/query tabs, and branch management actions navigate properly --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
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. |
||
|
|
cbcdf4c84c |
fix(studio): storage lifecycle policy execution (#54138)
## Problem Non-current versions in storage weren't showing the correct expiration value based on the lifecycle policies settings. ## Solution Fix client logic and improve communication around expiration. Adding "Archived at" info make the version history crowded, so some information has been moved into the dropdown menu of each noncurrent version. <img width="445" height="314" alt="Screenshot 2026-11-26 at 16 58 23" src="https://github.com/user-attachments/assets/efb345f7-9a1c-4a53-b5e2-8b05505f9856" /> Note: when the "Newest noncurrent versions to keep" threshold is met, older versions that exceed such thresholds will expire no earlier than in 1d. ## Review instructions - Enable object versioning and set lifecycle policies on a File Storage bucket - add new versions to reach and exceed policy threasholds - check that expiration rules apply as intended |
||
|
|
434c00cb14 |
Joshenlim/fe 5196 move off scaffold components for remaining (#53911)
## Context
Final clean up of deprecated Scaffold components, just touches
- Account audit logs
- Project home page
- Database -> Column privileges
- Storage -> Analytics bucket details
- Storage -> Vector bucket details
- Settings -> Infrastructure -> Disk management
- Settings -> Infrastructure -> Read replica details
- Integrations -> Wrappers overview (Only for non supported integration
UI)
- Edge functions -> Empty state
- Auth -> Performance
Also replaces usage of `ScaffoldDivider` with just the `Separator`
component
And also adjusts the page container sizes of database pages from large
to default - these only have visual differences on viewport widths
larger than a laptop
Testing just needs a quick sweep of all these surfaces to make sure
nothing looks weird - will do so on my end too once the builds go
through!
For @supabase/security's review - review requirement was triggered as
`Documents.tsx` was updated in the organization settings page. But it
was just to change the Divider component 🙏
|
||
|
|
953e508a3e |
[FE-5110] refactor(studio): replace next/navigation with TanStack (#54041)
Moves the remaining `next/navigation` imports in Studio onto TanStack
Router hooks (and `useParams` from `common`), finishes migrating the
remaining `next/link` and `next/router` usages in the touched
components, and removes the `compat/next/navigation.ts` shim and its
Vite alias. Shared packages (`packages/**`) no longer import
`next/navigation`, so the alias can be dropped now.
**Removed:**
- `apps/studio/compat/next/navigation.ts` and the `'next/navigation'`
entry in `apps/studio/vite.config.ts`
- Global `next/navigation` mock in `apps/studio/tests/vitestSetup.ts`
and the obsolete `apps/studio/tests/lib/route-mock.test.tsx`
**Changed:**
- Replaced `usePathname` (12 files) and `useSearchParams` (3 files) with
`useLocation({ select })` from `@tanstack/react-router`
- Replaced `useRouter` in Storage bucket tables, SQL Editor commands,
and `SignInMfaForm` with `useNavigate` from `@tanstack/react-router`,
and updated `createNavigationHandler` in `lib/navigation.ts` to accept
either `NextRouter` or TanStack's `useNavigate`
- Replaced remaining `next/link` imports in touched components
(`SignInMfaForm`, `Restriction`, `DownloadLogsButton`,
`DownloadResultsButton`, `AuthEmailsLayout`, `AuthProvidersLayout`,
`JWTKeysLayout`, `StorageBucketsLayout`) with TanStack Router's `Link`
- Replaced `useParams` in `CreatePublishableAPIKeyDialog` with
`useParams` from `common` (matching `CreateSecretAPIKeyDialog`)
- Wrapped `CustomWrapper` (`tests/lib/custom-render.tsx`) in a default
TanStack `RouterContextProvider` (with optional `router` / `initialUrl`
overrides) and updated affected component tests to drop their
`next/navigation` mocks
Addresses
[FE-5110](https://linear.app/supabase/issue/FE-5110/replace-the-nextnavigation-shim-with-tanstack-router-hooks)
## To test
1. Check active tab highlighting and navigation across Auth Emails, Auth
Providers, JWT Keys, Storage Buckets, and Editor layouts
2. Verify clicking, Cmd/Ctrl-clicking, middle-clicking, and pressing
Enter on Storage bucket rows (Files, Analytics, Vector) navigates as
before
3. Run "Query a table..." and open SQL snippets from the Command Menu
and confirm `/project/$ref/sql/$id` opens with multi-line SQL preserved
in `?content=`
4. In the MFA sign-in flow, verify the recovery code link and
`forgot-password` completion preserve query params (`returnTo`,
`context=forgot-password`), and Cancel signs out and replaces history
with `/sign-in`
5. Confirm Table Editor sort/filter URL sync persists filters per table
without leaking across table switches
---------
Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
|
||
|
|
73f1a60341 |
fix(studio): hide spend cap file size banner when Pro already allows 500 GB (#53633)
## What Storage settings showed "Reduced max upload file size limit due to spend cap" to every Pro org with spend cap on, telling them to disable it to get 500 GB uploads. The `storage.max_file_size` entitlement for Pro is already 500 GB regardless of spend cap, so the banner was wrong and confusing. - The banner now only shows when the entitlement returns a known value below 500 GB (it no longer relies on the 50 GB fallback). The check lives in `isFileSizeReducedBySpendCap` with unit tests. - When it does show, the banner states the current reduced limit (e.g. "Max upload file size limit reduced to 5 GB due to spend cap") instead of a generic message. Fixes FE-5063 |
||
|
|
42b6571e7d |
Chore/housekeeping org pages (#53303)
## Context Some minor UI issues that I found while reviewing another PR - Fix `NoProjectsOnPaidOrgInfo` prematurely showing while project details is still loading <img width="1249" height="376" alt="image" src="https://github.com/user-attachments/assets/3f41f4a3-849f-4685-bcc4-6fed3b433042" /> - Fix padding alignment for Organization details form group <img width="1115" height="282" alt="image" src="https://github.com/user-attachments/assets/c0865614-208c-4335-87d3-176c4411b6a4" /> - Fix projects list on `/org/[slug]` showing stale projects while switching orgs - just removed `keepPreviousData` so that the card loaders shows up - Fix organization settings in sidebar menu not showing active state while on certain settings pages like audit-log-drains, webhooks, etc |
||
|
|
ed6d1b4c63 |
feat(studio): show error details in AlertError and attribute user faults in SQL errors (#53242)
## Problem `AlertError` gives users and support no way to correlate a failure with Sentry or platform logs. It also treats every failure the same: a bad table editor filter or an offline browser gets "try refreshing, contact support". On the reporting side, SQL errors were attributed by who wrote the whole statement. That made errors in the user's part of mixed SQL Studio's fault: policy expressions, function bodies, cron schedules, table editor filters and row edits. Marking them as user SQL instead would drop them from Sentry entirely. Part of FE-4772. ## Solution **`AlertError`** - Platform and Studio faults show the request ID, the Sentry event ID (labeled "before sampling", since the event may be sampled out) and a "Copy details" button. - The copied text never includes `formattedError`, metadata, the cause or SQL. - SQL errors copy the SQLSTATE, position and query name instead of the message. - User faults (`isUserError`) show their message with "Please try again. If the issue persists, try refreshing your browser." There is no support link, no IDs and no copy button. - Offline shows only "You may be temporarily offline. Check your internet connection and try again." - Defaults come from `getErrorPresentation`, and props the caller passes still win. The table editor passes a filter-specific description when filters are set. **SQL error classification** - `executeSql` takes an optional `isUserFaultSqlState` predicate for Studio SQL. When it matches, the error is a `StudioSqlError` with reason `user_input` and fault `user`, and is still redacted to SQLSTATE plus query name. - `isUserFaultForValues` (classes 22, 23 and P0, plus 42501 and 57014) is for typed values: table editor filters and row edits, cron name and schedule. - `isUserFaultForSql` (any SQLSTATE except server classes 08, 53, 57 other than 57014, 58 and XX) is for embedded user SQL: policies, functions, the custom access token hook. - `isUserFaultForStatsStatement` is for `pg_stat_statements` text (Query Insights `EXPLAIN`, index advisor). It treats 42P02 (`$1` placeholders) as Studio's fault. - `UserSqlError` is now only SQL the user wrote in full, and it is still never sent. - The policy, function and cron mutation hooks no longer take `sqlOrigin`. **Routing and types** - `ERROR_ROUTING` is one table keyed by tag, then by fault. Its type requires exactly the faults each class can produce. - User faults get `SAMPLE_USER_FAULT` (default 0.01, set with `NEXT_PUBLIC_SENTRY_SAMPLE_RATE_USER_FAULT`) to catch misclassification. - The error class decides privacy (`isNeverReportedError`), separately from the rate. - Sentry events get a `reason` tag. - Each class declares its `reasons`, so a mistyped reason fails typecheck. ## Review instructions 1. Open the table editor, add a filter with a wrong-typed value (text on an integer column). The alert shows the Postgres error, the filter hint, and no support link, IDs or copy button. 2. Make a query fail with a platform error (e.g. block a `/platform/` request in DevTools). The alert shows the request ID, the event ID and "Copy details". Paste the copied text and check it has no SQL or `formattedError`. 3. Go offline in DevTools and trigger a query. Only the offline message shows. 4. Create a policy with an invalid `USING` expression. The toast shows the Postgres error. In Sentry it is a `StudioSqlError` with reason `user_input`, sampled at the user-fault rate. 5. Review `lib/errors/error-routing.ts` and `data/error-classification.ts` for the routing table and the SQLSTATE predicates. |
||
|
|
00adb5a81b |
chore(studio): remove the Iceberg pipeline destination (#52229)
## Problem Retire the deprecated Iceberg (Analytics Bucket) destination from Pipelines. ## Solution - Remove the destination UI, configuration mappings, feature-flag usage, and generated API variants. - Remove the legacy Pipelines integration from Storage while preserving standalone Analytics Buckets. - Remove unused components and sheet-layout support, and add regression coverage for retained Storage operations. - Remove the stale Pipelines claim from the Storage docs overview. ## Validation - Pipelines, Storage, and replication data tests - After the final cleanup: Studio typecheck and all 3 Analytics Bucket regression tests passed. - Formatting, scoped ESLint, Knip, and whitespace checks passed; lint warnings are pre-existing. - Storage overview: Prettier, ESLint with zero warnings, content-listing schema validation, and Markdown rendering passed. Production API-type verification remains pending the coordinated API deployment. Legacy Iceberg pipelines, destinations, and slots must be cleaned up before rollout. ## Review instructions 1. Verify that Pipelines offers BigQuery, DuckLake, Snowflake, and ClickHouse, with no Analytics Bucket option. 2. Verify that Storage Analytics Bucket creation, namespace/table operations, and wrapper/key cleanup remain available without Pipelines controls. ## Checklist - [x] Read CONTRIBUTING.md. - [x] Updated the Storage overview copy and checked the docs authoring guidance. --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> |
||
|
|
de63769998 |
feat(studio): add ability to purge CDN cache to storage UI (#52777)
## Problem Users should be able to purge the CDN cache for an individual object or entire bucket via the UI. This feature is only available for Pro+ customers. Free tier customers should be encouraged to upgrade to get access. ## Solution - Add a _Purge CDN cache_ action to the bucket menu. Prompt users on Free plan to upgrade if needed. <img width="182" height="149" alt="image" src="https://github.com/user-attachments/assets/b665c8d0-b540-400e-a328-85c48ddafee0" /> <img width="534" height="242" alt="image" src="https://github.com/user-attachments/assets/15dfd3d3-c8a9-4ad7-9046-0929fd715511" /> <img width="538" height="211" alt="image" src="https://github.com/user-attachments/assets/3e29644e-9335-4b1d-b321-49303c2e8476" /> - Add a _Purge CDN cache_ action to the bucket item menu. Prompt users on Free plan to upgrade if needed. <img width="283" height="313" alt="image" src="https://github.com/user-attachments/assets/a801297e-04b5-46c7-aaf7-4569e66e4714" /> <img width="541" height="249" alt="image" src="https://github.com/user-attachments/assets/b58d264b-76ba-43d4-9579-6c07be9cb684" /> <img width="537" height="207" alt="image" src="https://github.com/user-attachments/assets/132b37bd-3a29-48b5-aa7e-7df29abcbfe6" /> ## Notes - Refactored the _Edit bucket_ menu so that only one modal is allowed - Fixed focus management related to the modals displayed by the _Edit bucket_ menu items - Introduced a way to mock the authenticated users in tests ## Review instructions - On an org on at least _Pro_ plan - Open a bucket _Edit bucket_ menu and click _Purge CDN cache_ - Confirming should call the `/platform/storage/{ref}/cdn/purge-bucket` API endpoint - Open a bucket item menu and click _Purge CDN cache_ - Confirming should call the `/platform/storage/{ref}/cdn/purge-object` API endpoint - On an org on _Free_ plan - Open a bucket _Edit bucket_ menu and click _Purge CDN cache_ - You should be prompted to upgrade - Open a bucket item menu and click _Purge CDN cache_ - You should be prompted to upgrade --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> |
||
|
|
c0e92057a6 |
feat(studio): split SQL errors into user and Studio SQL (#53059)
Part of FE-4772. ## Why Errors from the pg-meta query endpoint didn't say who wrote the SQL, so a Sentry issue like SUPABASE-APP-KXE couldn't tell a user's query from one Studio composed. That event came from the assistant's `execute_sql` tool and was captured by the Vercel AI integration on the server, so it skipped `reportStudioError` and had no fault tags. The Postgres message also went to Sentry as-is, and it can contain user SQL and data. ## What - **`sqlOrigin` is required on `executeSql`.** `'user'` covers SQL the user or an AI agent wrote, in whole or in part: SQL editor, editor panel, Explorer, AI `execute_sql` and `run_notebook`, report blocks, Query Insights EXPLAIN, the policy, function, and cron editors, and running a stored cron job. Everything else is `'studio'`. The policy, function, and cron mutation hooks and `useDbQuery` take `sqlOrigin` too. - **`classifySqlResponseError`** turns a 400 from the query endpoint into `UserSqlError` (`user`, `user_sql`) or `StudioSqlError` (`studio`, `studio_sql`). Pattern rules (connection timeouts) and other statuses keep their classes. - **`UserSqlError` never reaches Sentry.** Its routing is `SAMPLE_NEVER`, `alwaysCapture` doesn't override it, and `beforeSend` drops it. - **`StudioSqlError` is redacted.** Error classes can set `sentryMessage`; for `StudioSqlError` it is the SQLSTATE and the query's `queryName`, a static name that `executeSql` requires for Studio SQL. The query key is never reported, since its segments can hold IDs, schemas, and search terms. `applyStudioErrorPolicy` applies it from `beforeSend` on the client and the server, so it holds however the error was captured. The server config gets a `beforeSend` for this. Events get `query_name` and `sql_state` tags and are grouped by both, since every SQL error shares the `executeSql` stack. - **A custom `handleError` gets the classified error**, matching its declared type. The SQL editor, editor panel, and policy editor rethrow it, so their errors are now `UserSqlError` instead of being reported as `UnexpectedError`. The error keeps Postgres's `position` for the editor's line highlight. The error message, `formattedError`, and `position` stay on the error for the UI. The query-performance Sentry context no longer carries the raw error message, which bypassed redaction. ## Known gaps - Index advisor queries run users' query text from `pg_stat_statements` but are marked `'studio'`. Redaction keeps the text out of Sentry, but their failures count as Studio faults. - 5xx responses for user SQL are still `PlatformError` and keep their message. - The self-hosted MCP `executeSql` calls `executeQuery` directly and isn't covered. ## Testing - Unit tests for `classifySqlResponseError`, `applyStudioErrorPolicy`, and the client `beforeSend`. - Full Studio vitest suite passes except `useReportDateRange.test.ts` (169 vs 168 hourly buckets across the DST change), which this PR doesn't touch. |
||
|
|
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) |
||
|
|
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" /> |
||
|
|
04f3c6c41c |
fix(studio): return to the buckets list after deleting a bucket from its page (#53028)
## Problem Deleting a bucket from its own page (`/storage/files/buckets/[bucketId]`) could leave Studio on the deleted bucket's route. The page kept loading and then showed "Failed to fetch buckets" / "Bucket not found". On success, `DeleteBucketModal` called `onClose()` and then `router.push` to the buckets list. On the bucket page, `onClose` clears the `?delete` query param through nuqs, which queues its own shallow push to the current bucket URL. That push could race with the navigation to the list and land back on the deleted bucket. The page then re-rendered with the bucket query already removed from the cache, refetched the missing bucket, and got a 404. ## Solution - On the bucket's own page, the success handler now awaits `router.push` to the buckets list and does not call `onClose`. The modal closes when the page unmounts. When there is no `bucketId` in the route, it still calls `onClose` as before. - Added a component test for deleting from the bucket page. It checks that Studio ends up on `/project/<ref>/storage/files` and that `onClose` is not called. The test opts out of the global `useParams` stub so the modal reads `bucketId` from the mocked route. It fails without the fix. ## How to verify 1. Open a project, go to Storage > Files, and open any bucket. 2. Choose Edit bucket > Delete bucket, type the bucket name, and confirm. 3. Studio shows the success toast and lands on the buckets list (`/project/<ref>/storage/files`). The deleted bucket no longer appears there. 4. Studio never shows the deleted bucket's page with a spinner that keeps loading, "Failed to fetch buckets" or "Bucket not found". ## Checks run - `pnpm --filter studio exec vitest run components/interfaces/Storage/FilesBuckets/DeleteBucketModal.test.tsx` (2 passed) - `pnpm turbo run typecheck --filter='...[origin/master]'` - `pnpm turbo run lint --filter='[origin/master]'` - Prettier check on the changed files [FE-4926](https://linear.app/supabase/issue/FE-4926/deleting-a-bucket-leaves-its-page-loading-until-an-error) --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
ab54becc60 |
docs(storage): move url signing keys to dedicated page (#52954)
## Problem Details about URL signing keys are embedded in the downloads page, but it is a broader security related topic that applies to both uploads and downloads. There is no signed URL guidance in the Standard Upload section ## Solution - Move details about URL signing keys to a dedicated page under the storage>security tab (content mostly the same) - Replace URL signing key details in downloads page with a brief blurb and a link (keep header in case it has been hot linked) - Add link to URL signing key details to resumable upload > signed url section - Add signed URL details to standard upload page, and similarly link to url signing key page - Update link in URL signing key page of dashboard to point to new dedicated URL Signing key page ## Additional context Follow up to: https://github.com/supabase/supabase/pull/52522 --------- Co-authored-by: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> |
||
|
|
1decd82fcc |
feat(studio): gate edge functions and vector bucket api-keys consumers on grants (#52962)
Part 2 of 6 in a stack for [FE-4731](https://linear.app/supabase/issue/FE-4731/grants-rollout-api-keys-consumers-that-only-need-publishable-keys). Based on #52961. ## Stack 1. #52961 Docs and project API docs consumers 2. 👉 #52962 Edge functions and vector bucket examples 3. #52963 Integrations landing data 4. #52964 Connect sheet and project connection popover; remove the transitional api-keys hooks 5. #52965 `reveal` refinement for single api-key reads; API key pill 6. #52966 API key create and delete ## Changes Moves more publishable-key consumers onto the plain `GET /v1/projects/{ref}/api-keys` grant: - `Functions/TerminalInstructions` - `Functions/EdgeFunctionDetails`: only the `api_gateway_keys_read` check; the `edge_functions_write` check belongs to the edge functions rollout - `Storage/VectorBuckets/.../VectorBucketTableExamplesSheet`: still uses non-revealed keys. When keys can't be read, the note tells the user to substitute their own secret key. Each shows `ApiKeysAccessNote` when denied or errored. The old guards matched the annotation. ## Testing - `TerminalInstructions.platform.test.tsx`, `EdgeFunctionDetails.platform.test.tsx`, `VectorBucketTableExamplesSheet.platform.test.tsx`: granted, denied (no api-keys request), and permission-check error. 🤖 Generated with [Claude Code](https://claude.com/claude-code) |
||
|
|
b3dd6612d7 |
feat(studio): classify errors with fault, reason, and per-tag Sentry sampling (#52730)
Follows #52707 (rename `ResponseError` to `StudioError`). Resolves FE-4772. ## What Introduces the error core for Studio error classification. - **Tagged errors.** `lib/errors/studio-errors.ts` defines `Data.TaggedError` classes (`RequestAborted`, `NetworkUnreachable`, `MalformedResponse`, `PlatformError`, `UnclassifiedApiError`, `DbConnectionTimeout`, `UnexpectedError`). Each carries `fault`, `reason`, `classifiedBy` (`rule` or `default`), `retryable`, and `service`. `StudioError` is the union type; use `isStudioError` instead of `instanceof`. - **Two classifiers** in `data/error-classification.ts`: - `classifyResponseError` is only for errors from an API response: known message patterns first, then defaults by status (5xx `PlatformError`, 4xx `UnclassifiedApiError`, no status `UnexpectedError`). - `classifyError` is for everything else: aborts, browser fetch failures (matched by message, so ordinary `TypeError` bugs stay `UnexpectedError`), and unexpected errors. - `handleError` picks between them, reports, and rethrows the same instance so React Query receives the classified error. - **Routing and sampling.** `lib/errors/error-routing.ts` maps every tag to a Sentry sample rate (`SAMPLE_NEVER`, `SAMPLE_OTHER`, `SAMPLE_OWNED`, `SAMPLE_ALWAYS`). `reportStudioError` tags events with `sample_rate`, and `beforeSend` applies it. `alwaysCapture` reports at rate 1. The global Sentry error `sampleRate` stays unset so the rates don't multiply. - **Network failures.** A fetch failure is a `user` fault with reason `offline` when the browser reports being offline, and a `platform` fault otherwise. - **Hand-built errors.** Call sites that wrapped caught exceptions or made up status codes now use `classifyError` or a specific class instead of `classifyResponseError`. ## Behavior changes - Errors that previously went unreported, including unexpected errors with a message, are now reported to Sentry at their routed sample rate. - `handleError` no longer logs the stack with `console.error`. - `MalformedResponse` is defined but not produced yet; a follow-up adds the empty-body check. ## Testing - Unit tests for classification, routing, reporting, and the `beforeSend` sampling helper. - `pnpm vitest run data lib components/interfaces/ErrorHandling`, typecheck, lint ratchet, and knip pass locally. |
||
|
|
bef73a722c |
feat(studio): gate storage, cron, and realtime key consumers on grants (#52728)
Part 4 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 #52727. ## 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. 👉 Storage, cron, and Realtime consumers; remove the transitional reveal path ## Changes Moves the remaining consumers that need secret keys onto the `reveal` grant with `revealedApiKeysQueryOptions`, replacing their V2 permission checks: - Analytics bucket configuration details and the update catalog token dialog - The Iceberg wrapper create mutation. Its V2 check only covered `api_gateway_keys_secret_read`, which didn't match the endpoint's requirement. Without keys it used to save a placeholder as the vault token; it now throws unless the grant is granted, and returns the grant so callers can explain why. The bucket create form disables Create and the missing-wrapper callout disables "Install wrapper", both showing `ApiKeysAccessNote`. The `storage_config_write` check is unchanged. - Cron job HTTP headers (edge function variant) `RealtimeTokensPopover` only reads the anon and publishable keys, so it moves to the plain grant and `apiKeysQueryOptions` instead of requesting revealed keys. With no `reveal: true` callers left, the transitional `useAPIKeysQuery` / `useAPIKeys` hooks drop their reveal path and only mint a plain grant. They remain for the publishable-only consumers until FE-4731. ## Testing - `iceberg-wrapper-create-mutation.platform.test.tsx`: `mutateAsync` throws without the reveal grant and makes no credentials request; the granted case exposes the grant. - `BucketCallouts.platform.test.tsx`: "Install wrapper" is enabled when granted, and disabled with the note when denied or with an error when the permission check fails. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
706dba62f9 |
fix(studio): attribute storage policies to every bucket they reference (#52692)
## Problem
Studio's storage policy parser (\`extractBucketNameFromDefinition\`)
returned only the first quoted string near \`bucket_id\` and ignored the
operator. As a result:
- Policies covering several buckets (\`bucket_id in ('a', 'b')\`) were
listed and counted under the first bucket only.
- Negated policies (\`bucket_id <> 'a'\`) were attributed to the
excluded bucket.
- \`DeleteBucketModal\` could delete a negated or shared policy that
still protects other buckets.
Fixes FE-3993, supabase/supabase#48164.
Before:
<img width="884" height="444" alt="Screenshot 2026-11-03 at 10 46 08"
src="https://github.com/user-attachments/assets/fc6e4842-b07f-40be-8057-b94f4034e4eb"
/>
After (same data):
<img width="891" height="515" alt="Screenshot 2026-11-03 at 10 46 21"
src="https://github.com/user-attachments/assets/47248b30-a309-4774-8349-05260ad02111"
/>
## Solution
- Replace the parser with \`extractBucketNamesFromDefinition\`, which
returns every bucket referenced via \`=\`, \`= ANY (ARRAY[...])\` and
\`OR\`, and returns none for negated conditions (those fall into
Ungrouped).
- Add \`getPolicyBucketNames\`, which combines \`definition\` and
\`check\`, and use it in the Policies page grouping,
\`useBucketPolicyCount\`, and \`DeleteBucketModal\` so they agree.
- A policy is now listed under each bucket it covers.
- Bucket deletion only removes policies whose sole target is the deleted
bucket. Shared and negated policies are left in place. This is the
conservative choice: an unparsed policy is left behind, never deleted.
- Added unit tests for the parser shapes, negation, \`check\`-only
policies, and grouping.
|
||
|
|
07dbe3ce1d |
fix(studio): use raw object count as storage pagination offset (#52706)
## Problem Studio Storage hides `.emptyFolderPlaceholder` objects after listing a folder, but `fetchMoreFolderContents` calculated the next page offset from the number of visible items. When a page includes the placeholder, the API returns 200 objects but Studio keeps 199, so the next request uses offset 199 instead of 200 and the last file of the previous page appears twice. The duplicates compound with every further page. Fixes FE-4843. Closes #52607. Before: <img width="521" height="458" alt="Screenshot 2026-11-03 at 14 51 09" src="https://github.com/user-attachments/assets/1ed20ded-08c6-4c56-92d7-5c97ef82cd00" /> After: <img width="532" height="460" alt="Screenshot 2026-11-03 at 14 53 58" src="https://github.com/user-attachments/assets/64891f27-7fa0-44cb-8076-39b405df0ee4" /> ## Solution Each storage column now records `hiddenItemsCount`, the number of API objects hidden from the visible list (the placeholder). `fetchMoreFolderContents` offsets the next page by `items.length + hiddenItemsCount`. Because the offset is still derived from `items.length`, local edits to a column (creating a folder, uploads, deletes, renames) keep it in step with the server, as they did before. Added tests to `state/storage-explorer.test.ts`: a folder with a placeholder plus 300 files lists each file exactly once and requests offsets 0 and 200, and a folder without a placeholder still pages at 0, 200, 400. Reverting the offset line makes the placeholder test fail. ## Review instructions 1. In a bucket, create a `docs` folder and, using the Storage API, upload a zero-byte `docs/.emptyFolderPlaceholder` plus files `file-000.txt` through `file-299.txt`. 2. Open `docs` in Studio and sort by Name ascending. 3. Scroll to load further pages and check the list requests in the network tab: offsets should be 0 and 200, and no file should appear twice. 4. Run `pnpm --filter studio exec vitest run state/storage-explorer.test.ts`. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill (not applicable) |
||
|
|
df742bdb3b |
refactor(studio): rename ResponseError to StudioError (#52707)
## What
Moves the `ResponseError` class (`types/base.ts`) and the classified
error classes (`types/api-errors.ts`) into
`lib/errors/studio-errors.ts`, and renames `ResponseError` to
`StudioError`.
## Why
Studio's error classification is being expanded to cover errors that
don't come from API responses (thrown network failures, aborted
requests, unexpected client errors). The API-specific name and location
no longer fit. Landing the rename on its own keeps the follow-up PR,
which introduces the classified error model, small and reviewable.
## Notes for reviewers
- Mechanical change, no behavior change. Most of the diff is a one-line
import change per file plus import re-sorting by Prettier.
- Files that only use the type now use `import type { StudioError }`.
- `ResponseError` is no longer re-exported from `@/types`; there are no
compatibility shims at the old paths.
- Unrelated identifiers like `QueryResponseError` and
`parseResponseErrors` are unchanged.
|
||
|
|
da454314b1 |
fix(studio): select the full folder name when renaming in Storage (#52594)
## Problem Renaming a Storage folder such as `photos.backup` selects only `photos`, leaving `.backup` behind when the user types a replacement name. Fixes https://github.com/supabase/supabase/issues/52593 ## Solution Apply extension-aware text selection only to files. Select the entire name for folders. Add regression tests for dotted folder names, ordinary folder names, and files with extensions. All three tests pass with the fix; the dotted-folder case fails before it. ## Review instructions 1. Create a folder named `photos.backup` in a test Storage bucket. 2. Select Rename and confirm the entire name is selected. 3. Type `archive` and confirm no `.backup` suffix remains. 4. Rename a file named `photo.png` and confirm only `photo` is selected. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) |
||
|
|
cd0b65c03e | feat(logs): Add Pipelines to unified logs and rename ETL to Pipelines (#52555) | ||
|
|
552312507f |
fix(studio): storage policy footer (#52531)
## Problem Footer is hidden when reviewing a policy for storage. ## Solution The footer is now fixed and sticks so that the user can see the buttons at all times: <img width="1152" height="712" alt="Screenshot 2026-10-29 at 20 07 32" src="https://github.com/user-attachments/assets/87e97afd-fb33-4e63-a67d-fb9861449a20" /> Closes #52520 ## 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) |
||
|
|
84115482be |
feat(studio): storage lifecycle policies UI (#52318)
## Problem Lifecycle policies can only be set with an abstracted ui that hides the actual underlying policies but the user can still modify the policies via api, which would result in an un-documented drift from the policies set via said abstracted ui. ## Solution Show ui with list of effective policies applied and show if the policies drifted in a way that is incompatible with the abstracted ui in the "Create/Edit bucket modal". <img width="1489" height="800" alt="Screenshot 2026-10-26 at 18 35 39" src="https://github.com/user-attachments/assets/9e64f123-c06e-4cfe-9dba-839fae61c845" /> <img width="1439" height="847" alt="Screenshot 2026-10-26 at 18 35 50" src="https://github.com/user-attachments/assets/a32d3a27-6719-48b3-abd2-fb134158bd96" /> <img width="654" height="316" alt="Screenshot 2026-10-26 at 18 36 38" src="https://github.com/user-attachments/assets/0710c139-9b64-42f7-b410-c1a351b1f616" /> This PR also updates copywriting around the effects procured by the lifecycle policies settings in the bucket settings modal. <img width="704" height="440" alt="Screenshot 2026-10-26 at 18 35 17" src="https://github.com/user-attachments/assets/f4fa03d1-e11b-4d08-b4f5-d94b2d9350a3" /> <img width="351" height="82" alt="Screenshot 2026-10-26 at 18 35 28" src="https://github.com/user-attachments/assets/6ff1e149-92e0-4fd8-bfb5-0177afe207aa" /> ## To review - create a file storage bucket, enable object versioning and set some lifecycle policy values - once created, go to /project/_/storage/files/policies and find the bucket policies or navigate to it from the "Edit bucket settings" via the "View rules" button <img width="1133" height="725" alt="Screenshot 2026-10-27 at 14 50 52" src="https://github.com/user-attachments/assets/ef014f7a-5db6-413a-af53-a5648309b2c3" /> - adding extra policies should result in a "This bucket has a custom lifecycle policy" message in the edit bucket modal <img width="557" height="130" alt="Screenshot 2026-10-27 at 14 52 23" src="https://github.com/user-attachments/assets/cde29748-65d9-45b5-a54b-55737d78d311" /> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> |
||
|
|
d98c277790 |
feat(studio): rotate Storage URL signing keys FE-4433 (#52165)
## Problem Rotating a project's Storage URL signing key currently needs a support ticket, so customers can't rotate on their own timeline or keep a standby key until their signed URLs have migrated. Linear: [FE-4433](https://linear.app/supabase/issue/FE-4433/allow-users-to-rotate-storage-url-signing-keys-via-ui) ## Solution Adds a URL signing keys page at `/project/{ref}/storage/signing-keys`, linked from the Storage menu. It builds on the design prototype from `feat/storage-rotate-signing-keys` and follows the current JWT Keys page styling. - Active key, standby key, and revoked keys are shown in separate tables, so there is only ever one active key. The UI allows one standby key at a time. - Create a standby key (ES256 by default, HS512 optional), rotate the standby key to active, revoke a standby key, or move a revoked key back to standby. - The key list reports JWK types (`EC`, `oct`), which are mapped to ES256 and HS512 labels. Unrecognized types fall back to the raw value. - Telemetry: `storage_url_signing_key_created` and `storage_url_signing_key_updated` (with a `change` property), fired when the action succeeds. - A "Created at" column is not included yet because the keys endpoint doesn't return it. It will follow in a later PR. <img width="1272" height="846" alt="Screenshot 2026-10-23 at 11 43 45" src="https://github.com/user-attachments/assets/980742ed-6c4e-43d1-b170-847e550fde4c" /> ## Review instructions 1. Open the preview and go to Storage > URL signing keys on a project. 2. Create a standby key, then rotate it to active. The previous active key should move to standby. 3. Revoke the standby key (type its ID to confirm), then move it back to standby from the revoked table. 4. Compare the table styling with Project Settings > JWT Keys. 5. Check that creating a standby key and moving a revoked key to standby are disabled while a standby key exists. ## 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: Francesco Sansalvadore <f.sansalvadore@gmail.com> |
||
|
|
254e24b170 |
feat(studio): require grants in fetch wrappers for FGA-annotated endpoints (#52238)
## Problem Resolves FE-4689 and FE-4690. Builds on #52105. Studio's fetch wrappers don't know which FGA permissions an endpoint requires, so a UI guard and the request it protects can drift apart. This makes the `grant` minted by `useGrant`/`getGrant`/`ensureGrant` part of the request itself: calling an annotated endpoint without a matching grant is a compile error. ## Solution ### What changed - **Fetch wrappers** (`data/fetchers.ts`, `data/guarded-fetch.ts`): `get`/`post`/`put`/`patch`/`del` keep their names, so no imports change. - The `grant` option is required for endpoints annotated with `x-fga-permissions`, and forbidden for unannotated ones. - It accepts a `Grant` for that exact endpoint (or one of its variants) or `unguarded`. - The wrapper strips the grant before calling openapi-fetch. - `head`/`trace`/`options` are unchanged. - **Owned params**: refinements can declare query params the wrapper sets from the grant's variant (`ownedQuery`). These params are removed from the init type (`Omit<Query, Owned> & { [K in Owned]?: never }`), so callers can't pass them. Nothing uses this yet: the api-keys `reveal` variant is the first. - **`assertGrant`** runs in development only and throws `GrantAssertionError`. It checks: - the endpoint; - a missing grant; - the variant against `when(init)` predicates; - the path `ref` against the grant's project, also accepting the parent project ref for a grant minted on a branch; - the path `slug` against the grant's organization. - **Escape hatches**: - `unguarded.migrating` for unmigrated call sites. - `unguarded.byDesign('reason')` for calls that intentionally skip the check. - **Grants** now record `permissionsProjectRef`, the ref permissions were evaluated against. It's required once the scope is resolved. - **Readable errors**: a missing or wrong grant reports the caller's own init type plus the expected `grant` type, instead of openapi-fetch's full options type. Under `noErrorTruncation`, the old message was tens of KB per call site. - **`executeSql`** now requires a grant for `POST /platform/pg-meta/{ref}/query`, so every caller counts as unmigrated. - **Codemod**: added `grant: unguarded.migrating` at every existing call site that hits an annotated endpoint, including all `executeSql` callers. No behavior change. A follow-up lint rule ratchets the count down. - **Dependencies**: adds `openapi-typescript-helpers` (the version openapi-fetch already uses) for the helper types. Only openapi-fetch's unexported `InitParam` is copied locally. ### Type-level notes - The grant is checked in the parameter type rather than in `Init`'s constraint. That way `Init` is still inferred from the argument, which keeps both the return type and the error message tied to the caller's code. - The grant is replaced rather than intersected. Intersecting a wrong grant with the expected one can reduce the init type to `never`, which then accepts the call. - `NoInfer<Path>` stops a grant's endpoint from becoming an inference candidate for the path. ## Review instructions ### Tests - `data/guarded-fetch.test.ts`: - Type equality with the raw client: required params and body, template-literal paths, `parseAs`, `signal`/`headers`, optional-init endpoints, and `unguarded`. An openapi-fetch upgrade that breaks the local `InitParam` copy fails typecheck. - Negative type cases: - a missing or `undefined` grant; - a missing init on an annotated endpoint; - a grant for a different path or method; - any grant or `unguarded` on an unannotated endpoint; - a forged grant; - params and body still checked; - an unknown path. - `guardMethod` and `assertGrant` runtime behavior, including branch-parent refs and org slugs. - Variant and owned-param tests are deferred to the api-keys (`reveal`) and pg-meta (`read`/`write`) PRs, since no refinements exist yet. 1. Run `pnpm typecheck` and confirm Studio passes. Then remove a `grant: unguarded.migrating` and check that the error is short and names the expected grant. 2. Run `pnpm test:studio`. 3. Skim the codemod commit: it only adds `grant: unguarded.migrating` and the `unguarded` import. ## Checklist Check all before review: - [ ] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
60b51d74d5 |
Audit existing unit tests + Remove redundant ones (#52215)
## Context
_TLDR: Changes here speeds up unit tests on CI from ~14 minutes to ~3
minutes_ 😂
_TLDR 2: The file changes are solely only test files +
`studio-unit-tests.yml`_
We've currently got a lot of unit tests in the repository which while
great for coverage, hasn't been ideally written. There's a lot of
redundancy + overly specific tests that break easily, and our current
unit test takes about 15 minutes to run in the GHA per PR. Hence am
doing a audit clean up of all existing unit tests in the studio repo.
## Changes involved
- `.test.ts` files now run in `node`, `.test.tsx` in `jsdom`
- jsdom costs about 1s of setup per file. A `.ts` test that needs the
DOM opts in with `// @vitest-environment jsdom` (46 files do).
- Removed redundant and over-specific tests
- Duplicates are merged into `test.each`. Tests that only covered
libraries, existed for coverage, or asserted class names and snapshots
are deleted. 19 files are merged into a sibling or deleted.
- Fixed about 15 tests that couldn't fail
- Examples: unawaited assertions, fixtures equal to the default, and a
`semverGte` test calling `semverLte`.
- Sped up the slowest files
- Real sleeps are replaced with fake timers, `user.type` with paste, and
Radix option queries are scoped to the open listbox. For example,
`RestoringState` went from 18s to 0.3s and
`useTableEditorFiltersSort.navigation` from 20s to 3s.
- These ^ already shave down the unit tests time from 14 mins to 9 mins,
but am also sharding unit tests across 4 jobs to increase speed up
further which then shaves down time to 3 mins now
|
||
|
|
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> |
||
|
|
3f8bbd5a00 |
(fix): Storage preview file names from search results (#51914)
## Problem deeply nested files from bucket root search results dislay their path instead of their basename: <img width="816" height="432" alt="image" src="https://github.com/user-attachments/assets/3af89584-a96f-4dcb-b8fd-e02d26eb7640" /> ## Solution Use the file base name instead: <img width="820" height="434" alt="image" src="https://github.com/user-attachments/assets/590a39aa-d8d4-459b-9b56-8516b3f34571" /> |
||
|
|
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" /> |
||
|
|
cb4307f15b |
feat(studio): storage versioning - archived UI (#51476)
## This PR Adds **Show archived** to the file explorer's view options and list them in the file explorer. - `useStoragePreference` — `showArchivedInline`, stored per project - `ArchivedFilesContext` — owns the archived list and which object is selected - `FileExplorer` — merges archived rows into each column and re-sorts, since the server-side sort never sees them - `FileExplorerRow` — dimmed striped rendering, no checkbox, no context menu - `FileExplorerHeader` — the toggle, rendered only behind the feature preview - `StorageExplorer` — mounts the provider https://github.com/user-attachments/assets/a26551b4-b22d-485e-9d23-3e78c4a89315 Clicking an archived row opens a preview panel: where the file used to live, when it was archived, its retained versions, and the actions to bring it back or delete it permanently. - `ArchivedFilePreviewPane` — the pane, replacing `PreviewPane` while an archived row is selected - `ArchivedVersionRestoreWidget` — takes over the top of the pane when a specific retained version is selected - `ArchivedVersionRow` — one version, with its restore / delete actions - `StorageExplorerContent` — the pane swap https://github.com/user-attachments/assets/03c9eae6-e9e3-4bd0-8145-953625e125d1 Other additions behind the feature preview: - The buckets list show a **Versioning** column. - `BucketVersioningPill` — a `file-stack` badge beside the bucket name in the breadcrumbs, brand when versioning is enabled and warning when it is suspended, so the bucket's state is visible from inside the explorer rather than only from the buckets list. https://github.com/user-attachments/assets/f4827aac-a9ff-4300-92ac-073848d63606 --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> |
||
|
|
876bb8cf9e |
feat(storage): archived objects data layer (#49677)
## This PR On a versioned bucket a file or a version can be "soft deleted/archived" or "permanently deleted". - `archived-objects-query.ts` — `ArchivedObject` / `ArchivedObjectVersion` types + `archivedObjectsQueryOptions` - `archived-object-restore-mutation.ts` — bring an archived object back into the live tree - `archived-object-purge-mutation.ts` — delete it and every version, permanently - `archived-object-version-delete-mutation.ts` — remove one retained version - `archivedOverlay.utils.ts` — synthesizes the explorer rows for one folder from the archived list - `archivedVersions.utils.ts` — an archived object's history as one flat, newest-first list --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> |
||
|
|
1b27761bec |
feat(storage): add version history to the file preview panel (FE-4163) (#49208)
## [5/10] Storage object versioning: version history in the file preview panel **Base:** `feat/storage-versioning/004-object-versions-data` #49207 ### This PR Adds all the versioning ui to the file preview panel. - polished file preview panel (header, buttons, nits) - added "Upload file" to the action buttons - "Delete permanently" now defaults to "Archive" as primary action, and "Delete permanently" via a dropdown menu as a more destructive action - added "Versions" toggle section to the file preview panel - with lifecycle policy "summary" - with additional explanation on hover - versions can be restored or deleted permanently ### How to test - in a File storage bucket, open a file preview panel - when the "Storage Versioning" feature preview flag is true, the preview panel should show - a "versions" section - a new "upload file" button next to the "download file" button - the "delete permanently" button should show "Archive" + a dropdown with the "Delete permanently" option - if the feature preview flag is toggled _off_, the preview panel should looks as before (but with some minor polish) https://github.com/user-attachments/assets/56f6b9aa-b3a0-45bd-b3e7-5788967d196a With the feature preview toggled _on_: - the ui should show the lifecycle policy "summary" that will affect this file - hovering the lifecycle policy summary should explain how the policy will affect/clean up the noncurrent files - the lifecycle policy summary hover card button should link and open the "edit bucket modal" - create a new version of a file by using the "Upload file" (next to "download file") - the file should have a new "Current" version - the previous version should become a "noncurrent" version - the noncurrent version should reflect the lifecycle policy that will eventually affect it with some additional context on hover via a tooltip - clicking on a noncurrent version should open a "comparison widget" that provides a way to restore it and re-promote it to "current" or delete it permanently - these actions are also available via dropdown menu from the version item - a file should be "archiveable" (please note that showing/managing archived files will come in the next pr in the stack) - confirmation modals should prompt to confirm to proceed to restoring or permanently deleting a noncurrent version https://github.com/user-attachments/assets/803a6f15-7f32-44ae-9e24-1c201aab178a --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> |
||
|
|
78dc739901 |
fix(studio): show support inline and honour AlertError layouts (#51377)
## Problem AlertError forces a vertical layout whenever additional actions are supplied, even when the caller explicitly requests horizontal or responsive layout. Stripe Sync Engine's uninstall error is one affected call site, the other was Pipelines as demoed in #51311. ## Solution Honour an explicit layout. Preserve the existing defaults: vertical with additional actions, responsive otherwise. Replace the standalone Contact support action with an InlineLink in the contact support prose, preserving support form context and breadcrumb capture. Keep custom actions such as Retry. If instructions are hidden or custom prose omits contact support, retain a separate inline support link. With `hideContactSupport`, show no support link and shorten the default instructions to “Try refreshing your browser.” Custom descriptions remain unchanged. The local Pipelines configuration error explicitly hides support. Add the explicit responsive layout at the Pipelines call site. | Before | After | | --- | --- | | <img width="914" height="426" alt="CleanShot 2026-10-07 at 17 51 20@2x" src="https://github.com/user-attachments/assets/6cbddfee-97f5-4a7a-bafa-7b5dfd6ab8bf" /> | <img width="916" height="422" alt="CleanShot 2026-10-07 at 18 26 06@2x" src="https://github.com/user-attachments/assets/a21952a6-1c1a-437c-af73-c5736f33fd98" /> | | <img width="1566" height="384" alt="CleanShot 2026-10-07 at 18 28 07@2x" src="https://github.com/user-attachments/assets/bdc2a043-421f-4c22-9bd3-37859c6e85c7" /> | <img width="1568" height="308" alt="CleanShot 2026-10-07 at 18 26 58@2x" src="https://github.com/user-attachments/assets/da0f2c6a-6254-4196-944b-5665e87b3c3c" /> | ## Review instructions 1. In a fresh local test project with no existing `stripe` schema, run this in SQL Editor: ```sql begin; create schema stripe; comment on schema stripe is '{"status":"uninstall error","errorMessage":"Local layout test: uninstallation failed"}'; commit; ``` 2. Open **Integrations → Stripe Sync Engine → Overview** and reload. Check **Failed to uninstall Stripe Sync Engine** at wide and narrow widths, including **Retry uninstallation** and the inline **contact support** link. Do not click Retry: it invokes the real uninstall operation. 3. Remove the empty fixture with `drop schema stripe restrict;`. 4. Block the Pipelines source-status request and resize the page: Retry uses the responsive layout. 5. AlertError callers without an explicit layout should retain their existing presentation. Confirm default and custom contact support prose use an inline link, with no standalone support action. Hidden instructions and custom prose without contact support retain an inline fallback. With `hideContactSupport`, the default prose is “Try refreshing your browser.” and no support link appears; custom descriptions remain unchanged. 6. Automated regression coverage checks that an explicit responsive layout survives additional actions, and that hiding support removes the default support wording while preserving custom descriptions. --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> |
||
|
|
2d0bd7af69 |
feat(storage): add object versions data layer (#49207)
| # | 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 | ## [4/10] Storage object versioning: object versions data layer **Base:** `feat/storage-versioning/003-bucket-modals` (PR 3) ### This PR The query and mutation hooks for the version history UI, written to `queryOptions` using the real Storage endpoints. - `object-versions-query.ts` — the version list, plus `ObjectVersion` and `LifecyclePolicy` - `object-version-restore-mutation.ts` — promote a noncurrent version to current - `object-version-delete-mutation.ts` — remove one specific version - `object-purge-mutation.ts` — delete an object and every version, bypassing versioning - `VersionHistory.utils.ts` — `computeVersionFate`, the pure rule deciding what removal outlook each version row shows - `BroomSparklesIcon.tsx` — inline SVG for a glyph absent from lucide-react 0.436 Easier to test directly from next PR in the stack #49208 which wires the queries to the real file preview panel ui. --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> |
||
|
|
6ef729cb5c |
feat(storage): versioning bucket modals (FE-4161) (#49205)
| # | 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 | ## [3/10] Storage object versioning: wire into the bucket modals **Base:** `feat/storage-versioning/002-bucket-form-fields` (PR 2) ### This PR Mounts the object-versioning form section in the create and edit bucket modals behind the feature preview, and saves it. - create and edit bucket modals spread `bucketVersioningFormFields` into their existing form schema - lifecycle defaults to 30 days / 10 versions - edit adds a confirmation before suspending an actively versioned bucket ## Enabling object versioning on a new bucket and setting lifecycle policies https://github.com/user-attachments/assets/194f8319-4929-432e-8a50-206f180a77a8 ## Edit and suspend object-versioning https://github.com/user-attachments/assets/f31e1d34-9840-4f5a-a269-6a911214742d ## To reproduce 1. Make sure storage versioning is enabled under feature previews > Storage Versioning 2. Open Storage Bucket File explorer 3. create new bucket and enable Object Versioning 4. set lifecycle policy - Noncurrent version expiration: can be either empty or >1 - Retained noncurrent versions: can be either empty or between 1 and 100 and can't exist without "Noncurrent version expiration" 5. Open new bucket with object versioning and test changing lifecycle policies 6. Disabling object-versioning shows proper warning and updates `versioning_status` to SUSPENDED (it can never go back to DISABLED once it has been enabled on a bucket) --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com> |
||
|
|
9d1661dec1 |
chore: Reorganize the Files buckets code (#51350)
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
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> |
||
|
|
838fcaaa89 |
Joshenlim/fe 4509 fdw general UI consolidation and refactor (#51079)
## Context Stacks on top of https://github.com/supabase/supabase/pull/51074 PR's just mainly refactoring, no visual differences: - `CreateWrapperSheet` + `EditWrapperSheet` use the same UI components for the foreign tables section - Can be consolidated into one reusable component - `WrapperTableEditor` is still using `SidePanel` component - Can be swapped to use new `Sheet` component - Refactor `WrapperTableEditor`'s layout a little - added separators for clarity between sections <img width="400" alt="image" src="https://github.com/user-attachments/assets/b1983bf2-cff5-43eb-8b31-40a7abb65038" /> - Update `getCreateFDWSql` to just use the Foreign Data Wrapper's name from `wrapperMeta` since its now standardized <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a shared foreign-table selector for wrapper setup and editing, with options to view columns, add or edit table definitions, and remove tables. * Updated the table editor to use a sheet layout with a fixed footer. * **Bug Fixes** * Wrapper creation now uses the wrapper’s configured name when creating the server. * Foreign-table targets display the table name when other target details are unavailable. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
521881a899 |
Joshenlim/fe 4480 fdw create wrapper to only init fdw once users to name the (#51074)
## Context PR here refactors the way we manage Foreign Data Wrappers in the dashboard (Under Project -> Integrations), as there's some DX problems with the current behaviour. Currently whenever a user creates a new wrapper, the dashboard is creating both the Foreign Data Wrapper (`create foreign data wrapper...`) + server (`create server ...`). The former is **_redundant_** to create multiples of given that it just handles the `handler` and `validator`, whereas what matters more is the server which holds the connection credentials. Hence standard practice is usually one Foreign Data Wrapper with multiple servers. (The former just needs to be created once if not done yet) This also led to some problems as well when users created their own wrappers via SQL and tried to manage them through the dashboard GUI, leading to us having to add some guard rails to prevent managing wrappers sharing the same Foreign Data Wrapper ([ref](https://github.com/supabase/supabase/pull/50785)) ## Changes involved - When creating a wrapper, if the Foreign Data Wrapper has yet to be set up for the wrapper type, the dashboard will initialize one and subsequently use that same Foreign Data Wrapper for any new wrappers - When creating / editing a wrapper, users will name the **server** instead of the **wrapper** <img width="500" alt="image" src="https://github.com/user-attachments/assets/b3e61204-0e16-4599-84ac-af2aab5b93c2" /> - When deleting a wrapper, the clean up for vault secrets are now deterministic by referencing the wrapper's server options - RE backwards compatibility: Existing wrappers will _not_ be affected by the changes here - they can be edited / deleted as per normal ## Unrelated fixes + UI refactors added - Fix Iceberg Wrapper not showing the right form when adding new wrapper - Adjust form layouts in side panel to be horizontal instead of vertical (Follows Database -> Pipelines) - Clean up to use newer UI components like `ButtonTooltip` - Opt to hide Docs + Create CTA under `WrappersTab` if marketplace feature preview is enabled (Since these actions are already in the header, will be duplicates) - Consolidate foreign tables configuration for create + edit wrapper sheet into one component `ForeignTablesSelector` ## To test - [ ] Verify that existing wrappers with their own Foreign Data Wrapper can be edited correctly - [ ] Verify that existing wrappers with their own Foreign Data Wrapper can be deleted - [ ] Verify that existing wrappers with shared Foreign Data Wrapper can be edited correctly - [ ] Verify that existing wrappers with shared Foreign Data Wrapper can be deleted - [ ] Verify that new wrappers can be created - [ ] Verify that newly created wrappers can be edited correctly - [ ] Verify that newly created wrappers can be deleted |
||
|
|
5de3666930 |
Fix: storage explorer ignore current filter after mutations (#51174)
## Problem When users trigger actions such as deleting an item, the storage explorer reloads the opened folders but ignore the currently applied filter. ## Solution Move the filter state in Valtio so that its other functions are aware of it. ## Review instructions 1. Create a Supabase project and upload objects in Storage with date prefixes (e.g., 202608XX) 2. Navigate to Storage, select a bucket with multi-dated/prefixed objects 3. Enter a filter in the search box (e.g., 20260820) to show only matching objects 4. Select one or more filtered objects and delete them Observe the file list after deletion - it should show filtered contents according to the search box value <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Storage search now stays in sync as you open folders and refresh their contents. * When restoring open folders, search results are filtered in the deepest open folder rather than hiding ancestor folders. * Deleting a file from filtered results keeps the search applied and displays the remaining matches correctly. * Search results remain consistent across folder navigation, refreshes, and file deletion. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
92952bf903 |
fix(studio): clarify S3 access key dialogs (#51070)
## Problem The S3 access key creation dialogs are wider than their contents, use plural titles for one key pair, and call the name field “Description” even though the table calls it “Name”. The save state also implies both values disappear, although only the secret does. ## Solution Use the small dialog size for both states. Use singular titles, label the field “Name”, shorten the create button to “Create”, and clarify when the secret must be copied. The API field remains `description`. ## Review instructions 1. Open a project’s **Storage > S3** page and select **New access key**. Check the dialog width, title, Name field, and Create button. 2. Create a key and check the save dialog width, singular title, and secret visibility guidance. | Before | After | | --- | --- | | <img width="1084" height="572" alt="CleanShot 2026-09-30 at 14 37 20@2x" src="https://github.com/user-attachments/assets/781706ee-0ecc-4535-abb5-f6ac65f02c71" /> | <img width="844" height="584" alt="CleanShot 2026-09-30 at 14 36 56@2x" src="https://github.com/user-attachments/assets/119df19f-2f39-4e23-94b4-26665583765c" /> | | <img width="1096" height="730" alt="CleanShot 2026-09-30 at 14 37 57@2x" src="https://github.com/user-attachments/assets/00481ed7-dc05-48b9-8cbc-e76d608aa4b1" /> | <img width="842" height="780" alt="CleanShot 2026-09-30 at 14 37 39@2x" src="https://github.com/user-attachments/assets/8c837101-250a-474f-a0fc-cf46ce491f83" /> | <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Updates** * The credential form now labels the field “Name” and uses “Create” for the submit button. * Confirmation text now clarifies that the access key is bucket-wide, bypasses RLS, and its secret is shown only once. It also refers to a single access key instead of using S3-specific wording. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |