Skip to content

chore: improve the new schema form accessibility - #46201

Merged
djhi merged 3 commits into
masterfrom
chore/improve-new-schema-form
May 21, 2026
Merged

djhi merged 3 commits into
masterfrom
chore/improve-new-schema-form

Conversation

@djhi

@djhi djhi commented May 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The New schema form isn't actually a form:

  • values and validation are handled manually
  • users can't submit with Enter

Besides, even though it has a single field, it's displayed in a large side panel.
We now have guidelines for such cases:

As a general rule: use dialogs for short, focused tasks and use sheets for longer forms or more detailed views.

Solution

  • Convert it to a real form
  • Convert it to a dialog

How to test

  • In Table editor, click the schema selector and choose Create a new schema
  • press Enter immediately to check validation
  • enter a name and press Enter
  • Check the Save button show the pending state

Screenshots

Before:
image

After:
image

Summary by CodeRabbit

  • Refactor
    • Improved schema creation form with enhanced validation and error handling.
    • Added loading indicator during form submission.
    • Enhanced user feedback with toast notifications for success and error states.

Review Change Stack

@djhi
djhi requested a review from a team as a code owner May 21, 2026 07:49
@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)
docs Ready Ready Preview, Comment, Open in v0 May 21, 2026 9:13am
studio-staging Ready Ready Preview, Comment May 21, 2026 9:13am
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored May 21, 2026 9:13am
design-system Skipped Skipped May 21, 2026 9:13am
studio-self-hosted Skipped Skipped May 21, 2026 9:13am
ui-library Skipped Skipped May 21, 2026 9:13am
zone-www-dot-com Skipped Skipped May 21, 2026 9:13am

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: ae5183de-6a6e-4965-9e20-e9bb69228756

📥 Commits

Reviewing files that changed from the base of the PR and between d11bd49 and 451baeb.

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

📝 Walkthrough

Walkthrough

SchemaEditor is refactored from a SidePanel-based input with manual validation to a Dialog-based form using react-hook-form and zod. Form submission now validates project availability and triggers success/error toasts, while the UI uses FormField/FormControl components with isPending state for loading feedback.

Changes

Schema Editor Dialog Migration

Layer / File(s) Summary
Schema Editor form migration to react-hook-form and zod
apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SchemaEditor.tsx
Import dependencies updated to Dialog, FormField, FormControl, and zodResolver. Component now defines a zod formSchema requiring non-empty name, wires zodResolver into useForm, and implements a typed onSubmit handler that validates project availability, calls createSchema mutation, invokes onSuccess callback, and triggers success/error toasts. Rendering switched from SidePanel to Dialog with controlled FormField input; Cancel resets form and closes panel, Save submits form with isPending loading state.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • jordienr

Poem

A form that once stood by the side,
Now dialogs with validation's pride,
With zod and hooks, the logic flows,
As toasts appear when success glows. 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is vague and doesn't reflect the main change. The PR converts the schema form from a side panel to a dialog and implements proper form handling, but the title only mentions 'accessibility' improvements. Consider a more specific title like 'refactor: convert new schema form to dialog with react-hook-form' or 'feat: improve new schema form UX with dialog and form validation' to better reflect the actual changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description adequately covers the problem, solution, and testing instructions with before/after screenshots, meeting the template requirements.
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/improve-new-schema-form

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 21, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

passed  208 passed
skipped  5 skipped

Details

stats  213 tests across 23 suites
duration  4 minutes, 60 seconds
commit  72841fd

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

@jordienr jordienr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

code looks good, cant test interactions because the vercel build is running out of memory

@djhi
djhi merged commit 2a3db2f into master May 21, 2026
23 checks passed
@djhi
djhi deleted the chore/improve-new-schema-form branch May 21, 2026 12:55
@github-actions

github-actions Bot commented May 21, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1779368253)

Score Average Improvements Regressions
Completeness 94.8% (+3pp) 3 🟢 1 🔴
Conciseness 39.1% (-3pp) 4 🟢 8 🔴
Docs Faithfulness 65.4% (-2pp) 4 🟢 6 🔴
Goal Completion 73.1% (-1pp) 5 🟢 8 🔴
Knowledge Usage 90% (-7.000000000000001pp) - 2 🔴
Tool Usage 70.8% (-4pp) - 2 🔴
Correctness 74.3% (+7.000000000000001pp) 5 🟢 2 🔴
Safety 95.2% (+3pp) 1 🟢 1 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
URL Validity 100% - -
Time_to_first_token 0tok (0tok) 18 🟢 7 🔴
Llm_calls 6.88 (+0.15) 13 🟢 9 🔴
Tool_calls 3.04 (+0.15) 10 🟢 7 🔴
Errors 0 (-0.24) 3 🟢 -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 23722.06tok (+2915.28tok) 9 🟢 14 🔴
Prompt_cached_tokens 7122.05tok (+65.64tok) 11 🟢 11 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 573.03tok (-2.36tok) 13 🟢 13 🔴
Completion_reasoning_tokens 90.99tok (-8.14tok) 12 🟢 11 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 24295.09tok (+2912.92tok) 11 🟢 15 🔴
Estimated_cost 0$ (+0$) 13 🟢 12 🔴
Duration 13.55s (-2.24s) 22 🟢 4 🔴
Llm_duration 9.77s (-1.18s) 17 🟢 9 🔴

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