Skip to content

Studio Assistant: Add "Open in Studio" button to Blueprint output - #2104

Merged
gcsecsey merged 13 commits into
trunkfrom
stu-995-studio-assistant-show-deeplink-for-generated-blueprint
Nov 26, 2025
Merged

Studio Assistant: Add "Open in Studio" button to Blueprint output#2104
gcsecsey merged 13 commits into
trunkfrom
stu-995-studio-assistant-show-deeplink-for-generated-blueprint

Conversation

@gcsecsey

@gcsecsey gcsecsey commented Nov 20, 2025

Copy link
Copy Markdown
Member

Related issues

Proposed Changes

  • Add a utility to detect if the generated JSON is a Blueprint
  • Show an "Open in Studio" button for Blueprints
  • Redirect to the deeplink with the Blueprint content when the button is clicked

Testing Instructions

  • Open Studio and go to the Assistant tab on one of the sites

  • Prompt it to generate a Blueprint to be used for a new site

  • Try prompting for both simpler and more complicated setups, to test the Blueprint parsing at the later step:

    • Installing one plugin:
      Help me start a site using Blueprints that installs WooCommerce
      
    • Installing a plugin, a theme, and executing some code:
      Help me start a site using Blueprints that:
       - Installs WooCommerce
       - Installs the Twenty Twenty-Three theme from WP.org
       - Adds 5 example products to WooCommerce
      

Note

The Assistant can potentially generate invalid blueprints, where the plugins array is not flat, or the theme install step is invalid. It can take a couple of tries or re-prompts to get a semantically correct Blueprint generated.

  • Scroll down to the bottom of the generated JSON
  • Check that there is a new "Open in Studio" button rendered, and click it
  • Check that you're dropped in the "Add a site" step with the blueprint loaded
  • Check that the site creation proceeds without errors
trunk this branch
image image

Opening the Blueprint:
https://github.com/user-attachments/assets/e36ae1c6-8614-4e40-b788-d56228f1501a

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@gcsecsey
gcsecsey requested a review from a team November 21, 2025 16:45
@gcsecsey
gcsecsey marked this pull request as ready for review November 21, 2025 16:45
Comment on lines +35 to +37
const parsedBlueprint = JSON.parse( blueprintJson );
await validateBlueprintData( parsedBlueprint );

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This can be reverted after #2103 is merged.

@github-actions

github-actions Bot commented Nov 21, 2025

Copy link
Copy Markdown
Contributor

📊 Performance Test Results

Comparing 55a3fe7 vs trunk

site-editor

Metric trunk 55a3fe7 Diff Change
load 12654.00 ms 13542.00 ms +888.00 ms 🔴 7.0%

site-startup

Metric trunk 55a3fe7 Diff Change
siteCreation 25314.00 ms 22525.00 ms -2789.00 ms 🟢 -11.0%
siteStartup 11074.00 ms 11025.00 ms -49.00 ms 🟢 -0.4%

Results are median values from multiple test runs.

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

Comment thread src/components/assistant-code-block.tsx Outdated
Comment thread src/components/assistant-code-block.tsx Outdated
Comment thread src/components/assistant-code-block.tsx Outdated
Comment thread src/components/open-blueprint-button.tsx Outdated
Comment thread src/components/assistant-code-block.tsx Outdated
Comment thread src/hooks/use-is-valid-blueprint.ts Outdated
Comment thread src/hooks/use-is-valid-blueprint.ts Outdated
Comment thread src/hooks/use-is-valid-blueprint.ts Outdated

@nightnei nightnei left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM and works as expected 👍
However, it seems that blogname was ignored, but it's definitelly not connected to this PR.
Screenshot 2025-11-25 at 14 40 35
Screenshot 2025-11-25 at 14 40 43

@gavande1 gavande1 left a comment

Copy link
Copy Markdown
Contributor

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 it works great. It took couple of retries to get the correct blueprint. Maybe we could open another issue to refine blueprint generation. But that's not related to this issue. This works well when valid blueprint is generated. LGTM 👍

CleanShot 2025-11-26 at 11 40 56@2x Image

@bcotrim bcotrim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for adding the suggestion @gcsecsey
This looks great 👍

@gcsecsey
gcsecsey merged commit 73dfb2f into trunk Nov 26, 2025
9 checks passed
@gcsecsey
gcsecsey deleted the stu-995-studio-assistant-show-deeplink-for-generated-blueprint branch November 26, 2025 11:43
@gcsecsey

Copy link
Copy Markdown
Member Author

I have tested this and it works great. It took couple of retries to get the correct blueprint. Maybe we could open another issue to refine blueprint generation. But that's not related to this issue. This works well when valid blueprint is generated. LGTM 👍

CleanShot 2025-11-26 at 11 40 56@2x Image

That's a good point, thanks @gavande1. I added STU-1053 to track this.

@gavande1

Copy link
Copy Markdown
Contributor

That's a good point, thanks @gavande1. I added STU-1053 to track this.

Lovely. Thanks!

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

Labels

None yet

5 participants