-
Notifications
You must be signed in to change notification settings - Fork 53
Studio: Make the import process more verbose #1734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Studio: Make the import process more verbose #1734
Conversation
There was a problem hiding this 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 enhances the import process with verbose progress tracking to provide more detailed feedback during backup extraction and import operations. The changes make the import process more transparent by showing file counts, content types, and granular progress updates.
Key changes:
- Added granular progress tracking with file counts for extraction, database import, and WordPress content import
- Implemented content categorization (plugins, themes, uploads, other) with type-specific progress messages
- Enhanced backup handlers to emit detailed progress events with file counts and current file information
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib/import-export/import/types.ts | Added new interface types for detailed progress event data |
| src/lib/import-export/import/events.ts | Added new progress event constants for granular tracking |
| src/lib/import-export/import/importers/importer.ts | Implemented content categorization and progress events for database and WordPress content import |
| src/lib/import-export/import/handlers/backup-handler-zip.ts | Enhanced ZIP handler with file-level progress tracking |
| src/lib/import-export/import/handlers/backup-handler-tar-gz.ts | Enhanced tar.gz handler with file-level progress tracking |
| src/hooks/use-import-export.tsx | Updated UI progress handling to display detailed progress messages with file counts |
| src/lib/import-export/tests/import/importer/jetpack-importer.test.ts | Added comprehensive tests for WordPress content categorization |
| src/lib/import-export/tests/import/handlers/backup-handler.test.ts | Updated test expectations for tar.gz handler options |
| src/hooks/tests/use-import-export.test.tsx | Added extensive tests for verbose progress tracking scenarios |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
gcsecsey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good and IMO the added progress steps make the import process much more "interactive" from a UX perspective, it's great to see what's happening under the hood.
To test the changes, I configured a site on playground.wordpress.net with fake data and plugins, and exported it both as .wpress and .zip.
When importing the .wpress I ran into an SQL parse error at the end of the import process. I could recreate this error on trunk, so I don't think this is related to these changes:
CleanShot.2025-09-10.at.12.00.12.mp4
Importing the .zip file worked well without errors:
CleanShot.2025-09-10.at.11.27.37.mp4
30b52e7 to
4d64085
Compare
There was a problem hiding this 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 11 out of 11 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bcotrim! This now looks much better, I have tested with a .zip file and I have not found any issues, I can see the total file count and the progress is much better now
Importing a zip
CleanShot.2025-10-02.at.11.31.09.mp4
But I have found a small pause in the progress when importing a wpress file in this branch that I could not replicate in trunk. Please find videos below
Importing a wpress in this branch
CleanShot.2025-10-03.at.07.50.10.mp4
Importing a wpress in trunk
CleanShot.2025-10-03.at.07.51.27.mp4
Please ping me if you need the wpress file
|
@bcotrim, this will be a nice improvement! It will prepare Studio for another change - at some point, we can consider redesigning how Studio displays progress, to:
That way, Studio would set expectations, so users would see all the steps that will be performed to complete the import. (CC @Marinatsu ) One note so far regarding UI - would it be clearer to use a percentage in all those places? As a user, I wouldn't be interested in the file count, but rather in the overall process progress:
We could also consider changing labels for the create site steps to make them more meaningful. For now, ale steps from "Getting everything ready…" to "Nearly finished" add some impression of progress but they don't mean anything. |
… emission, improve path categorization
…xtract progress helper, optimize typeLabels constant
191ffc6 to
01caf03
Compare
There was a problem hiding this 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 19 out of 19 changed files in this pull request and generated 4 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/lib/wordpress-provider/playground-cli/playground-server-process.ts
Outdated
Show resolved
Hide resolved
src/lib/wordpress-provider/playground-cli/playground-server-process.ts
Outdated
Show resolved
Hide resolved
epeicher
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bcotrim for continuing to improve this! I have tested it and it works great, I like the percentages, and when creating a site from an import, the progress is much nicer now.
CleanShot.2025-10-08.at.10.25.34.mp4
With regards to importing a backup to an existing site, I have found a couple of details that could be improved as part of this, or as follow-ups:
- When importing a
.wpressbackup, I see a small pause in the import (you can see in the video around the second 3) that I don't see in trunk
CleanShot.2025-10-08.at.10.22.53.mp4
- The progress bar goes backwards during the different states, as a user I don't like that, I would prefer an indeterminate progress bar or ideally a progress bar that only goes forward. Although, this could be a matter of preference, so happy to hear others thoughts.
src/lib/wordpress-provider/playground-cli/playground-server-process-child.ts
Outdated
Show resolved
Hide resolved
epeicher
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bcotrim for addressing the comments! I’ve given it another spin, and it works great. I don’t see any pauses in the progress, and I can see the progress bar is indeterminate, but the percentage gives a nice sense of progress. This LGTM! ![]()
Creating a new site by importing a wpress file
CleanShot.2025-10-09.at.10.36.08.mp4
Importing a wpress file into an existing site
CleanShot.2025-10-09.at.10.38.13.mp4
I have also tested with a jetpack backup and it works great too 🙌
| siteId, | ||
| if ( this.siteId ) { | ||
| try { | ||
| const mainWindow = await getMainWindow(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Related issues
Proposed Changes
Testing Instructions
Pre-merge Checklist