Skip to content

Conversation

@katinthehatsite
Copy link
Contributor

Related issues

Fixes STU-966

Proposed Changes

This PR adds a node to handle errors when there is an issue retrieving nodes from the local tree:

Screenshot 2025-12-17 at 10 25 18 AM

Testing Instructions

  • Pull the changes from this branch
  • Apply the following diff:
index 31db0fc9..b538c66b 100644
--- a/src/stores/sync/sync-hooks.ts
+++ b/src/stores/sync/sync-hooks.ts
@@ -83,6 +83,9 @@ export function useLocalFileTree() {
                        setIsLoading( true );
                        setError( null );
                        try {
+                               // TEMPORARY: Simulate error for testing
+                               throw new Error( 'Simulated error for testing error handling' );
+                               
                                const rawNodes = await getIpcApi().listLocalFileTree( siteId, path, 3 );
                                return convertRawToTreeNodes( rawNodes );
                        } catch ( err ) {
  • Start Studio with npm start
  • Ensure that you have at least one WP.com site connected to Studio
  • Navigate to the Sync tab
  • Click on Push
  • Select Specific files and folders option
  • Confirm that when you open wp-content, you see the error shown on the screenshot above

Pre-merge Checklist

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

@katinthehatsite katinthehatsite self-assigned this Dec 17, 2025
@katinthehatsite katinthehatsite changed the title Add error node Studio: Add UI for when local tree for push has errors Dec 17, 2025
@katinthehatsite katinthehatsite requested a review from a team December 17, 2025 09:36
<Icon icon={ cautionFilled } size={ 20 } className="fill-red-600" />
{ __(
'Error retrieving files and directories. Please close and reopen this dialog to try again.'
) }
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 did not add an explicit retry because this seems to be rather an edge case but we can add it if we consider it necessary

@github-actions
Copy link
Contributor

📊 Performance Test Results

Comparing a5aece6 vs trunk

site-editor

Metric trunk a5aece6 Diff Change
load 11498.00 ms 16421.00 ms +4923.00 ms 🔴 42.8%

site-startup

Metric trunk a5aece6 Diff Change
siteCreation 33681.00 ms 28804.00 ms -4877.00 ms 🟢 -14.5%
siteStartup 12084.00 ms 12063.00 ms -21.00 ms 🟢 -0.2%

Results are median values from multiple test runs.

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

Copy link
Contributor

@gavande1 gavande1 left a comment

Choose a reason for hiding this comment

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

I have tested this and works great. LGTM 👍

Image

@katinthehatsite
Copy link
Contributor Author

Update: I updated the style to look like this based on the comment from Linear

Screenshot 2025-12-17 at 2 28 51 PM

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