Commit Graph
17 Commits
Author SHA1 Message Date
Danny White 59cddd41a9 feat(studio): group database access settings (#54350)
> [!WARNING]
> This PR relies on #54282 being merged first.

## Problem

Database password and token access appear as separate sections in
Database Settings, although both control connections to Postgres.

## Solution

Group the existing controls under **Database access**, with **Password
access** first and the switch beside **Token access**. Nest **Members**
inside the Token access card and label its action **Add member**.
Preserve the existing feature gates, permissions, toggle behaviour,
dialogs and section anchors. Use shared card headings for Members,
centre the token switch beside its description, and darken the Members
table header. Update the matching token-access and password-reset docs
instructions.

```text
Database access
├── Password access
└── Token access                 [switch]
    └── Members                  [Add member]
```

| After |
| --- |
| <img width="735" height="818" alt="CleanShot 2026-12-01 at 15 56 50"
src="https://github.com/user-attachments/assets/f1207a2f-80d5-480a-9529-e110b960f427"
/> |
| _App [token] access coming separately in
https://github.com/supabase/supabase/pull/53917._ |

## Review instructions

1. Open a project's **Database → Settings** page. Check that **Database
access** contains **Password access** first, with the existing **Reset
database password** button.
2. With the database token access preview enabled, check that **Token
access** has its switch on the same row and **Members** appears inside
the same card when enabled. Check that **Add member** opens the existing
access rule sheet.
3. Check the existing enable confirmation and password reset dialog.
Projects requiring SSL enforcement or a Postgres upgrade should keep
their existing notices and actions.
2026-12-02 00:03:43 +00:00
Maksym Ionutsa d1c9d05335 fix(studio): correct PITR scheduled backups copy (#50861)
with PITR enabled scheduled backups copy states incorrect information
that might (and already have) confuse the customers

The backups are still taken and the WAL is archived. 

There's just no point exposing regular backups when the customer is
paying for a pretty expensive add-on, might as well point them at it
2026-11-27 16:07:04 +01:00
Joshen Lim 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 🙏
2026-11-26 21:28:17 +07:00
Joshen Lim f5ac51d4c6 Joshenlim/fe 5168 refactor pagelayout for advisor database (#53718)
## Context

Just some housekeeping to move off old layout components - this PR
targets the database + advisor pages, specifically

Advisor -> Settings (Rules), this is behind a feature preview
Database -> Tables
Database -> Publications

Just need to make sure that these pages still render fine
2026-11-23 12:43:10 +07:00
Joshen Lim c9a25cf11f Joshenlim/fe 5172 deprecate old table component (#53728)
## Context

More housekeeping - deprecates the old Table component in favor of the
Table component under `ui`

JFYI also realised as part of this that the following 2 routes are
unreachable from the dashboard and hence am opting to deprecate them
with a redirect
- /logs/explorer/recent
- /logs/explorer/saved

## Areas affected to check
- [ ] Integrations -> Webhooks
<img width="600" alt="image"
src="https://github.com/user-attachments/assets/58523cdb-6219-49be-9d2f-5bc26ae03d7f"
/>
- [ ] Database -> Column Privileges
<img width="600" alt="image"
src="https://github.com/user-attachments/assets/98bea654-24ac-4646-9c65-5bc4f18565e9"
/>
- [ ] Observability -> API  
<img width="600" alt="image"
src="https://github.com/user-attachments/assets/a6512c6f-bd04-4d25-8e3c-99c85883434a"
/>
- [ ] Observability -> Storage
  - Its a table under "Request caching" which I don't have data for 😅 🙏 
- [ ] Observability -> Database
<img width="600" alt="image"
src="https://github.com/user-attachments/assets/4f0ba203-64b3-41f7-971e-974e232bdedd"
/>
- [ ] Table Editor -> Project API Docs -> Column list
<img width="600" alt="image"
src="https://github.com/user-attachments/assets/6358e7a8-5770-46f9-a5a2-4851855ae97f"
/>
- [ ] Table Editor -> Project API Docs -> RPC parameters list
<img width="600" alt="image"
src="https://github.com/user-attachments/assets/5e45a1d6-cd29-451c-bf00-5d806ef37cec"
/>
2026-11-23 10:59:28 +07:00
Joshen Lim df6eafef7c Joshenlim/fe 5116 support editduplicatedelete tables from (#53662)
## Context

We previously introduced context menus to the table editor
[here](https://github.com/supabase/supabase/pull/53506), but prevented
edit, delete, and duplicate actions as those actions were coupled to the
router. Hence this PR decouples that by making those actions target a
table by a provided ID

"More options" action now also shows on every row, just visibly shown
only if its active or the user hovers over the row
<img width="335" height="183" alt="image"
src="https://github.com/user-attachments/assets/9897945d-37f4-4658-9420-29b948173208"
/>

## To test

Can test edit / delete / duplicate table on a table that you're not
currently actively on, via both context menu and dropdown menu
2026-11-20 10:19:00 +07:00
Riccardo Busetti 9437334289 feat(pipelines): Update docs and UI (#53665) 2026-11-19 11:27:04 +01:00
Alaister YoungandAlaister Young 7418124337 [FE-3106] (part 6) – refactor(studio): move project home and database page bodies (#53215)
Moves the project home, `/merge`, `/api` and all `/database/*` page
bodies into their route files and deletes the pages (FE-3106). Part 6 of
the stack.

**Depends on:** #53214

**Changed:**
- `routes/project/$ref/{index,merge,api/index}.tsx`,
`routes/project/$ref/database/**` – 26 page bodies inlined; redirects
use `<Navigate>`/`useNavigate` with typed params and `search`;
`next/link` → `Link`
- `database/pipelines/new` – same-origin header links navigate
client-side via `splitInternalUrl`, external ones via `href`, matching
the old shim
- `PipelineCreationPage.test.tsx` – renders the route with `renderRoute`

**Removed:**
- 26 page files, and `DatabaseTriggersLayout`/`PipelinesLayout`, which
only the deleted pages' `getLayout` used (the route shells already
inline them)

Addresses
[FE-3106](https://linear.app/supabase/issue/FE-3106/move-page-bodies-into-route-files-and-delete-pages).

## To test

- Click through Database (Tables, Functions, Triggers, Indexes, Roles,
Policies, Backups, Pipelines, Publications) – same layout, titles and
sidebar
- `/project/<ref>/database/triggers` – redirects to `triggers/data`
- `/project/<ref>/api` – redirects to the Data API docs, keeping the
query
- Create a pipeline and leave the wizard – unsaved-changes guard and
navigation behave as before

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-11-17 15:28:45 +09:00
Joshen LimandDanny White 51bd16d9ca Joshenlim/fe 5064 update database triggers to use new nav (#53356)
## Context

Update database triggers to use the new page components + add
deprecation notices to legacy components
There's no visual change here

---------

Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>
2026-11-16 10:51:14 +07:00
Charis 115a2ffeef feat(studio): gate database functions, triggers, and webhooks on sql grants (#53269)
Resolves FE-4744. Part of the grants rollout; builds on the read/write
SQL variants from #53185.

## What

- **Data layer:** the database functions, triggers, database webhooks,
and event triggers queries now take a `read` grant (exposed as
`queryOptions` factories). All 8 create/update/delete mutations take a
`write` grant and mark their SQL with `asWriteSql`.
- **Guards:** the hand-written FGA checks in the functions, triggers,
event triggers, and database webhooks lists, the functions page, the
triggers layout/route, and the webhooks integration tab now derive from
grants, with denied and error states.
- **Other consumers** updated to pass grants: `CreateFunction`,
`TriggerSheet`, `EditHookPanel`, `DeleteHookModal`,
`ChooseFunctionForm`, `FunctionSelector`, `AutoEnableRLSNotice`, and SQL
editor definition/autocomplete hooks.

## Behavior changes

- **Webhooks integration tab:** was gated on
`database_webhooks_config_read`; now gated on `database_read`, which is
what the backend checks for the pg-meta query it uses. Both permissions
are granted to the same built-in roles, so there is no change for
built-in roles. A permissions-load failure now shows an error alert
instead of the content.
- **`AutoEnableRLSNotice`:** hidden unless the user has read access,
since it can't tell whether the trigger already exists without it.

## Out of scope

- User-authored SQL execution in `QueryEditor` / `useSqlEditorExecution`
stays `unguarded.migrating` (FE-4750).

## Testing

- New tests: query factories and write mutations
(`data/database-sql-grants.test.ts`), webhooks tab granted/denied/error,
functions list read/write granted/denied/error.
- Typecheck, Prettier, lint ratchet, and Studio vitest suites for
affected areas pass.
2026-11-12 14:58:01 -05:00
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>
2026-10-21 06:54:16 -04:00
Danny White 4593b3ffc0 feat(studio): compose pipeline creation step navigation (#51776)
## Problem

The pipeline wizard in #49243 needs its merged components composed into
a full-page flow, with values preserved when moving backwards and
forwards.

## Solution

- Compose four full-page SteppedFlow steps behind **Pipeline creation
wizard**.
- Preserve values through step navigation and browser Back/Forward.
Refresh starts at Destination.
- Reuse Studio’s header controls and confirm before discarding changes.
- Defer step validation and creation; **Start pipeline** is disabled.
**Add pipeline** and preview-off visits keep the sheet.

| After |
| --- |
| <img width="1024" height="759" alt="New Pipeline Supabase"
src="https://github.com/user-attachments/assets/7c3c4511-9a00-4e64-a86a-d6d9489f7d75"
/> |
| _Only available by navigating to `database/pipelines/new` with the
feature preview on._ |

## Review instructions

1. Open the [Pipelines
preview](https://studio-staging-git-dnywh-featpipeline-stepped-n-ce5307-supabase.vercel.app/dashboard/project/_/database/pipelines),
select a test project and enable **Pipeline creation wizard**. Open the
[wizard
preview](https://studio-staging-git-dnywh-featpipeline-stepped-n-ce5307-supabase.vercel.app/dashboard/project/_/database/pipelines/new)
for that project. Check the full-page layout and header at desktop and
phone widths.
2. Enter connection details, select a publication and change
initial-sync and advanced settings. Use **Back/Continue**, browser
**Back/Forward**, and switch destinations to confirm values remain.
3. Check Review shows your settings, masks secrets and disables **Start
pipeline**. Refresh and confirm it restarts at Destination. Incomplete
steps are allowed in this navigation-only slice.
4. With changes, try header navigation or **Close**. Check **Keep
editing** preserves values and **Discard changes** leaves the flow. Turn
the preview off and confirm the wizard URL opens the sheet.
2026-10-16 11:09:21 +11:00
Danny WhiteandJoshen Lim 05a45dd1ed feat(studio): rename Replication to Pipelines (#50637)
## What kind of change does this PR introduce?

Feature and docs update.

## What is the current behavior?

The Dashboard lists Pipelines destinations under Database > Replication.
Read replicas have moved to Infrastructure, but the temporary notices
remain on the destinations page and new destination sheet.

Closes PIPE-1021.

## What is the new behavior?

The canonical Dashboard routes are Database > Pipelines, while legacy
Replication list and detail URLs permanently redirect to the equivalent
Pipelines routes. Navigation, command palette, shortcuts, pipeline
links, docs, and current marketing copy use Pipelines. Read-replica
notices and their obsolete dismissal state are removed.

| Before | After |
| --- | --- |
| <img width="1024" height="759" alt="Replication Database Agua Basket
Supabase"
src="https://github.com/user-attachments/assets/53f9f565-1ed1-43e9-a7d9-b66b2a47e948"
/> | <img width="1024" height="759" alt="2540"
src="https://github.com/user-attachments/assets/14ab2d61-d01c-483f-9d4f-0ac286dae159"
/> |

The Management API, pipeline behaviour, replication logs, and Postgres
replication terminology remain unchanged.

## To test

- Open `/project/<ref>/database/pipelines` and confirm the Database
navigation, page header, and pipeline breadcrumb say Pipelines.
- Open
`/project/<ref>/database/replication?source=bookmark#destinations` and a
legacy pipeline detail URL. Confirm each redirects to the matching
Pipelines URL while preserving parameters and fragments.
- From the Pipelines page, open Add destination. Confirm no read-replica
migration notice appears.
- Open the Pipelines guide and confirm its Dashboard steps lead to
Database > Pipelines.

## Before merge

- [ ] Get changelog entry reviewed
https://github.com/supabase/changelog/pull/262 and prepare to merge
simultaneously

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added dedicated **Database > Pipelines** pages for pipeline lists and
details.
- Added permanent redirects from legacy Replication URLs to their
corresponding Pipelines pages.
- Read replica management links now open **Settings > Infrastructure**.

- **Documentation**
- Updated Pipelines setup, monitoring, troubleshooting, and usage
guidance to reference the current dashboard locations.
  - Updated Realtime guidance to use **Database > Publications**.

- **Updates**
- Renamed dashboard navigation, breadcrumbs, commands, and keyboard
shortcuts from **Replication** to **Pipelines**.
  - Removed the “Read replicas have moved” notification.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-09-23 08:52:07 +10:00
edec85d1ca fix(pipelines): Make pipeline actions and status updates reliable (#50085)
## Summary

Make pipeline actions and status feedback reliable while requests are
running or fail. Let the backend coordinate table resets and restarts,
keep stopped pipelines stopped after resets or settings changes, and
refresh the UI from confirmed backend state.

## Pipeline actions and recovery

- Reset one table, all errored tables, or all tables through the
rollback endpoint without separate frontend stop/start requests. Explain
which destination data is deleted, which rows are copied again, initial
sync charges, and the skip-initial-sync setting.
- Keep pending feedback until the action and a fresh status read finish,
including across navigation and polling errors. Prevent overlapping
actions and disable start/stop controls when status is unavailable or
transitioning.
- Close the creation form once the pipeline is created. If its initial
start fails, users can retry Start on the existing pipeline without
creating a duplicate.
- Wait for confirmed shutdown before deletion; a shutdown error or
timeout leaves deletion retryable. Keep failed version updates open and
avoid reporting success.
- Clarify recovery guidance and pending labels, suppress duplicate error
toasts, and hide stale table errors during transitions.

## Status updates and shared UI

- Poll pipeline status and table metrics one second after each response,
share in-flight reads, pause dashboard polling in background tabs, and
respect rate-limit backoff. The shutdown waiter continues in the
background.
- Refresh metadata after mutations even when an older read is in flight,
while preserving shared polling requests. Refresh affected data after
failures that may follow a committed reset or settings change.
- Move pending request state into the shared, project-keyed
`DatabaseLayout` so the list, detail page, and diagram stay consistent.
The surrounding database-page changes update named imports in both
Next.js and TanStack routes.
- Simplify action, status, and form rendering; announce status changes
to assistive technology; and sort table statuses without mutating cached
data.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>
2026-09-18 11:32:48 +08:00
Danny White 7fd7ace118 feat(studio): add Infrastructure replica detail route and redirects (#49045)
## What kind of change does this PR introduce?

Feature. Stack 3 of 5 for
[PIPE-1007](https://linear.app/supabase/issue/PIPE-1007/move-read-replicas-out-of-replication-into-infrastructure).

## What is the current behavior?

Replica detail lives at `/database/replication/replica/:id`.

## What is the new behavior?

Detail moves to `/settings/infrastructure/replica/:id`. Old URLs
redirect. List and diagram View/Manage replica links follow.

## Additional context

Stacked on [#49044](https://github.com/supabase/supabase/pull/49044).
Please review, but do not merge. Merge 2→5 in succession once they are
all reviewed, so users never sit on a split create/list vs detail path.

Replication still lists and creates replicas until
[#49046](https://github.com/supabase/supabase/pull/49046).

## To test

`infrastructure:read_replicas` is an enabled-feature, on by default.
There is no Feature Preview or ConfigCat switch. You should already see
the Infrastructure Read replicas section. If you do not, your profile
lists `infrastructure:read_replicas` in `disabled_features`.

From
[Infrastructure](https://studio-staging-git-danny-pipe-1007-03-detail-redirects-supabase.vercel.app/dashboard/project/_/settings/infrastructure),
open View replica on a row. Confirm you land on
`/settings/infrastructure/replica/:id`. If you have an old bookmark,
`/database/replication/replica/:id` should redirect there.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added read replica management to Infrastructure settings, including
replica creation, status monitoring, details, restart, and removal
actions.
* Added eligibility guidance and estimated pricing details during
replica setup.
* Added support for topology and replica information within
infrastructure configuration.
* **Improvements**
* Legacy database replication links now permanently redirect to the
corresponding Infrastructure pages.
* Added clearer empty, loading, error, and transition states for read
replica management.
* **Tests**
* Expanded coverage for replica navigation, redirects, eligibility
warnings, and empty states.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-21 12:44:41 +10:00
4129c8954d feat(studio): TanStack project routes — auth/logs/settings/functions (stack 5.2/6, from #46424) (#47118)
**Stack 5.2/6** of the TanStack Start migration (#46424) — second half
of the project routes (S5 was split for CodeRabbit's 150-file cap).
Stacked on **#47117** (5.1).

> [!NOTE]
> Same shape as 5.1 — thin route wrappers over the existing pages-router
components. With this PR every route is present, so `routeTree.gen.ts`
is now **byte-identical to the migration branch**.

## What's in this PR
- **Remaining project routes:** auth, logs, settings, observability,
functions, advisors, project-level integrations.
- **Supporting edits:** hoist `EdgeFunctionsIndexPageWrapper` out of
`getLayout`, `functions/secrets`, and move `DefaultLayout` to the root
for the logs page.
- `routeTree.gen.ts` regenerated for the full set.

## Verification
On top of S1–5.1: `studio` typecheck ✓, lint (0 errors) ✓, **Next build
✓ (181/181 pages)**.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Refactor**
* Reorganized internal routing and page structure to improve navigation
and maintainability across project settings, logs, functions,
authentication, integrations, and observability sections.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2026-07-06 18:31:18 +08:00
7d3f72ec7d feat(studio): TanStack project routes — data surfaces (stack 5.1/6, from #46424) (#47117)
**Stack 5.1/6** of the TanStack Start migration (#46424). The original
S5 (174 files) was over CodeRabbit's 150-file review cap, so it's split
into 5.1 + 5.2 by product. Stacked on **#47113** (S4).

> [!NOTE]
> Thin route wrappers rendering the existing pages-router components via
compat shims. Next-safe (full Next build run). The TanStack app isn't
functional end-to-end until 5.2 + the matrix flip.

## What's in this PR
- **Data-cluster project routes:** database, editor, sql, storage,
realtime, branches.
- **Top-level / onboarding routes:** `authorize`, `join`, `logout`,
`redeem`, `verify-email`, `claim-project`, aws-marketplace,
Vercel/GitHub integration entrypoints; `_app`/`_auth` layout shells;
`/org/_` + `/project/_` catch-alls.
- **Supporting edits:** hoist `BranchesPageWrapper` out of `getLayout`,
`ConnectStepsSection` `import.meta.glob`, `api/server.js`.
- `routeTree.gen.ts` regenerated for the routes present so far.

## Verification
On top of S1–S4: `studio` typecheck ✓, lint (0 errors) ✓, **Next build ✓
(181/181 pages)**.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Refactor**
* Restructured application routing infrastructure for improved code
organization and maintainability.
* Extracted and refactored layout wrapper components for enhanced
reusability across different sections of the application.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2026-07-03 21:22:06 +08:00