Skip to content

Personal WP: Improve app install dialog - #3652

Merged
akirk merged 5 commits into
WordPress:trunkfrom
akirk:improve-personal-wp-blueprint-install-dialog
May 18, 2026
Merged

Personal WP: Improve app install dialog#3652
akirk merged 5 commits into
WordPress:trunkfrom
akirk:improve-personal-wp-blueprint-install-dialog

Conversation

@akirk

@akirk akirk commented May 16, 2026

Copy link
Copy Markdown
Member
Screenshot 2026-05-16 at 14 05 22

Summary

  • replace the install-blueprint postMessage confirm with a native HTML dialog
  • show app title, author, and description before installing
  • keep blueprint.json available behind a details disclosure
  • skip the confirmation when install-blueprint is sent from the trusted My Apps route
  • ignore top-level login and login steps while executing install-blueprint requests
  • add lightweight app action analysis for WordPress.org plugin installs and risky steps such as external plugin/theme installs, runPHP, WP-CLI, HTTP requests, and sensitive filesystem writes
  • surface compact app action and warning panels when the app request includes actions worth reviewing

Testing

  • npm run format:uncommitted
  • npm exec nx lint playground-personal-wp
  • npm exec nx typecheck playground-personal-wp
  • npm exec nx test playground-personal-wp
@akirk
akirk requested review from a team, Copilot and mho22 May 16, 2026 12:04
@akirk akirk changed the title Improve personal-wp app install dialog May 16, 2026

Copilot AI 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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR replaces the install-blueprint postMessage confirm flow with a native modal dialog that previews app metadata before installation and allows viewing the underlying blueprint.json.

Changes:

  • Add an HTML <dialog>-based install confirmation UI with preview/status states.
  • Introduce helper functions to derive install source label and preview metadata (title/author/description/json).
  • Add styling and unit tests for the new blueprint preview/source helpers.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
packages/playground/personal-wp/src/components/playground-viewport/style.module.css Adds dedicated styles for the new blueprint install dialog UI.
packages/playground/personal-wp/src/components/playground-viewport/index.tsx Replaces window.confirm with a modal dialog and wires async confirmation into the install flow.
packages/playground/personal-wp/src/components/playground-viewport/blueprint-install.ts Adds getBlueprintInstallPreview and getBlueprintInstallSource helpers used by the dialog.
packages/playground/personal-wp/src/components/playground-viewport/blueprint-install.spec.ts Adds tests covering the new preview/source helper behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +411 to +460
useEffect(() => {
const dialog = dialogRef.current;
if (!dialog || dialog.open) {
return;
}
dialog.showModal();
}, []);

useEffect(() => {
let cancelled = false;
setPreviewState({ status: 'loading' });
getBlueprintInstallPreview(blueprintUrl, corsProxyUrl)
.then((preview) => {
if (!cancelled) {
setPreviewState({ status: 'ready', preview });
}
})
.catch((error) => {
if (!cancelled) {
setPreviewState({
status: 'error',
error: getErrorMessage(error),
});
}
});
return () => {
cancelled = true;
};
}, [blueprintUrl]);

const preview =
previewState.status === 'ready' ? previewState.preview : null;
const canInstall = previewState.status === 'ready';
const blueprintTitle = preview
? preview.title
: previewState.status === 'error'
? 'Preview unavailable'
: 'Loading app details...';

return (
<dialog
ref={dialogRef}
className={css.blueprintInstallDialog}
aria-labelledby="blueprint-install-dialog-title"
aria-describedby="blueprint-install-dialog-description"
onCancel={(event) => {
event.preventDefault();
onClose(false);
}}
>
Comment on lines +65 to +76
export async function getBlueprintInstallPreview(
blueprintUrl: string,
corsProxyUrl?: string
): Promise<BlueprintInstallPreview> {
const blueprint = await fetchBlueprint(blueprintUrl, corsProxyUrl);
return {
title: blueprint.meta?.title || 'Untitled app',
description: blueprint.meta?.description || blueprint.description,
author: blueprint.meta?.author,
json: JSON.stringify(blueprint, null, 2),
};
}
Comment on lines +99 to +113
.blueprint-install-dialog {
width: min(460px, calc(100vw - 32px));
max-height: min(560px, calc(100dvh - 32px));
padding: 0;
overflow: hidden;
border: 0;
border-radius: 8px;
background: #fff;
color: #1e1e1e;
box-shadow:
0 24px 64px rgba(0, 0, 0, 0.26),
0 0 0 1px rgba(0, 0, 0, 0.08);
font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
@akirk
akirk merged commit 3c42f5e into WordPress:trunk May 18, 2026
53 checks passed
@akirk
akirk deleted the improve-personal-wp-blueprint-install-dialog branch May 18, 2026 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment