Skip to content

Studio: New site form can be submitted with incorrect values using enter key - #2959

Merged
katinthehatsite merged 5 commits into
trunkfrom
fix/site-validation-errors-form
Apr 7, 2026
Merged

Studio: New site form can be submitted with incorrect values using enter key#2959
katinthehatsite merged 5 commits into
trunkfrom
fix/site-validation-errors-form

Conversation

@katinthehatsite

Copy link
Copy Markdown
Contributor

Related issues

Fixes https://linear.app/a8c/issue/STU-1490/new-site-form-can-be-submitted-with-incorrect-values-using-enter-key

How AI was used in this PR

Not used

Proposed Changes

This PR ensures that the site creation form can not be submitted with the Enter key when the site name is empty or when there are validation errors.

Testing Instructions

  • Pull the changes from this branch
  • Start Studio with npm start
  • Click on the Add site
  • Once the site form opens, remove the site name
  • Press the Enter key
  • Confirm that the site form can not be submitted

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@katinthehatsite katinthehatsite self-assigned this Apr 1, 2026
@katinthehatsite
katinthehatsite requested a review from a team April 1, 2026 13:42
@wpmobilebot

wpmobilebot commented Apr 1, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 33d3d55 vs trunk

app-size

Metric trunk 33d3d55 Diff Change
App Size (Mac) 1271.61 MB 1271.61 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk 33d3d55 Diff Change
load 1625 ms 1884 ms +259 ms 🔴 15.9%

site-startup

Metric trunk 33d3d55 Diff Change
siteCreation 8175 ms 8170 ms 5 ms ⚪ 0.0%
siteStartup 4842 ms 4840 ms 2 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@epeicher epeicher 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.

Thanks @katinthehatsite! This works as described, but should we also disable the Add site button when the name is empty? Alternatively, I think we can remove the siteName.trim() condition as the site name is correctly inferred from the folder name. What do you think?

Site can be added with empty site name in the form The site name is populated from the folder
Image Image
@katinthehatsite

Copy link
Copy Markdown
Contributor Author

@epeicher I added the empty site name to the list of errors to be consistent with how other errors work

@katinthehatsite
katinthehatsite requested a review from epeicher April 7, 2026 08:34
@epeicher

epeicher commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Thanks @katinthehatsite for addressing the comments! Now I can see that the Add site button is disabled when deleting the site name. Also, I am not able to create the site by pressing Enter when there are errors. LGTM!

@katinthehatsite
katinthehatsite merged commit 3f606c7 into trunk Apr 7, 2026
10 checks passed
@katinthehatsite
katinthehatsite deleted the fix/site-validation-errors-form branch April 7, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants