Skip to content

Conversation

@wadebekker
Copy link

@wadebekker wadebekker commented Jan 3, 2025

Description of the Change

This PR adds the ability to dock the player to the top or bottom of the page, in addition to the original 'inline' option.
When docked, the podcast details are hidden initially to save height. A 'More/Less' button is available to hide or reveal the podcast details.

Please note: This feature is still a WIP
Further styling is still required on the 'More/Less' button and layout, and general spacing needs to be reviewed and tested.
This feature is not yet fully tested in all major browsers and viewport sizes.

Closes #299

How to test the Change

  • Checkout PR branch
  • Run the project using Local
  • Open the website and log into the WP Admin Dashboard

From within the WP Admin Dashboard:

  • Create a Podcast.
  • Add a Podcast Block to a new or existing post.
  • Insert your podcast episode into the Podcast Block.
  • Inside the block editor panel, under 'Podcast Settings', a new set of controls labeled 'Dock Player' is available.
  • Toggle between 'Top', 'Bottom', 'None' to test the various docking options.
  • Toggle on a few of the 'Podcast Settings' options to test the 'More/Less' functionality.
  • Save/Publish your post to test the frontend output (outside of the WP admin area).

Changelog Entry

Added - New feature

Credits

@wadebekker @sanketio

Checklist:

Desired results:

The designs below illustrate our goals for both mobile and desktop views. Note: When docked at the top, the player should remain visually identical but fixed to the top of the page.

desktop
mobile

@wadebekker wadebekker requested a review from a team as a code owner January 3, 2025 08:56
@wadebekker wadebekker requested review from peterwilsoncc and removed request for a team January 3, 2025 08:56
@github-actions github-actions bot added this to the Future Release milestone Jan 3, 2025
@github-actions github-actions bot added the needs:code-review This requires code review. label Jan 3, 2025
@jeffpaul jeffpaul modified the milestones: Future Release, 2.0.0 Jan 3, 2025
@jeffpaul
Copy link
Member

@peterwilsoncc over to you for review/testing, thanks!

Copy link
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a few notes inline to start with.

I think the expanding and contracting of details will need an aria-expanded and family for accessibility reasons.

I noticed in the dashboard when editing a post that a docked player is hidden behind the admin bar and post settings panels.

editor-view

When the blocks are shown on the index pages of a blog/category, it's possible to dock the items from each post which can look odd, and will be problematic if there all docked to the same location.

I think it will either need to be limited so only the first episode is docked on listing pages, or docking only works on single posts.

Screenshot 2025-01-21 at 1 12 40 PM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new code in this file uses tabs for intending, whereas the existing code is using spaces. Are you able to switch to spaces for consistency.

Comment on lines 196 to 197
// displayEpisodeTitle ||
// displayArt ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the commented out code.

Suggested change
// displayEpisodeTitle ||
// displayArt ||

Comment on lines 212 to 213
// displayEpisodeTitle,
// displayArt,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// displayEpisodeTitle,
// displayArt,

?>
<div class="wp-block-podcasting-podcast-outer">

<div class="wp-block-podcasting-podcast-outer <?php echo 'docked-' . esc_attr( $attributes['isDocked'] ); ?>">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick.

Suggested change
<div class="wp-block-podcasting-podcast-outer <?php echo 'docked-' . esc_attr( $attributes['isDocked'] ); ?>">
<div class="wp-block-podcasting-podcast-outer <?php echo 'docked-' . sanitize_html_class( $attributes['isDocked'] ); ?>">

@jeffpaul
Copy link
Member

jeffpaul commented Jul 7, 2025

@wadebekker any chance you'll be able to update from @peterwilsoncc code review comments above?

@sanketio
Copy link

sanketio commented Aug 8, 2025

@jeffpaul @peterwilsoncc I updated the code for this PR, and it is now ready for your reviews.

@jeffpaul jeffpaul requested a review from peterwilsoncc August 11, 2025 19:00
Copy link
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inside the editor I'm still seeing some odd behaviour. It's half hidden when docked to the top; and when docked in either location the toolbar still appears in the original location.

editor-docking

As the layout in the editor can change fairly frequently, I think it might be best to do what you've done on the index pages and avoid docking in the editor. Maybe display an indication that it will be docked if you wish but I don't think it's essential.

@sanketio
Copy link

sanketio commented Sep 5, 2025

@peterwilsoncc I have removed the effect of the dock setting in the editor now.

Copy link
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks.

I've noticed the more button displays in the editor so have left a one work suggestion inline.

peterwilsoncc
peterwilsoncc previously approved these changes Sep 15, 2025
Copy link
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me

  • player is docked on post front end pages
  • player is not docked on post index pages, preventing double up of docked content
  • no docking in the editor to avoid block editing oddities

I've noted inline something I missed in earlier testing but I'm unclear if it's the intent or not. I've added the suggestion inline but feel free to merge if it's an intentional decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:code-review This requires code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Player enhancements - Ability to have the player docked to header or footer location on site.

4 participants