Skip to content

Conversation

@katinthehatsite
Copy link
Contributor

@katinthehatsite katinthehatsite commented Nov 25, 2025

Related issues

Closes STU-908

Proposed Changes

This PR adds the bar that displays the size of the Studio site when the user is trying to perform the Push operation:

Screenshot 2025-11-25 at 3 26 54 PM

If the size is over the limit, the user is seeing the following warning:

Screenshot 2025-11-25 at 3 27 32 PM

Testing Instructions

  • Pull the changes from this branch
  • Ensure that you have a Studio site that is over 2GB (you can run cd wp-content/uploads and
    dd if=/dev/zero of=dummyfile.dat bs=1M count=2048 to inflate the site size if needed)
  • Navigate to the Sync tab
  • Make sure that you have at least one site connected
  • Click on the Push option to open the sync dialog
  • Observe that the progress bar shows as empty (0 bytes)
  • Next, start selecting things and confirm that the progress bar starts to fill in
  • Select everything that confirm that you can see over the limit warning and the progress bar

Pre-merge Checklist

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

@katinthehatsite katinthehatsite self-assigned this Nov 25, 2025
@katinthehatsite katinthehatsite marked this pull request as draft November 25, 2025 13:21
trackColor?: string;
};

export function TwoColorProgressBar( {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to achieve this with ProgressBar but that component is too simple so I opted for this custom simple implementation.


const getBottomPadding = () => {
if ( type === 'pull' ) {
return 'pb-[70px]'; // Original padding for pull
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I left these comments for the ease of reading the function. They could be removed if they seem self-explanatory

@katinthehatsite katinthehatsite marked this pull request as ready for review November 25, 2025 19:32
@katinthehatsite katinthehatsite requested a review from a team November 25, 2025 19:32
</div>
) }
{ type === 'push' && isPushSelectionOverLimit && (
<Notice status="warning" isDismissible={ false } className="mb-4">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I left the notice as warning even though the designs had it in blue. I tried the info version and this is what it looked like:

Image

To me it looked a bit too pale to be well noticed but we can change it if that's the preference.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 25, 2025

📊 Performance Test Results

Comparing ced4f24 vs trunk

site-editor

Metric trunk ced4f24 Diff Change
load 10227.00 ms 12243.00 ms +2016.00 ms 🔴 19.7%

site-startup

Metric trunk ced4f24 Diff Change
siteCreation 23235.00 ms 20232.00 ms -3003.00 ms 🟢 -12.9%
siteStartup 8065.00 ms 7951.00 ms -114.00 ms 🟢 -1.4%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change

@wojtekn
Copy link
Contributor

wojtekn commented Nov 26, 2025

This PR adds the bar that displays the size of the Studio site when the user is trying to perform the Push operation:

@katinthehatsite the bar looks great. What if we added 2 GB on the right and changed 0 bytes to 0 B, to make it consistent with elements used in the Hosting Dashboard?

@katinthehatsite
Copy link
Contributor Author

@katinthehatsite the bar looks great. What if we added 2 GB on the right and changed 0 bytes to 0 B, to make it consistent with elements used in the Hosting Dashboard?

@wojtekn this should be taken care of, let me know what you think

@wojtekn
Copy link
Contributor

wojtekn commented Nov 27, 2025

@katinthehatsite I haven't reviewed the code, but the UI looks great.

I just noticed one bug, as it looks it takes into the account everything even when I select one file?

Screenshot 2025-11-27 at 15 10 17 Screenshot 2025-11-27 at 15 09 03 Screenshot 2025-11-27 at 15 09 07

Copy link
Member

@sejas sejas left a comment

Choose a reason for hiding this comment

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

Works pretty good. Thanks for adding the progress bar showing the size of file selection.
I found the issue mentioned by Wojtek. The calculation only goes two levels deep, so for uploads it shows the total of the folder. I'll commit the fix to this branch.

Copy link
Member

@sejas sejas left a comment

Choose a reason for hiding this comment

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

I confirm it shows the size of a selected file with B bytes.
Image

It also counts the individual elements.

Image

And it displays the warning when the selection is over the limit.

Image

@sejas sejas merged commit 22d72d8 into trunk Nov 28, 2025
9 checks passed
@sejas sejas deleted the add/site-size-display-for-sync branch November 28, 2025 20:08
@katinthehatsite
Copy link
Contributor Author

Nice, thanks for making adjustments and bringing this PR over the finish line ❤️

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.

4 participants