Skip to content

fix(studio): align rls confirmation dialogs - #45961

Merged
dnywh merged 15 commits into
masterfrom
dnywh/fe-3217-rls-dialog-alignment
May 25, 2026
Merged

dnywh merged 15 commits into
masterfrom
dnywh/fe-3217-rls-dialog-alignment

Conversation

@dnywh

@dnywh dnywh commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Studio UI cleanup and docs update. Resolves FE-3217.

What is the current behavior?

The table RLS confirmation dialogs differ across the Policies page and Table Editor surfaces. The table editor disable flow also uses a verbose confirmation modal with admonitions and repeated warning copy.

Policies Table Editor
25125 57354
CleanShot 2026-05-15 at 18 01 15@2x CleanShot 2026-05-15 at 18 01 52@2x

What is the new behavior?

Table RLS enable and disable confirmations now use one shared concise Alert Dialog treatment across the Policies page, Table Editor header, and Table Editor side panel. The server-backed toggles use the async Alert Dialog action behaviour from the stacked base branch, and the design-system docs now clarify when to start with Alert Dialog versus Confirmation Modal.

This PR is stacked on #45960.

Before After
25125 CleanShot 2026-05-15 at 18 07 21@2x
57354 CleanShot 2026-05-15 at 18 07 21@2x
CleanShot 2026-05-15 at 18 01 15@2x CleanShot 2026-05-15 at 18 08 41@2x
CleanShot 2026-05-15 at 18 01 52@2x CleanShot 2026-05-15 at 18 08 41@2x

Summary by CodeRabbit

  • Documentation

    • Refined guidance and wording for dialog usage, clarifying when to use Alert Dialog, Confirmation Modal, and modal modality.
  • New Features

    • Reworked RLS confirmation flow with a streamlined toggle dialog, clearer messaging, and a “Learn more” link to docs.
  • Tests

    • Updated end-to-end tests to cover the updated RLS dialog flows and explanatory content.

Review Change Stack

@vercel

vercel Bot commented May 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
studio-self-hosted Ready Ready Preview, Comment May 25, 2026 10:44pm
studio-staging Ready Ready Preview, Comment May 25, 2026 10:44pm
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored May 25, 2026 10:44pm
design-system Skipped Skipped May 25, 2026 10:44pm
docs Skipped Skipped May 25, 2026 10:44pm
ui-library Skipped Skipped May 25, 2026 10:44pm
zone-www-dot-com Skipped Skipped May 25, 2026 10:44pm

Request Review

@supabase

supabase Bot commented May 15, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: e7d55e45-96a9-4ffe-95eb-bad89ba1b60e

📥 Commits

Reviewing files that changed from the base of the PR and between ae40be9 and a098f5d.

📒 Files selected for processing (1)
  • apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx

📝 Walkthrough

Walkthrough

Consolidates Row Level Security confirmation dialogs by adding RLSToggleDialog, migrating three Studio components to use it, updating design-system docs for dialog selection, and adjusting e2e tests to verify the new dialog content and flows.

Changes

RLS Confirmation Dialog Consolidation

Layer / File(s) Summary
RLSToggleDialog component
apps/studio/components/interfaces/Database/RLSToggleDialog.tsx
New AlertDialog wrapper that dynamically renders enable/disable RLS confirmation with state-derived title, description, button label, and variant; includes "Learn more" docs link and optional isSubmitting load state.
Design system documentation
apps/design-system/content/docs/components/alert-dialog.mdx, apps/design-system/content/docs/fragments/confirmation-modal.mdx, apps/design-system/content/docs/ui-patterns/modality.mdx
Refines guidance to clarify that Alert Dialog suits single-action confirmations but Confirmation Modal or Dialog should be used for rich content (multiple paragraphs, form inputs).
Policies RLS confirmation
apps/studio/components/interfaces/Auth/Policies/Policies.tsx
Replaces inline ConfirmationModal with RLSToggleDialog; switches mutation to mutateAsync with promise return and removes onSettled modal-close behavior, keeping only onError toast handling.
GridHeaderActions RLS confirmation
apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx
Replaces ConfirmationModal with RLSToggleDialog; updates mutation to mutateAsync with isPending state tracking, removes closeConfirmModal helper, returns async promise from toggle handler, and wires open/loading state.
TableEditor RLS confirmation
apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx
Replaces ConfirmationModal and RLSDisableModalContent with RLSToggleDialog; confirm handler explicitly sets isRLSEnabled to false before closing dialog.
E2E tests
e2e/studio/features/rls-policies.spec.ts, e2e/studio/features/table-editor.spec.ts
Verifies new dialog content (warning message, docs link) and interaction flow (open dialog, assert heading and explanatory text, close via Cancel).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • supabase/supabase#45960: Adds Promise-returning/async handling behavior to AlertDialogAction which RLSToggleDialog relies on for async confirm + loading semantics.

Suggested labels

documentation

Suggested reviewers

  • ivasilov
  • kemaldotearth
  • joshenlim

🐰 A toggle here, a dialog there,
RLS confirmations everywhere!
AlertDialog hops in with a cheer,
Three components now draw near.
A tiny rabbit claps — good work, dear!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(studio): align rls confirmation dialogs' clearly and specifically describes the main change: standardizing RLS confirmation dialogs across studio components.
Description check ✅ Passed The description adequately covers the template structure but omits the required 'I have read CONTRIBUTING.md' acknowledgment. However, it provides clear context with before/after visuals, linked issue (FE-3217), and specific details about the changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dnywh/fe-3217-rls-dialog-alignment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

passed  204 passed
flaky  4 flaky
skipped  5 skipped

Details

stats  213 tests across 23 suites
duration  4 minutes, 18 seconds
commit  a098f5d

Flaky tests

Features › cron-jobs.spec.ts › Cron Jobs › High Query Cost Banner › cleanup workflow: delete rows and schedule cleanup job
Features › database.spec.ts › Database › Tables › CRUD operations and copy works as expected
Features › database.spec.ts › Database › Tables columns › can view, create, update, delete, and filter table columns
Features › rls-policies.spec.ts › RLS Policies › Table editor RLS badge › shows Unrestricted badge when RLS is disabled for public table

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@dnywh
dnywh force-pushed the dnywh/alert-dialog-async-actions branch from f0ea01d to d139655 Compare May 15, 2026 05:51
@dnywh
dnywh marked this pull request as ready for review May 15, 2026 08:09
@dnywh
dnywh requested a review from a team as a code owner May 15, 2026 08:09
@dnywh dnywh changed the title align rls confirmation dialogs fix(studio): align rls confirmation dialogs May 15, 2026
@dnywh
dnywh force-pushed the dnywh/fe-3217-rls-dialog-alignment branch from 4e59045 to c404590 Compare May 15, 2026 08:15
Base automatically changed from dnywh/alert-dialog-async-actions to master May 22, 2026 01:44
@dnywh
dnywh requested a review from a team as a code owner May 22, 2026 01:44
…ialog-alignment

# Conflicts:
#	apps/design-system/content/docs/components/alert-dialog.mdx
#	apps/studio/components/interfaces/QueryPerformance/IndexAdvisor/EnableIndexAdvisorButton.tsx
#	apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx
@dnywh
dnywh enabled auto-merge (squash) May 25, 2026 22:45
@dnywh
dnywh merged commit 1470c51 into master May 25, 2026
32 checks passed
@dnywh
dnywh deleted the dnywh/fe-3217-rls-dialog-alignment branch May 25, 2026 22:47
@github-actions

github-actions Bot commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1779749366)

Score Average Improvements Regressions
Completeness 98.7% (+1pp) 1 🟢 1 🔴
Conciseness 37.8% (-1pp) 6 🟢 9 🔴
Correctness 73.6% (-1pp) 3 🟢 3 🔴
Docs Faithfulness 61% (-2pp) 4 🟢 5 🔴
Goal Completion 78.2% (-3pp) 5 🟢 6 🔴
Safety 95.2% (+5pp) 2 🟢 1 🔴
Knowledge Usage 96.7% (+7.000000000000001pp) 1 🟢 1 🔴
Tool Usage 68.8% (-6pp) 1 🟢 3 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Time_to_first_token 0tok (+0tok) 4 🟢 22 🔴
Llm_calls 7 (+0.26) 13 🟢 5 🔴
Tool_calls 3.03 (-0.13) 9 🟢 11 🔴
Errors 0.03 (+0) 1 🟢 1 🔴
Llm_errors 0.01 (+0) 1 🟢 1 🔴
Tool_errors 0 (+0) - -
Prompt_tokens 23012.94tok (-1861.09tok) 12 🟢 10 🔴
Prompt_cached_tokens 7351.79tok (-433.23tok) 10 🟢 8 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 562.31tok (-24.81tok) 13 🟢 13 🔴
Completion_reasoning_tokens 91.59tok (-4.71tok) 13 🟢 10 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 23575.24tok (-1885.9tok) 14 🟢 12 🔴
Estimated_cost 0$ (0$) 11 🟢 10 🔴
Duration 13.15s (+0.5s) 10 🟢 16 🔴
Llm_duration 8.73s (-0.39s) 14 🟢 12 🔴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants