Skip to content

fix(editor): replace Player block preview with a static placeholder#568

Merged
galbus merged 2 commits into
mainfrom
claude/priceless-merkle-2b9276
Jul 19, 2026
Merged

fix(editor): replace Player block preview with a static placeholder#568
galbus merged 2 commits into
mainfrom
claude/priceless-merkle-2b9276

Conversation

@galbus

@galbus galbus commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

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/player block's edit component now unconditionally renders:

[BeyondWords logo]  BeyondWords Player
The BeyondWords audio player will appear here.

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All 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
galbus force-pushed the claude/priceless-merkle-2b9276 branch from 3a2ca84 to 9a3a155 Compare July 11, 2026 08:01
@galbus
galbus requested a review from Copilot July 11, 2026 08:03

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

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/player block edit implementation 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.

Comment thread src/editor/components/add-player/index.js
…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>
@galbus
galbus requested a review from gouravkhunger July 12, 2026 05:34
@galbus
galbus merged commit eaed196 into main Jul 19, 2026
12 checks passed
@galbus
galbus deleted the claude/priceless-merkle-2b9276 branch July 19, 2026 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants