Skip to content

Refetch Sync dialog on focus and add spinner#2965

Open
nightnei wants to merge 2 commits intotrunkfrom
refetchSyncDialogOnFocusAndAddSpinner
Open

Refetch Sync dialog on focus and add spinner#2965
nightnei wants to merge 2 commits intotrunkfrom
refetchSyncDialogOnFocusAndAddSpinner

Conversation

@nightnei
Copy link
Copy Markdown
Contributor

@nightnei nightnei commented Apr 2, 2026

Related issues

How AI was used in this PR

AI assisted me, but the implementation is mine.

Proposed Changes

  1. The use case is - user opens Sync dialog, realizes that they need to connect Jetpack in Pressable, so they keep the dialog open and move to the browser to connect Jetpack to their site on Pressable. Then they return to Studio, don't see the just-connected site, and they restart Studio.

The solution - we need to refetch sites on the focus event, if the Sync dialog is opened in Studio.

  1. Right now, when we reopen the Sync dialog - we take data from cache and start refetching, but we don't communicate that we are refetching them. That's why when a user reopens the Sync dialog, we have a flash of content after a few seconds. I had a case where I was selecting a site and ended up choosing the wrong one because of a flash of content.

The solution - we should communicate in UI that we are refetching sites.

Testing Instructions

  1. Opean Sync dialog and assert that you see Loading sites
    Screenshot 2026-04-02 at 17 36 51
  2. Close the dialog and open again
  3. Assert that you see sites rendered from cache, but covered with blurred "Refreshing sites" spinner
    Screenshot 2026-04-02 at 17 38 32
  4. Leave Studio and focus on another app on your laptop
  5. Comeback and focus on Studio again
  6. Assert that you see "Refreshing sites" spinner
    Screenshot 2026-04-02 at 17 38 32

@nightnei nightnei requested a review from a team April 2, 2026 16:39
@nightnei nightnei self-assigned this Apr 2, 2026
@wpmobilebot
Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing e1b30fb vs trunk

app-size

Metric trunk e1b30fb Diff Change
App Size (Mac) 1271.61 MB 1271.61 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk e1b30fb Diff Change
load 1894 ms 1881 ms 13 ms ⚪ 0.0%

site-startup

Metric trunk e1b30fb Diff Change
siteCreation 8181 ms 8191 ms +10 ms ⚪ 0.0%
siteStartup 4861 ms 4847 ms 14 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

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