Polish PHP snippet run UI#3638
Merged
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.
Polishes the <php-snippet> embed UI by keeping the Run button interactive (queuing a single follow-up run), surfacing the keyboard shortcut inside the button, removing the secondary progress bar, lightening output styling, and splitting the footer credit into two distinct links.
Changes:
- Replaced the separate
.progressbar with the existing run-button progress text/percent and reworked busy state to usearia-busyinstead of disabling the button. - Added click queueing via
_rerunRequestedso an in-flight run triggers exactly one re-run, and added a.run-shortcutelement showing Cmd/Ctrl+Enter based on platform. - Lightened
.outputpanel styling, updated the flash keyframes, split the footer into two anchor links, and updated Playwright tests to match the new DOM/behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/playground/website/public/php-code-snippet.js | Component DOM/CSS/behavior changes: removed .progress, added run shortcut label, queueing logic, lighter output styling, split footer links. |
| packages/playground/website/playwright/e2e/php-code-snippet.spec.ts | Updated tests to assert button-based progress, the new .run-shortcut, queued click behavior, light output styling, and two-anchor footer. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (btn.disabled || this._isRunning) { | ||
| if (this._isRunning) { | ||
| this._rerunRequested = true; | ||
| this._setRunButtonProgress('Queued', 100); |
| if (btn.disabled || this._isRunning) { | ||
| if (this._isRunning) { | ||
| this._rerunRequested = true; | ||
| this._setRunButtonProgress('Queued', 100); |
Comment on lines
52
to
54
| await expect(snippet.locator('.powered-by')).toContainText( | ||
| 'PHP Code Snippet powered by WordPress Playground' | ||
| ); |
Comment on lines
+984
to
+988
| const platform = | ||
| navigator.userAgentData && navigator.userAgentData.platform | ||
| ? navigator.userAgentData.platform | ||
| : navigator.platform || ''; | ||
| return /mac|iphone|ipad|ipod/i.test(platform) ? 'Cmd+Enter' : 'Ctrl+Enter'; |
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.
What changed
Testing
PATH=/usr/local/opt/node@22/bin:$PATH corepack npm run format:uncommittedPATH=/usr/local/opt/node@22/bin:$PATH npx nx lint playground-websitePATH=/usr/local/opt/node@22/bin:$PATH npx playwright test --config=packages/playground/website/playwright/playwright.config.ts e2e/php-code-snippet.spec.ts --project=chromium -g "renders all snippets|first Run boots|queues clicks|Ctrl\\+Enter|output refresh|Run button shows progress"The targeted tests pass. The local Vite dev server still logs the existing
isomorphic-git/src/...dependency-scan errors from storage imports during Playwright startup, but they did not affect these targeted snippet UI tests.