Personal WP: Improve app install dialog - #3652
Merged
akirk merged 5 commits intoMay 18, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
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; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing