Skip to content

Conversation

@bcotrim
Copy link
Contributor

@bcotrim bcotrim commented Dec 24, 2025

Related issues

Proposed Changes

  • Add useIpcListener for user-data-updated event in use-site-details.tsx to refresh the site list when the appdata file changes externally (e.g., when CLI creates a site or modifies site settings)
  • Handle edge case where the currently selected site is deleted externally by resetting selection to the first available site

Root cause: The file watcher (user-data-watcher.ts) already broadcasts user-data-updated IPC events when the appdata file changes, but use-site-details.tsx was not listening to this event. The snapshot slice listened to it for preview sites, but the main site list did not.

Testing Instructions

Test STU-1164 (Site creation)

  1. Open Studio app
  2. Build the CLI: npm run cli:build
  3. Create a site via CLI: node dist/cli/main.js site create --path /tmp/test-site-cli
  4. Verify the new site appears in the sidebar immediately

Test STU-1163 (Site settings changes)

  1. Open Studio app with an existing site
  2. Open the Settings tab for the site
  3. Run node dist/cli/main.js site set-domain hello.wp.local --path PATH_TO_SITE
  4. Verify the "Local URL" setting updates in Studio UI
  5. Test other commands: set-php-version, set-wp-version, set-https

Pre-merge Checklist

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

@bcotrim bcotrim self-assigned this Dec 24, 2025
@bcotrim bcotrim requested review from a team and fredrikekelund December 24, 2025 12:47
Copy link
Contributor

@nightnei nightnei left a comment

Choose a reason for hiding this comment

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

Test STU-1164 (Site creation)

Worked as expected

  1. Run node dist/cli/main.js site set-domain hello.wp.local --path PATH_TO_SITE

The changes are not reflected in Studio, tested a few times and reinstalled node_moduels and rebuild

set-php-version

Also changes are not reflected in Studio

set-wp-version

Stucks endlessly on Changing WordPress version… and can't be termninated with controll+c
UPDATE: I got error and again it stucks:
Screenshot 2025-12-24 at 14 12 29

@nightnei
Copy link
Contributor

nightnei commented Dec 24, 2025

Run node dist/cli/main.js site set-domain hello.wp.local --path PATH_TO_SITE

Fixed

node dist/cli/main.js site set-wp-version 6.4 --path=~/Studio/bbb

Now I get error. It's newly created site with `node dist/cli/main.js site create --path /tmp/test-site-cli. And Still controll+c doesn't work.

Screenshot 2025-12-24 at 14 17 31 Screenshot 2025-12-24 at 14 17 40

set-php-version

works

set-https

Success, but actually it doesn't work and fails something

Screenshot 2025-12-24 at 14 21 06
Screenshot 2025-12-24 at 14 21 15

@bcotrim
Copy link
Contributor Author

bcotrim commented Dec 24, 2025

thanks for the review @nightnei

I couldn't replicate any of the issues, can you run npm install and npm run cli:build and test again please?
image
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants