Skip to content

Conversation

@fredrikekelund
Copy link
Contributor

Related issues

Proposed Changes

  • Display a spinner in the main sidebar when exporting a site (to match the behavior when importing a site).
Screenshot 2025-03-14 at 16 40 54

Testing Instructions

  1. Have a Studio site
  2. Go to the Import/Export tab and export the entire site
  3. Ensure that a spinner is displayed in the sidebar until the operation is complete
  4. Export just the database
  5. Ensure that a spinner is displayed in the sidebar until the operation is complete

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@fredrikekelund fredrikekelund requested a review from a team March 14, 2025 15:43
@fredrikekelund fredrikekelund self-assigned this Mar 14, 2025
Copy link
Contributor

@ivan-ottinger ivan-ottinger left a comment

Choose a reason for hiding this comment

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

The proposed changes look good. The spinner is rendering correctly when the site is being exported.

Good idea of adding it in the first place. It makes the experience consistent. 👌🏼

...currentProgress,
statusMessage: __( 'Backing up files...' ),
progress: Math.min( 100, 20 + entriesProgress * 80 ), // Backup creation takes progress from 20% to 100%
progress: Math.min( 95, 20 + entriesProgress * 80 ), // Backup creation takes progress from 20% to 95%
Copy link
Contributor

Choose a reason for hiding this comment

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

It is not clear to me why is this change needed? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. It's because I made the logic in isSiteExporting check that progress < 100 (identical to isSiteImporting). However, the BACKUP_CREATE_PROGRESS event handler would previously increment the progress all the way up to 100, which made the sidebar spinner disappear before the export was actually complete.

This change makes the event handler stop the progress at 95.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks, that makes sense.

@fredrikekelund fredrikekelund merged commit 7f15dbd into trunk Mar 17, 2025
7 checks passed
@fredrikekelund fredrikekelund deleted the f26d/display-sidebar-spinner-during-export branch March 17, 2025 08:43
bgrgicak pushed a commit that referenced this pull request Mar 20, 2025
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