Commit Graph
6 Commits
Author SHA1 Message Date
Danny White 30a1b38da0 feat(studio): rename temporary access to database token access (#54282)
## Problem

The database access preview still uses “Temporary access” across its
settings and member rules.

## Solution

Use “Database token access” for the feature and “Member access” for
member rules. Update the preview, settings, dialogs, feedback, member
status messages and docs together. Move the guide to
`/guides/platform/token-access`, permanently redirect the old URL, and
preserve existing section anchors.

## Review instructions

1. Open [the Studio
preview](https://studio-staging-git-dnywh-database-token-access-naming-supabase.vercel.app),
then Feature previews and find **Database token access**. Enable the
preview for a supported project, then open [Database
Settings](https://studio-staging-git-dnywh-database-token-access-naming-supabase.vercel.app/project/_/database/settings).
2. Check the **Database token access** heading, **Allow token access**
switch and **Member access** table. Open **Add rule** and an existing
rule to check the sheet titles. Open a rule’s delete confirmation and
cancel it.
3. With an assigned role, check the access status above the member
table. As a member without management permission, check the access
notice uses the same feature name.
4. Open the [database token access guide in the docs
preview](https://docs-git-dnywh-database-token-access-naming-supabase.vercel.app/docs/guides/platform/token-access).
Check the guide and navigation use the new name, the dashboard
instructions match Studio, and the existing section links from the
member guide still work. Open `/docs/guides/platform/temporary-access`
and its `.md` variant to check they permanently redirect to the new
URLs.

| Before | After |
| --- | --- |
| <img width="726" height="367" alt="CleanShot 2026-11-30 at 16 06 00"
src="https://github.com/user-attachments/assets/be351f0c-d578-4289-8785-5c4e69a254a7"
/> | <img width="729" height="374" alt="CleanShot 2026-11-30 at 16 05
38"
src="https://github.com/user-attachments/assets/f02b470d-ef1a-4b6c-bdbb-20fe10b847c6"
/> |
2026-12-02 00:03:43 +00:00
Miranda Limonczenko 7636e18f8d docs: shorten and sentence-case the Option 1 sidebar labels (#53880)
Part of DOCS-1737

## Problem

People who tried the Option 1 navigation reported labels that wrap onto
two lines, such as "Architecture, limits and pricing". The old
35-character limit let that label through at 32 characters.

They also reported labels that aren't in sentence case, such as
"Framework Quickstarts" and "ORM Quickstarts". The docs style guide asks
for sentence case.

## Solution

- **28-character limit, enforced.** A new test in `option1.test.ts`
fails on any Option 1 sidebar label over 28 characters. 97 labels were
over the limit. They're shortened.
- **Sentence case.** About 120 more labels are recased. Proper nouns and
product feature names keep their capitals, such as Edge Functions, Row
Level Security and Auth Hooks. "Self-Hosting" becomes "Self-hosting" in
the top nav and the sidebar title.
- **Parallel Start labels.** "Web app demos" becomes "Web app
tutorials", to match "Mobile tutorials".
- **Build becomes Products.** The tree test ran each candidate label
against the shipped Option 1 tree, with 93 tasks and 3 runs each.
Products raised direct success from 51% to 59%, and first clicks on the
right section from 78% to 88%.
- **Test fixtures.** `DocsSidebarNav.test.tsx` and the level-size
allowlist reference labels by name, so they change too.


## Manual testing

1. Open [Getting started with Option 1 on the
preview](https://docs-git-docs-nav-label-casing-supabase.vercel.app/docs/guides/getting-started?docs-ia-mvp-v1=option-1).
The sidebar shows "Framework quickstarts" and "Web app tutorials".
2. Run `pnpm run -F docs test:local:unwatch features/IaNav
components/Navigation`. Expect all tests to pass.
2026-11-30 11:00:01 -08:00
Miranda Limonczenko b1f49edc3b docs: revise Option 1 placements from the tree test results (#52969)
Closes DOCS-1473
Closes DOCS-1578

## Problem

The [tree test results on the live
trees](https://app.notion.com/p/40e5004b775f811b91bed8f7c76ac7f6) found
four tasks where agents look in a different place from where Option 1
puts the page:

- **Shared responsibility:** agents look in Security and compliance. The
page is under Deploy to production, and every arm failed the task.
- **RLS testing:** agents look in Local Development and CLI. The page is
under Database.
- **Project transfer:** with two levels visible, agents open Team,
because the task is about organizations.
- **Leaked API key:** with two levels visible, agents see Start's "API
keys" and choose it. The rotation page sits a level deeper, under
Security and compliance.

## Solution

Revises four Option 1 placements and labels. Option 1 only. Today's nav,
page content, and URLs don't change. No subheads.

| Task | Change |
| --- | --- |
| Shared responsibility | Moved from Deploy to production to Security
and compliance › Compliance. The `docs:compliance` flag moves to the SOC
2, HIPAA, and GDPR items so the page shows in every build. |
| RLS testing | New Testing group under Local Development and CLI, with
Overview, Test RLS policies with pgTAP, Testing your database, and pgTAP
advanced guide. Database's Testing group goes away. |
| Project transfer | "Projects, compute and scaling" becomes "Projects,
organizations and compute", in the sidebar and the top nav. "Transfer
Project" becomes "Transfer to another organization". |
| Leaked API key | Start's "API keys and key rotation" becomes an "API
keys" group with two pages: API keys, and Rotate a leaked API key. The
rotation page moves out of Security and compliance. |

Each page keeps one home. Every level stays at 7 items or fewer, 5
levels at most, and labels at 35 characters or fewer.

In the tree test on this preview, all four tasks now pass with no wrong
turns at two levels. Set-aside tasks score 83% against Option 1's 71% at
two levels, and the same within noise at one level.

## Preview links

| Site | Live | Preview | Search for |
| --- | --- | --- | --- |
| Docs | Not live until supabase/supabase#52735 merges |
[/docs/nav-tree.json](https://docs-git-docs-ia-option-1-placement-revisions-supabase.vercel.app/docs/nav-tree.json?docs-ia-mvp-v1=option-1)
| Rotate a leaked API key |

## Additional context

- **The leaked-key move trades views.** With two levels visible, as in
the top nav dropdown, agents choose the rotation page in 3 of 3 runs, up
from 0. With one level at a time, as on mobile, they look in Security
and compliance first and find it in 0 of 3, down from 3. A follow-up
link from the Security and compliance hub to the rotation page would
help one-level readers without listing the page twice.
- **Set-aside tasks:** the shared responsibility and project transfer
cases are set-aside tasks. A gain on either can't count as unseen-task
evidence. Only a fresh holdout set can confirm it.

## Review instructions

1. Open `/docs/nav-tree.json?docs-ia-mvp-v1=option-1` on the preview.
Check that each moved page appears once, under its new parent.
2. Open `/docs/nav-tree.json` without the parameter. Check that it
matches supabase/supabase#52737's.
3. Open `/docs?docs-ia-mvp-v1=option-1` on the preview and hover Start.
Check that API keys shows as a group with Rotate a leaked API key
inside.

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-11-06 11:51:25 -08:00
Miranda Limonczenko fca0f99354 docs: move the explain() guide to guides/api/query-plans (#52471)
Closes DOCS-1496

## Problem

The Debugging performance issues page is moved to the Data API as a part
of the Information Architecture plan laid out in Option 1 of the [Docs
navigation architecture
proposal](https://app.notion.com/p/supabase/Q4-2027-Proposal-Docs-navigation-architecture-3f25004b775f81f49dbad710a732ef61).

The [docs tree
tests](https://github.com/supabase/evals/tree/docs/ia-tree-tests/evals/docs-tree-tests)
in supabase/evals drove the rename. Each test gives an agent a developer
goal and only the navigation labels, with no page content and no search.

- **The task:** [one
test](https://github.com/supabase/evals/tree/docs/ia-tree-tests/evals/docs-tree-tests/investigate-tree-036-client-call-execution-plan)
asks how to see the plan Postgres uses for a slow supabase-js
`.from('orders').select()` call. Its answer is this page.
- **Today's label:** the page sits under Database as "Debugging
performance issues". That label names a symptom many pages share, not
the tool the page teaches.
- **The change:** round 4 of the tests split the `explain()` content
into its own topic, labeled "Query plans with explain()" and placed in
Data API, Tools, next to the other client tools. Option 1 fixed every
task its new topics targeted.
- **Why the whole page moves:** `explain()` is the only thing the page
covers, so a split would leave an empty source. The page takes the
topic's label as its title.

## Solution

- **Move, not split:** the whole page covers `explain()`, so a split
would leave an empty source. The page moves to `guides/api/query-plans`,
and the old URL redirects there. The existing
`api/rest/debugging-performance` redirect now points straight to the new
URL, so there's no chain.
- **Anchors:** the four H2s keep their anchors, so the client reference
link to `#enabling-explain` resolves through the redirect. The two H3s,
Example data and Expected response, are gone. Nothing links to them.
- **Navigation:** both entries in today's navigation point to the new
URL, with the label "Query plans with explain()". In Option 1, the Data
API, Tools entry points to the new page, and the Database entry is gone,
since it would list the page twice. This was the last Option 1 topic
that linked to a section of its source page, so the test that tracked
those topics is removed.
- **Inbound link:** Realtime reports links to the new URL.
- **Cross-links:** the page links Query Performance for finding slow
queries, Query optimization for plans of SQL you run yourself, Row Level
Security performance for slow policies, and the `explain()` client
reference. Query optimization and Row Level Security performance link
back to it.
- **Guide shape:** a value-statement opener with the reason `explain()`
is off by default, and the sample table before the query that reads it.
The SQL samples have no comments, and the `format` option has an
example. Production readers are told to set up the filter before
enabling, and the options paragraph warns that `analyze` on a write
changes data.
- **Row Level Security performance:** the caution about restricting
plans now sits above the step that enables them.
- **Sample fix:** `pgrst.db_pre_request` holds one function, so the
production step now checks for an existing one and says to call the
filter from it. The disable step clears the pre-request setting only for
readers who set the filter directly. The filter function sets
`search_path`, so the Security Advisor doesn't flag it. It matches the
`Accept` header case-insensitively anywhere in the list, because
PostgREST accepts `Application/vnd.pgrst.plan+text` and the old prefix
check let it through. The check for an existing pre-request function
reads `pg_db_role_setting`, which also shows per-database settings that
`pg_roles.rolconfig` leaves out. When both a global and a per-database
setting exist, the page says PostgREST uses the per-database one. The
function is created and set as `public.filter_plan_requests`, because
PostgREST resolves an unqualified name against the requested schema
first. After the filter, the page says the Supabase Platform sets
`cf-connecting-ip`, and that a self-hosted project needs a header its
proxy overwrites.

### Verification

`test-the-docs`, local stack, Supabase CLI v2.39.2. Each SQL fence ran
in document order. The `supabase-js` calls were checked through the HTTP
request they send, with `Accept: application/vnd.pgrst.plan`.

| Step | Result |
| --- | --- |
| Plan request before enabling | 406, as expected |
| Enable, then request a plan | 200, text plan, and JSON with `+json` |
| Sample table, no extra grant | readable by `anon` |
| Pre-request filter with `set search_path = ''`, non-matching IP | 401
`Not allowed to use application/vnd.pgrst.plan`, normal requests 200 |
| Filter, mixed-case `Application/vnd.pgrst.plan+text` | old filter 200
with a plan, new filter 401; matching IP 200 |
| Insert plan with `options=analyze` | row persists after the request;
without `analyze`, no row |
| Existing-function check with an `in database` setting |
`pg_db_role_setting` shows it, `rolconfig` doesn't |
| Disable | plan requests 406, normal requests 200 |
| `cf-connecting-ip` on a hosted project | checked in review on a test
project: Cloudflare sets it, and a request that sends its own value is
rejected at the edge with `error code: 1000` |

### Not verified

- **Deferred:** the TypeScript fences, because the sandbox runs Node
only for example apps. The plan values in the example response come from
the old page and differ slightly from a local run.
- **Old links left on the redirect:** the client reference specs
(`supabase_{dart,py,kt,swift}`), the supabase-js doc comment, and one
`www` blog post still link to the old URL.

## Manual testing

1. Open [Query plans with
explain()](https://docs-git-docs-query-plans-supabase.vercel.app/docs/guides/api/query-plans).
See the enable, use, production, and disable sections.
2. Open [the old
URL](https://docs-git-docs-query-plans-supabase.vercel.app/docs/guides/database/debugging-performance#enabling-explain).
See it redirect to the new page at Enabling `explain()`.
3. In the Database sidebar under Debugging, click **Query plans with
explain()**. See the new page open.
2026-11-02 10:47:06 -08:00
Miranda Limonczenko 76f3d06a8b docs: add Test Row Level Security policies with pgTAP guide (#52344)
Closes DOCS-1499

## Problem

The testing overview teaches RLS tests, in pgTAP and from application
code, in sections that have grown into their own task.


## Solution

This goes above and beyond the initial ask, which was just to move a
section into a new topic.
Because I was here anyway, I aimed to improve the experience and improve
our RLS Evals score on tests. A companion Evals PR will split out a new
Eval for the new topic, migrating the checks that were in the RLS guide.

Some fixes are also included from running our docs skills, including:

- **Structure:** move the pgTAP example and the Application-Level
testing section to
`guides/database/postgres/testing-row-level-security`. The overview
keeps both headings, each with a short pointer. The "RLS policies
testing" nav entry points to the new page, and so does "Test RLS
policies with pgTAP" in the Option 1 nav.
- **Style:** a value-statement opener, lowercase SQL, and the command
split from its output.
- **Technical fixes:** test 2 asserts the `returning` value. Test 4 uses
`is_empty`. The output is the output `supabase test db` prints.
- **Additions:** `supabase start`, the table as a migration applied with
`supabase db reset`, and two sentences on how the test isolates its data
and user. A note for readers who use an agent to write their tests,
linking to a `## Write quality tests with agents` reference section. One
sentence in the RLS guide's `### Run the test suite` links to that
section.


## Review instructions

1. Open [Test Row Level Security policies with
pgTAP](https://docs-git-docs-test-rls-pgtap-supabase.vercel.app/docs/guides/database/postgres/testing-row-level-security)
on the preview. See five steps and a passing `Tests=4` output.
2. Open [Testing
overview](https://docs-git-docs-test-rls-pgtap-supabase.vercel.app/docs/guides/local-development/testing/overview#database-unit-testing-with-pgtap).
See the heading with a one-sentence pointer to the new page.
3. In the sidebar under Local development, Testing, click **RLS policies
testing**. See the new page open.
4. On the [Testing
overview](https://docs-git-docs-test-rls-pgtap-supabase.vercel.app/docs/guides/local-development/testing/overview#application-level-testing),
click **Test the policy from your application**. See the TypeScript
suite on the new page.
5. On the new page, click **Write quality tests with agents** in the
agent note's prompt. See the five rules for agents near the bottom of
the page.
6. On [Row Level
Security](https://docs-git-docs-test-rls-pgtap-supabase.vercel.app/docs/guides/database/postgres/row-level-security#run-the-test-suite),
click **Write quality tests with agents** under Run the test suite. See
the new page open at that section.
7. Open the [Database guides with the Option 1
nav](https://docs-git-docs-test-rls-pgtap-supabase.vercel.app/docs/guides/database/overview?docs-ia-mvp-v1=option-1).
Under Row Level Security, roles and Vault, click **Test RLS policies
with pgTAP**. See the new page open.
2026-10-29 14:23:36 -07:00
Miranda Limonczenko 4b7af187a4 feat(docs): add Option 1 navigation behind the flag (#52191)
Closes DOCS-1469

## Problem

Option 1 in the navigation proposal groups the docs into Start, Build,
Develop and deploy, Run and manage, Self-Hosting, Reference, and
Resources. The `docs-ia-mvp-v1` flag from #52049 switches to an Option 1
config. That config is still a copy of today's navigation.

## Solution

- **Top nav:** reads Start, Build, Develop and deploy, Run and manage,
Self-Hosting, Reference, and Resources. Menus still open sidebars by URL
prefix, as they do today.
- **Run and manage:** pages under `/guides/platform`,
`/guides/security`, and `/guides/observability` share one sidebar with
the outline's seven groups.
- **Other sidebars:** follow the outline. REST, GraphQL and Realtime
share one sidebar, and Cron and Queues share one sidebar.
- **Seven new topics:** keep their outline labels and link to the
section on their source page, for example
`getting-started/api-keys#leaked-key`.
- **No flash of today's nav:** flags load in the browser, so the nav
stays invisible until the query param or the flags resolve, with a
1-second fallback. The links stay in the HTML for agents.
- **Tests:** each page appears once across the sidebars, and every link
goes to a page in today's navigation. With the flag off, `useNavItems`
returns today's navigation.

**Not changed:** no URLs move. Breadcrumbs still show today's trail,
which DOCS-1470 covers.

## Manual testing

1. Open [Database Backups with the flag
on](https://docs-git-docs-ia-nav-option-1-supabase.vercel.app/docs/guides/platform/backups?docs-ia-mvp-v1=option-1).
The top nav reads Start, Build, Develop and deploy, Run and manage,
Self-Hosting, Reference, and Resources. The sidebar shows the seven Run
and manage groups.
2. Open [the same page with the flag
off](https://docs-git-docs-ia-nav-option-1-supabase.vercel.app/docs/guides/platform/backups?docs-ia-mvp-v1=control).
Today's navigation shows.
3. Open [Database with the flag
on](https://docs-git-docs-ia-nav-option-1-supabase.vercel.app/docs/guides/database/overview?docs-ia-mvp-v1=option-1).
The sidebar starts with Connect to your database.
4. In the sidebar, open Row Level Security, roles and Vault, and select
Test RLS policies with pgTAP. The testing overview opens at Database
unit testing with pgTAP.
2026-10-28 16:03:11 +00:00