Skip to content

Conversation

@gavande1
Copy link
Contributor

@gavande1 gavande1 commented Dec 29, 2025

Related issues

Fixes STU-1144

Summary

This PR implements file upload progress tracking for sync operations, showing the upload percentage (0-100%) in the UI as "Uploading site (98%)…".

Proposed Changes

  • Adds progress updates in real-time as chunks are uploaded via Tus protocol for sync uploads
  • Updated UI component to display upload percentage in parentheses before ellipsis

Testing Instructions

  • Checkout this branch
  • Connect your site for sync
  • Start push action with different granular options.
  • Check followings:
    • Test upload progress displays correctly during sync push operations
    • Verify percentage updates smoothly as chunks are uploaded
    • Confirm percentage is cleared when upload completes and transitions to next state
    • Test with various push options to ensure progress calculation is accurate
    • The progress bar also moves with progress between the range of 40%-50% to indicate overall push progress.

Output

CleanShot 2025-12-30 at 11 10 55@2x

- Add sync-upload-progress IPC event to send upload progress from main process
- Update Tus onProgress callback to send progress percentage (0-100%)
- Store raw upload progress in SyncPushState for display
- Display upload percentage next to 'Uploading Studio site…' message
- Progress updates in real-time as chunks are uploaded via Tus protocol

Fixes STU-1144
@gavande1 gavande1 self-assigned this Dec 29, 2025
@gavande1 gavande1 changed the title Sync: Show file upload progress in % in the UI Sync: Show file upload progress in the UI Dec 30, 2025
- Move upload progress mapping logic to useSyncStatesProgressInfo hook
- Add getPushUploadMessage helper for i18n-formatted messages
- Add isKeyUploading helper function
- Update message format to show percentage in parentheses: 'Uploading site (98%)…'
- Follow i18n best practices using sprintf for formatted messages
- Centralize all progress-related calculations in one place
@gavande1 gavande1 marked this pull request as ready for review December 30, 2025 05:53
<div className="a8c-body-small flex items-center gap-0.5">
<Icon icon={ info } size={ 16 } />
{ pushState.status.message }
{ getPushUploadMessage( pushState.status.message, uploadPercentage ) }
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 am not sure if this is best practice but this is best I could come up with. Let me know if you have any better idea to implement this in other way.

@gavande1 gavande1 requested a review from a team December 30, 2025 05:56
@github-actions
Copy link
Contributor

📊 Performance Test Results

Comparing 77b2ab6 vs trunk

site-editor

Metric trunk 77b2ab6 Diff Change
load 9735.00 ms 8890.00 ms -845.00 ms 🟢 -8.7%

site-startup

Metric trunk 77b2ab6 Diff Change
siteCreation 20703.00 ms 18458.00 ms -2245.00 ms 🟢 -10.8%
siteStartup 9049.00 ms 7971.00 ms -1078.00 ms 🟢 -11.9%

Results are median values from multiple test runs.

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

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.

2 participants