Skip to content

[Website] Default demo content#2412

Merged
adamziel merged 7 commits intotrunkfrom
add/demo-content
Aug 8, 2025
Merged

[Website] Default demo content#2412
adamziel merged 7 commits intotrunkfrom
add/demo-content

Conversation

@zaerl
Copy link
Copy Markdown
Collaborator

@zaerl zaerl commented Jul 24, 2025

Motivation for the change, related issues

See #2236

Set new default demo page if no other options are provided by the user and Playground is not running inside an <iframe>.

Set to https://raw.githubusercontent.com/fellyph/blueprints-demos/refs/heads/main/demos/blueprint-import-wxr.json for testing.

Implementation details

Testing Instructions (or ideally a Blueprint)

  1. npm run dev
  2. Open http://127.0.0.1:5400/website-server/
  3. The new page should open
  4. Try to add a blueprint, a import-*, a theme, a plugin on the URL. It should not open

Try in an iframe

<!DOCTYPE html>
<html lang="en">
<body>
    <iframe style="width: 600px; height: 600px; border: none;" src="http://127.0.0.1:5400/website-server/" title="WordPress Playground"></iframe>
</body>
</html>
immagine immagine

@zaerl
Copy link
Copy Markdown
Collaborator Author

zaerl commented Jul 24, 2025

cc. @akirk @fellyph

// Lean on the Query API parameters and the Blueprint API to
// create the new site.
const newUrl = new URL(window.location.href);
const defaultBlueprint =
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We'll need to bring that over to the Blueprints gallery: https://github.com/WordPress/blueprints

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yep, thanks. Waiting for the blueprint to be polished by @fellyph. I will move it there ASAP and update the URL here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yay, thank you for moving it!

@adamziel
Copy link
Copy Markdown
Collaborator

adamziel commented Jul 24, 2025

Technically, that seems to be a good to load that Blueprint. I left one note about the origin. Also the failed test-e2e check is a genuine failure – that test isn't flaky. I've restarted it just in case anyway.

@zaerl
Copy link
Copy Markdown
Collaborator Author

zaerl commented Jul 25, 2025

The should log the user in as an admin is now failing because the demo blueprint does not log the user in.

We can change the check to not login and add another one with ?login=yes

@adamziel @akirk, what do you think?

Sorry, no. Please ignore.

@zaerl zaerl force-pushed the add/demo-content branch from ac23dbd to 2780db6 Compare July 25, 2025 07:49
@zaerl zaerl self-assigned this Jul 25, 2025
@zaerl zaerl force-pushed the add/demo-content branch from f12f26b to 57e2425 Compare July 29, 2025 06:26
@zaerl zaerl force-pushed the add/demo-content branch from 57e2425 to 861ccd1 Compare August 4, 2025 11:46
@adamziel
Copy link
Copy Markdown
Collaborator

adamziel commented Aug 4, 2025

This is a good start, thank you @zaerl! Here's a few things that stood out to me:

Clicking "Learn more" loads the documentation site inside the Playground iframe. Let's give it target="blank" in the Blueprint.

Changing the WordPress version or the PHP version in the picker resets the content to the default empty WordPress site.

CleanShot 2025-08-04 at 16 22 25@2x

I understand why that happens technically, but it's a confusing user experience. At first I thought we could add a "load demo content" checkbox into that form, but the demo content doesn't look that good with older WordPress versions – I assume the default theme plays a big role in that:

CleanShot 2025-08-04 at 16 26 02@2x

I wonder what would be a useful thing to do here 🤔 cc @akirk @fellyph

@zaerl zaerl marked this pull request as ready for review August 4, 2025 15:17
@adamziel
Copy link
Copy Markdown
Collaborator

adamziel commented Aug 6, 2025

Thinking about this more, perhaps the Destructive action! Applying these settings will reset the WordPress site to its initial state. warning is enough to soften the unexpectedness. The target="blank" would then be the only blocker here.

@adamziel
Copy link
Copy Markdown
Collaborator

adamziel commented Aug 8, 2025

#2468 will take care of opening external links in a new window. I think we're good to merge this one! I'll mark it as a breaking change since any private Playground deployment will now use that default Blueprint. It may or may not be a problem in practice – if it is, let's make it customizable during build.

@fellyph any idea on how can we stay proactive and keep this Blueprint up to date with new WordPress releases without having to rely on our memory? It seems like we'll need to take manual action to update it when WordPress 6.9 is released. Perhaps we could start early and maintain a separate Blueprint for the beta / nightly release?

@adamziel adamziel merged commit 87cf8ae into trunk Aug 8, 2025
23 of 25 checks passed
@adamziel adamziel deleted the add/demo-content branch August 8, 2025 09:30
@adamziel adamziel changed the title Add new demo content [Website] Default demo content Aug 8, 2025
@adamziel adamziel mentioned this pull request Jan 17, 2026
4 tasks
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.

2 participants