Skip to content

chore: migrate storage policies Modal to Dialog - #46222

Merged
djhi merged 2 commits into
masterfrom
chore/migrate-modals-storage-policies
May 21, 2026
Merged

djhi merged 2 commits into
masterfrom
chore/migrate-modals-storage-policies

Conversation

@djhi

@djhi djhi commented May 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Storage policies edition still uses the deprecated Modal

Solution

  • use Dialog instead
  • improve accessibility of the templates selection back button
  • extract the dialog title component in its own file

Screenshots

The only difference is the title font which is larger with Dialog

Before:
image

After:
image

Summary by CodeRabbit

  • Refactor
    • Modernized policy editing interfaces with updated dialog structure and consistent section separation across policy selection, templates, editor, and review flows for clearer layout and spacing.
  • New Features
    • Added a unified, context-aware modal header that adapts titles, back action, docs link, and close controls for different policy workflows.

Review Change Stack

@djhi
djhi requested a review from a team as a code owner May 21, 2026 14:34
@vercel

vercel Bot commented May 21, 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 21, 2026 2:45pm
studio-staging Ready Ready Preview, Comment May 21, 2026 2:45pm
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored May 21, 2026 2:45pm
design-system Skipped Skipped May 21, 2026 2:45pm
docs Skipped Skipped May 21, 2026 2:45pm
ui-library Skipped Skipped May 21, 2026 2:45pm
zone-www-dot-com Skipped Skipped May 21, 2026 2:45pm

Request Review

@supabase

supabase Bot commented May 21, 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 21, 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: 3ad03803-270c-4fc6-9dce-40cc22a16347

📥 Commits

Reviewing files that changed from the base of the PR and between f36d20d and 417f558.

📒 Files selected for processing (1)
  • apps/studio/components/interfaces/Storage/StoragePolicies/StoragePolicyEditorModalTitle.tsx

📝 Walkthrough

Walkthrough

Refactors policy editor UI from Modal to Dialog primitives across selection, templates, editor, and review views; extracts StoragePolicyEditorModalTitle for header rendering; replaces Modal.* wrappers with DialogSection, DialogSectionSeparator, DialogContent, DialogHeader, and DialogFooter. Internal policy logic unchanged.

Changes

Modal to Dialog UI Migration

Layer / File(s) Summary
New modal title component
apps/studio/components/interfaces/Storage/StoragePolicies/StoragePolicyEditorModalTitle.tsx
Added StoragePolicyEditorModalTitle to compute and render header content for EDITOR/SELECTION/REVIEW, render a back control for TEMPLATES, include a docs link, and provide a Radix Dialog close control.
Storage policy modal container and dialog setup
apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditPolicyModal.tsx
Converted modal to Dialog/DialogContent/DialogHeader primitives with open/onOpenChange wiring; renders StoragePolicyEditorModalTitle in DialogTitle and applies conditional DialogContent sizing and hideClose.
Policy editor section layout with dialog wrappers
apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditor.tsx
Wrapped editor subsections (PolicyName, PolicyAllowedOperations, PolicyRoles, PolicyDefinition) in DialogSection with DialogSectionSeparator between sections instead of Modal.Content/Modal.Separator.
Policy review section layout with dialog footer
apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesReview.tsx
Replaced review content Modal.Content with DialogSection, added DialogSectionSeparator, and moved actions into DialogFooter; SQL list and Back/Save behavior preserved.
Auth policy selection and templates section updates
apps/studio/components/interfaces/Auth/Policies/PolicySelection.tsx, apps/studio/components/interfaces/Auth/Policies/PolicyTemplates/index.tsx
PolicySelection now wraps content in DialogSection. PolicyTemplates removes outer border styling, inserts DialogSectionSeparator before action row, and updates wrapper classes for the action row.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • kemaldotearth
  • dnywh

Poem

🐰 Hopping through JSX with nimble paws,
I swapped Modal shells for Dialog laws,
A title in tow, and sections align,
Separators placed to keep things fine,
I nibble the bugs — the UI now draws.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title directly describes the main change: migrating storage policies from the deprecated Modal component to the Dialog component.
Description check ✅ Passed The description clearly identifies the problem (deprecated Modal usage), provides the solution (use Dialog instead, improve accessibility, extract title component), and includes before/after screenshots.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 chore/migrate-modals-storage-policies

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@apps/studio/components/interfaces/Storage/StoragePolicies/StoragePolicyEditorModalTitle.tsx`:
- Around line 31-39: The icon-only back button in StoragePolicyEditorModalTitle
(the button using onSelectBackFromTemplates and rendering the ChevronLeft icon)
needs an accessible name; add an aria-label (e.g., aria-label="Back" or a more
specific label like "Back to templates") or include an sr-only text node inside
the button so E2E tests and assistive tech can identify it.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: 757ea540-f69a-43dc-aceb-51df5007e62a

📥 Commits

Reviewing files that changed from the base of the PR and between db195ca and f36d20d.

📒 Files selected for processing (6)
  • apps/studio/components/interfaces/Auth/Policies/PolicySelection.tsx
  • apps/studio/components/interfaces/Auth/Policies/PolicyTemplates/index.tsx
  • apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditPolicyModal.tsx
  • apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesEditor.tsx
  • apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesReview.tsx
  • apps/studio/components/interfaces/Storage/StoragePolicies/StoragePolicyEditorModalTitle.tsx

@github-actions

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

passed  206 passed
flaky  2 flaky
skipped  5 skipped

Details

stats  213 tests across 23 suites
duration  3 minutes, 44 seconds
commit  417f558

Flaky tests

Features › realtime-inspector.spec.ts › Realtime Inspector › Basic Inspector UI › can join and leave a channel
Features › sql-editor.spec.ts › SQL Editor › warns on CREATE TABLE without RLS and "Run and enable RLS" enables it

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

@djhi
djhi merged commit 03a9f51 into master May 21, 2026
24 checks passed
@djhi
djhi deleted the chore/migrate-modals-storage-policies branch May 21, 2026 15:30
@github-actions

Copy link
Copy Markdown
Contributor

Braintrust eval report

Evals in progress... ⌛

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.

2 participants