Skip to content

chore: migrate auth Modal to Dialog#46392

Merged
djhi merged 5 commits into
masterfrom
chore/migrate-dialog-auth
May 27, 2026
Merged

chore: migrate auth Modal to Dialog#46392
djhi merged 5 commits into
masterfrom
chore/migrate-dialog-auth

Conversation

@djhi
Copy link
Copy Markdown
Contributor

@djhi djhi commented May 26, 2026

Problem

We still uses the deprecated Modal for:

  • Banning a user
  • Inviting a user
  • Adding a redirection URL
  • Removing a redirection URL

Test

Hard to test the JWT. I had to force its display by settings its open prop to true in apps/studio/components/interfaces/JwtSecrets/jwt-settings.tsx

Solution

  • use Dialog instead

Summary by CodeRabbit

  • Refactor
    • Modernized authentication UI components (user management, redirect URL configuration) with updated dialog structures for improved consistency and state handling
    • Enhanced async operation handling in redirect URL deletion workflows to ensure proper synchronization and state management

Review Change Stack

@djhi djhi requested a review from a team as a code owner May 26, 2026 16:17
@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 2026

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

Project Deployment Actions Updated (UTC)
design-system Ready Ready Preview, Comment May 27, 2026 7:24am
docs Ready Ready Preview, Comment, Open in v0 May 27, 2026 7:24am
studio-self-hosted Ready Ready Preview, Comment May 27, 2026 7:24am
studio-staging Ready Ready Preview, Comment May 27, 2026 7:24am
ui-library Ready Ready Preview, Comment May 27, 2026 7:24am
zone-www-dot-com Ready Ready Preview, Comment, Open in v0 May 27, 2026 7:24am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
studio Ignored Ignored May 27, 2026 7:24am

Request Review

@supabase
Copy link
Copy Markdown

supabase Bot commented May 26, 2026

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
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

📝 Walkthrough

Walkthrough

Four Auth UI components migrate from the legacy Modal to modern Dialog and AlertDialog primitives, updating imports and JSX structure while maintaining form behavior, validation, and submit/cancel wiring. RedirectUrls additionally adopts a mutateAsync pattern for its delete mutation.

Changes

Auth UI Modal to Dialog Migration

Layer / File(s) Summary
AddNewURLModal Dialog Migration
apps/studio/components/interfaces/Auth/RedirectUrls/AddNewURLModal.tsx
Dialog primitives imported; Modal replaced with Dialog, wiring open={visible} and onOpenChange to reset form and trigger close; content restructured into DialogHeader, DialogSection, and DialogFooter while preserving form and submit behavior.
BanUserModal Dialog Migration
apps/studio/components/interfaces/Auth/Users/BanUserModal.tsx
Dialog primitives imported; Modal replaced with Dialog structure including header, title, section separator, and footer; open/close wiring updated to Dialog open={visible} onOpenChange={() => onClose()}; form fields and ban duration preview retained.
InviteUserModal Dialog Migration
apps/studio/components/interfaces/Auth/Users/InviteUserModal.tsx
Dialog components imported; Modal replaced with Dialog open/onOpenChange pairing; content restructured into DialogHeader, DialogSection, and DialogFooter; explicit Cancel button added wired to handleToggle; submit button retains form submission wiring and disabled/loading conditions.
RedirectUrls AlertDialog Migration and Async Mutation
apps/studio/components/interfaces/Auth/RedirectUrls/RedirectUrls.tsx
AlertDialog primitives imported; delete mutation switched from mutate to mutateAsync; updateAuthConfig call awaited in delete handler; remove-URLs confirmation Modal replaced with AlertDialog controlled by openRemoveSelected and onOpenChange with selected URLs rendered and warning-variant action button.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

  • #46375: Both PRs perform the same code-level migration in auth UI components—replacing the legacy Modal component with new Dialog primitives (DialogContent, DialogHeader, DialogSection, etc.) across Auth UI modals.

Suggested reviewers

  • awaseem
  • charislam

Poem

🐰 Modal's days are done, hoorah!
Dialog springs forth, bright and new,
Four windows trade their old attire,
AlertDialogs handle confirms too,
Async mutations keep the beat—refactor's complete! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete and does not follow the template structure. Missing required sections: confirmation of CONTRIBUTING.md reading, explicit change type, proper behavior descriptions. Add missing template sections: confirm reading CONTRIBUTING.md (YES/NO), specify change type (e.g., 'chore'), provide current/new behavior details, and include additional context or screenshots if applicable.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: migrate auth Modal to Dialog' directly and clearly describes the main change: migrating Modal components to Dialog components across auth-related files.
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-dialog-auth

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
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

🎭 Playwright Test Results

passed  202 passed
flaky  6 flaky
skipped  5 skipped

Details

stats  213 tests across 23 suites
duration  4 minutes, 48 seconds
commit  24f3d59

Flaky tests

Features › database.spec.ts › Database › Tables › CRUD operations and copy works as expected
Features › filter-bar.spec.ts › Filter Bar › Basic Filter Operations › selecting a column without a value does not trigger a row request
Features › queue-table-operations.spec.ts › Queue Table Operations › pending changes persist when switching between tables
Features › realtime-inspector.spec.ts › Realtime Inspector › Basic Inspector UI › can join and leave a channel
Features › realtime-inspector.spec.ts › Realtime Inspector › Basic Inspector UI › start/stop listening button works
Features › table-editor.spec.ts › table editor › view table definition works as expected

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 a6bfa04 into master May 27, 2026
31 checks passed
@djhi djhi deleted the chore/migrate-dialog-auth branch May 27, 2026 12:08
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

Braintrust eval report

Assistant (bt::sp::custom::GitHub Actions-e1f8e343-7ee3-4763-ae7f-62d4550a6e7c-1779883903)

Score Average Improvements Regressions
Completeness 97.4% (+0pp) 2 🟢 2 🔴
Conciseness 42.9% (+3pp) 8 🟢 6 🔴
Correctness 73.6% (-2pp) 3 🟢 4 🔴
Docs Faithfulness 65.9% (-5pp) 4 🟢 6 🔴
Goal Completion 80.8% (+3pp) 6 🟢 3 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 94.7% (-5pp) - 1 🔴
Safety 95.2% (-2pp) 1 🟢 1 🔴
Tool Usage 72.9% (-2pp) - 1 🔴
Knowledge Usage 100% (+0pp) - -
Time_to_first_token 0tok (0tok) 17 🟢 9 🔴
Llm_calls 7.17 (+0.41) 16 🟢 5 🔴
Tool_calls 2.86 (-0.14) 7 🟢 10 🔴
Errors 0.03 (-0.09) 2 🟢 1 🔴
Llm_errors 0.01 (+0) 1 🟢 1 🔴
Tool_errors 0 (+0) - -
Prompt_tokens 24526.72tok (+908.42tok) 9 🟢 13 🔴
Prompt_cached_tokens 6065.23tok (-676.1tok) 7 🟢 13 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 560.58tok (-6.22tok) 13 🟢 13 🔴
Completion_reasoning_tokens 86.47tok (-8.46tok) 14 🟢 9 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 25087.29tok (+902.21tok) 10 🟢 16 🔴
Estimated_cost 0$ (+0$) 11 🟢 13 🔴
Duration 12.21s (-1.37s) 18 🟢 8 🔴
Llm_duration 7.23s (-1.84s) 22 🟢 4 🔴

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