Skip to content

fix: update and replace onboarding modal#50

Merged
justlevine merged 24 commits intodevelopfrom
fix/onboarding-modal
Nov 12, 2025
Merged

fix: update and replace onboarding modal#50
justlevine merged 24 commits intodevelopfrom
fix/onboarding-modal

Conversation

@justlevine
Copy link
Collaborator

@justlevine justlevine commented Nov 11, 2025

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

  • Typescript
  • Asset enqueing is colocated with the function
  • uses settings API and nonce (built in perms) along with apiFetch to CRUD the site type
  • loads on all OP screens + settings page
  • full TS rewrite

Checklist

Screenshots

To-do

Fixes/Covers issue

Fixes #

justlevine and others added 13 commits November 11, 2025 00:38
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>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.php instead of centralized in Assets.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.

justlevine and others added 6 commits November 11, 2025 18:03
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>
@justlevine justlevine requested a review from up1512001 November 11, 2025 16:11
Base automatically changed from fix/harden-settings to develop November 11, 2025 19:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

justlevine and others added 2 commits November 11, 2025 23:24
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@justlevine justlevine merged commit 5149992 into develop Nov 12, 2025
7 of 9 checks passed
@justlevine justlevine deleted the fix/onboarding-modal branch November 12, 2025 00:05
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.

1 participant