fix(editor): replace Player block preview with a static placeholder#568
Merged
Conversation
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
Embedding a live BeyondWords player inside the block editor preview was causing problems, so stop rendering it there entirely. The `beyondwords/player` block's `edit` component now unconditionally renders a core `Placeholder` (BeyondWords logo, "BeyondWords Player" title, and a short description) instead of conditionally mounting a `<Disabled><PlayAudio /></Disabled>` live preview. The `canPreview` gate (`useHasPlayAudioAction`) and the now-unused `Disabled`, `PlayAudio`, and `useHasPlayAudioAction` imports are removed. Scope is limited to the block editor preview: - `save()` is unchanged, so the real player still renders on the front end via the `data-beyondwords-player` marker. - The shared `PlayAudio` component and its hook are preserved — they are still used by the sidebar Preview panel and the document-setting panel; only the block's usage of them is removed. Also refreshes the stale comment in the block-editor Cypress spec; its assertions (block wrapper present, front-end player renders) are unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
galbus
force-pushed
the
claude/priceless-merkle-2b9276
branch
from
July 11, 2026 08:01
3a2ca84 to
9a3a155
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Stops embedding the live BeyondWords player inside the beyondwords/player block editor canvas preview, replacing it with a static WordPress core Placeholder so the editor remains stable while the front-end player behavior stays unchanged.
Changes:
- Update the
beyondwords/playerblockeditimplementation to always render a static<Placeholder>(removing the conditional live preview). - Adjust the related Cypress spec’s in-test documentation to reflect the new static placeholder behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/editor/components/add-player/index.js |
Removes the live preview path in the block editor and renders a static Placeholder in edit(). |
tests/cypress/e2e/block-editor/insert-beyondwords-player.cy.js |
Updates test comments to match the new editor behavior (still asserts block insertion + front-end player presence). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ve player
Strengthen the Player block insertion spec so it guards the new
static-placeholder behaviour, not just that the block wrapper exists:
- assert the core Placeholder label ("BeyondWords Player") renders,
- assert its instructions ("The BeyondWords audio player will appear
here.") render,
- assert the live player box (`.beyondwords-player-box-wrapper`) is NOT
embedded in the editor canvas, so a regression back to an in-editor
live preview would fail the test.
Addresses PR review feedback.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
gouravkhunger
approved these changes
Jul 12, 2026
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 & why
Embedding a live BeyondWords player inside the block editor preview was causing problems, so this stops rendering the live player there entirely and replaces it with a static core
Placeholder.The
beyondwords/playerblock'seditcomponent now unconditionally renders:🤖 Generated with Claude Code