[Website] Detect the repository for pull request numbers - #4120
Merged
Conversation
adamziel
force-pushed
the
adamziel/detect-pr-repository
branch
from
July 20, 2026 16:25
0812ee7 to
ae5a99b
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the PR preview experience to detect whether a bare PR number belongs to WordPress Core or Gutenberg, while also standardizing compact progress feedback and improving a few error-handling surfaces.
Changes:
- Add inline repository detection for bare PR numbers (Core + Gutenberg checks in parallel) with a repository choice prompt when both match.
- Introduce/reuse
InlineProgressas the compact progress UI, and update styles/tests accordingly. - Improve error views/messages for incomplete WordPress downloads and OPFS worker failures; refine Dock pane UI states.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/playground/website/src/lib/state/opfs/opfs-site-storage.ts | Improves worker and timeout errors during OPFS writes. |
| packages/playground/website/src/github/preview-pr/style.module.css | Removes overlay/hint styles; adds progress + repository choice layout styles. |
| packages/playground/website/src/github/preview-pr/form.tsx | Adds repository detection flow for bare PR numbers and inline progress messaging. |
| packages/playground/website/src/github/preview-pr/form.spec.tsx | Adds a Vitest test covering dual-repo verification for bare PR numbers. |
| packages/playground/website/src/components/site-error-modal/get-site-error-view.tsx | Adds a dedicated view for incomplete WordPress bundle downloads. |
| packages/playground/website/src/components/site-error-modal/get-site-error-view.spec.tsx | Tests the new incomplete download error view. |
| packages/playground/website/src/components/saved-playgrounds-panel/style.module.css | Adds styled “Blueprint gallery couldn’t load” alert UI. |
| packages/playground/website/src/components/saved-playgrounds-panel/index.tsx | Makes panel headings optional and improves Blueprint gallery error presentation. |
| packages/playground/website/src/components/pane-loading/style.module.css | Renames boot-notice classes to inline-progress classes. |
| packages/playground/website/src/components/pane-loading/pane-loading.spec.tsx | Adds tests for InlineProgress rendering/ARIA behavior. |
| packages/playground/website/src/components/pane-loading/index.tsx | Extracts InlineProgress and reuses it in PlaygroundBootNotice. |
| packages/playground/website/src/components/ensure-playground-site/ensure-playground-site-is-selected.tsx | Adjusts autosave decline handling and replaces prompt reopening with a dock notice. |
| packages/playground/website/playwright/e2e/website-ui.spec.ts | Updates E2E assertions for the new PR field label (heading removed). |
| AGENTS.md | Documents when to use PaneLoading vs InlineProgress. |
Comments suppressed due to low confidence (1)
packages/playground/website/src/github/preview-pr/form.tsx:218
- The set of verification error codes is now spread across multiple places (the preview error handling chain and
isRepositoryMatch()’s allowlist). To reduce drift/typos over time, consider centralizing the error codes into a sharedtype/constant (e.g., a string-literal union plusconstarrays for “matchable” vs “fatal” codes) and reusing those in bothpreviewPr()andisRepositoryMatch().
if (!verification.ok) {
const { error } = verification;
if (error === 'invalid_pr_number' || error === 'no_ci_runs') {
setError(
isBareWordPressPr
? `Couldn’t find WordPress Core PR ${ref}. If this is a Gutenberg PR, paste its full GitHub URL instead.`
: `The PR ${ref} does not exist.`
);
} else if (
error === 'artifact_not_found' ||
error === 'artifact_not_available'
) {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Bare pull-request numbers in New Playground no longer assume WordPress Core. Playground checks
wordpress/wordpress-developandWordPress/gutenbergin parallel. One match opens directly, two matches show a repository choice, and no match names both repositories that were checked. Full GitHub URLs still route directly.Repository choices are full-row buttons. They show the PR title, repository, number, and opened date. Recognized URLs use the same card, so the repository and PR or Gutenberg branch remain clear when a long URL scrolls inside the field.
Proxy failures no longer look like missing pull requests. Unavailable GitHub responses, missing workflows, expired artifacts, and builds still in progress receive separate messages. Repository checks use the shared inline progress indicator.
Local development can enable reserved PR numbers for Core-only, Gutenberg-only, both, neither, and proxy failure states. The website README lists the scenarios.
Builds on #4119.
Repository choice
A recognized URL uses the same action:
Failure message
Testing