fix: update and replace onboarding modal#50
Merged
justlevine merged 24 commits intodevelopfrom Nov 12, 2025
Merged
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR replaces the JavaScript-based onboarding modal with a TypeScript implementation, improving type safety and modernizing the codebase. The changes also relocate asset enqueueing logic and use the WordPress Settings API with proper nonces for better security.
Key Changes
- Complete TypeScript rewrite of the onboarding modal with proper type definitions
- Migration from custom API endpoints to WordPress Settings API (
/wp/v2/settings) - Asset enqueueing colocated with component logic in
Admin.phpinstead of centralized inAssets.php
Reviewed Changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| webpack.config.js | Updated entry point from plugin/index.js to onboarding/index.tsx |
| tsconfig.json | Added TypeScript configuration with strict type checking enabled |
| package.json | Added TypeScript, React types, and @wordpress/api-fetch dependencies; added type checking script |
| package-lock.json | Updated lockfile with new dependencies and version bumps |
| inc/Modules/Settings/Settings.php | Changed sanitization callback to return empty string instead of null for invalid site types |
| inc/Modules/Settings/Admin.php | Added enqueue_scripts and enqueue_onboarding_scripts methods to handle onboarding asset loading |
| inc/Modules/Core/Assets.php | Renamed PLUGIN_SCRIPT_HANDLE to ONBOARDING_SCRIPT_HANDLE and registered onboarding styles; removed old plugin script enqueueing logic |
| assets/src/css/onboarding.scss | New stylesheet for onboarding modal with modal positioning and styling |
| assets/src/css/admin.scss | Moved onboarding-specific styles to dedicated onboarding.scss file; minor formatting update |
| assets/src/admin/plugin/index.js | Deleted old JavaScript implementation |
| assets/src/admin/onboarding/page.tsx | New TypeScript component for onboarding screen using apiFetch and Settings API |
| assets/src/admin/onboarding/index.tsx | New entry point with global type definitions for localized script data |
| .eslintrc.json | Updated ESLint config with TypeScript support and additional plugins |
| .eslintrc | Removed old ESLint config file (replaced by .eslintrc.json) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 15 out of 17 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes loading of the onboarding site type modal, and replaces the js to typescript.
Based on #49 which should be merged first.
Technical Details
Checklist
Screenshots
To-do
Fixes/Covers issue
Fixes #