Skip to content

Fix React performance and accessibility issues from react-doctor#2654

Merged
sejas merged 4 commits intotrunkfrom
stu-1307-fix-react-doctor-quick-wins
Feb 24, 2026
Merged

Fix React performance and accessibility issues from react-doctor#2654
sejas merged 4 commits intotrunkfrom
stu-1307-fix-react-doctor-quick-wins

Conversation

@sejas
Copy link
Copy Markdown
Member

@sejas sejas commented Feb 24, 2026

Related issues

Proposed Changes

Address last set of warnings from react-doctor static analysis, except big refactors:

  • Use lazy state initializer in edit-site-details.tsx to avoid calling getEffectiveWpVersion() on every render
  • Extract default [] prop value to module-level constant in create-site.tsx and create-site-form.tsx to prevent new array reference each render
  • Replace array index keys with content-based keys in welcome-message-prompt.tsx for stable React reconciliation when showMore toggles
  • Always set role="button" with aria-disabled on sync site selector items instead of conditionally omitting the role

Testing Instructions

  • Start the app with npm start
  • Verify the Add Site modal works correctly (creates sites with expected domain names)
  • Verify the AI chat welcome screen renders prompts and "show more" toggle works
  • Verify the Sync modal site selector shows sites and allows selection
  • Verify site settings can be edited (WordPress version selector)

React doctor:

  • Run npx -y react-doctor
  • Confirm that the following four warnings don't appear anymore:
image image

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors? (Tests pass, no errors)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sejas sejas self-assigned this Feb 24, 2026
@sejas sejas changed the title Fix react-doctor quick-win code health issues Fix React performance and accessibility issues from react-doctor Feb 24, 2026
@sejas sejas marked this pull request as ready for review February 24, 2026 15:31
@sejas sejas requested a review from a team February 24, 2026 15:32
@wpmobilebot
Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing e512b31 vs trunk

site-editor

Metric trunk e512b31 Diff Change
load 1513.00 ms 1462.00 ms -51.00 ms 🟢 -3.4%

site-startup

Metric trunk e512b31 Diff Change
siteCreation 7091.00 ms 8133.00 ms +1042.00 ms 🔴 14.7%
siteStartup 4952.00 ms 4944.00 ms -8.00 ms ⚪ 0.0%

Results are median values from multiple test runs.

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

Copy link
Copy Markdown
Contributor

@epeicher epeicher left a comment

Choose a reason for hiding this comment

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

Thanks @sejas for continue improving the codebase! I have tested the following:

Test Result
Verify the Add Site modal works correctly (creates sites with expected domain names)
Verify the AI chat welcome screen renders prompts and "show more" toggle works
Verify the Sync modal site selector shows sites and allows selection
Verify site settings can be edited (WordPress version selector)

and I have not found any issues. LGTM! :shipit:

@sejas sejas merged commit 59fde50 into trunk Feb 24, 2026
9 checks passed
@sejas sejas deleted the stu-1307-fix-react-doctor-quick-wins branch February 24, 2026 20:00
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