Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/issue 229 191 player enhancements #272

Merged
merged 22 commits into from
Jun 27, 2024

Conversation

barneyjeffries
Copy link
Contributor

@barneyjeffries barneyjeffries commented Jan 22, 2024

Description of the Change

New features added to the player.

Closes #191 and #229

Alternate Designs

Possible Drawbacks

Verification Process

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

Added - Additional features: Player Enhancements

Credits

Props @barneyjeffries @Firestorm980 @mehidi258 @Sidsector9

@barneyjeffries barneyjeffries requested a review from a team as a code owner January 22, 2024 13:53
@barneyjeffries barneyjeffries requested review from faisal-alvi and removed request for a team January 22, 2024 13:53
@github-actions github-actions bot added this to the 1.8.0 milestone Jan 22, 2024
@github-actions github-actions bot added the needs:feedback This requires feedback to determine next steps. label Jan 22, 2024
Copy link
Contributor

@barneyjeffries thanks for the PR! Could you please fill out the PR template with description, changelog, and credits information so that we can properly review and merge this?

@jeffpaul jeffpaul linked an issue Jan 22, 2024 that may be closed by this pull request
Copy link
Member

@faisal-alvi faisal-alvi left a comment

Choose a reason for hiding this comment

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

@barneyjeffries thank you for working on this. The player enhancement looks good.

BE:

image

image

FE:

image


However, the following checks are failing, can you please look into this?

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.

I noticed the display can be missing data if the checkboxes are enabled but the data is not populated.

In the case of episode type and explicit, the default isn't reflected unless the settings a modified.

Screen Shot 2024-02-14 at 1 11 09 pm

assets/js/edit.js Outdated Show resolved Hide resolved
assets/js/edit.js Outdated Show resolved Hide resolved
assets/js/edit.js Outdated Show resolved Hide resolved
assets/js/edit.js Outdated Show resolved Hide resolved
@@ -144,6 +156,19 @@ class Edit extends Component {
</BlockControls>
);

const { getCurrentPost } = select('core/editor');
const postDetails = getCurrentPost();
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be good to subscribe to the post data so the block is updated when the post title is edited https://gutenberg.10up.com/guides/data-api/#examples

Copy link
Contributor

Choose a reason for hiding this comment

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

@peterwilsoncc Could you please add some example snippet here? I was trying to use data-api example from above link but getting error called Invalid hook call since it's a class component. Tried in componentDidMount lifecycle hook as well got same error. Thanks in advance :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you'll need to do it for the post title and show ID separately. Here's an example for the title:

// Top of file
const { select, subscribe } = wp.data;

// Around here for the post title
const { getCurrentPost, getEditedPostAttribute } = select('core/editor');

let postTitle = getEditedPostAttribute( 'title' );
subscribe( () => {
	const newPostTitle = getEditedPostAttribute( 'title' );

	if ( postTitle !== newPostTitle ) {
		postTitle = newPostTitle;
	}
});

// Below
{ postTitle } // instead of { postDetails.title }

From the notes in the block editor handbook, you'll want to use functions that refer to the edited data rather than the current data.

'Explicit: ',
'simple-podcasting'
)}
{explicit}
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed this defaults to a blank value unless the user modifies the dropdown, it needs to default to the attributes default value

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm still seeing this.

assets/js/edit.js Outdated Show resolved Hide resolved
includes/blocks/podcast/markup.php Outdated Show resolved Hide resolved
simple-podcasting.php Outdated Show resolved Hide resolved
simple-podcasting.php Outdated Show resolved Hide resolved
@github-actions github-actions bot added the needs:refresh This requires a refreshed PR to resolve. label Mar 1, 2024
@mehidi258 mehidi258 self-assigned this Apr 7, 2024
@Sidsector9 Sidsector9 modified the milestones: 1.8.0, 1.8.1 Apr 8, 2024
@github-actions github-actions bot removed the needs:refresh This requires a refreshed PR to resolve. label Apr 8, 2024
@jeffpaul jeffpaul requested a review from peterwilsoncc April 12, 2024 18:43
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 note and provided the requested code example.

@@ -144,6 +156,19 @@ class Edit extends Component {
</BlockControls>
);

const { getCurrentPost } = select('core/editor');
const postDetails = getCurrentPost();
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you'll need to do it for the post title and show ID separately. Here's an example for the title:

// Top of file
const { select, subscribe } = wp.data;

// Around here for the post title
const { getCurrentPost, getEditedPostAttribute } = select('core/editor');

let postTitle = getEditedPostAttribute( 'title' );
subscribe( () => {
	const newPostTitle = getEditedPostAttribute( 'title' );

	if ( postTitle !== newPostTitle ) {
		postTitle = newPostTitle;
	}
});

// Below
{ postTitle } // instead of { postDetails.title }

From the notes in the block editor handbook, you'll want to use functions that refer to the edited data rather than the current data.


<div className="wp-block-podcasting-podcast__details">

{displayEpisodeNumber && episodeNumber && (
Copy link
Contributor

Choose a reason for hiding this comment

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

This causes either no/turning off the episode number to display to also hide the title. I think what you want here is a check for the episode title display.

The eposide number check should be part of line 463

assets/js/edit.js Outdated Show resolved Hide resolved
'Explicit: ',
'simple-podcasting'
)}
{explicit}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm still seeing this.

@jeffpaul jeffpaul requested a review from faisal-alvi June 10, 2024 17:56
@faisal-alvi
Copy link
Member

@Firestorm980 Could you please resolve the conflicts? Thanks!

@github-actions github-actions bot added needs:code-review This requires code review. and removed needs:feedback This requires feedback to determine next steps. labels Jun 12, 2024
faisal-alvi
faisal-alvi previously approved these changes Jun 12, 2024
@jeffpaul
Copy link
Member

@gusaus do you want to give this a test to see how it aligns to what you had in mind and whether there are any tweaks/iterations you'd recommend?

@gusaus
Copy link

gusaus commented Jun 13, 2024

@jeffpaul Thanks for keeping me looped in! Good timing as I was just circling back to this feature request OpenProducer/newspack-platform#22 for the Newspack radio branch we maintain (https://github.com/OpenProducer/newspack-platform/tree/radio).

With regards to testing, is there a particular branch we should evaluate? I tried installing the following (to a clean install of Newspack and core)
https://github.com/10up/simple-podcasting/tree/feature/issue-229-191-player-enhancements
https://github.com/10up/simple-podcasting/tree/develop

and got the same message when I tried to activate:
WordPress › Error 2024-06-13 12-14-07

As a non-coder (and still relatively new to WordPress), I could well be testing the wrong thing (and the wrong way).

That said, I'm very interested in testing, providing feedback, and potentially including in our Newspack platform!

@jeffpaul
Copy link
Member

@gusaus youll want to use the Zip action in the repo to build a plugin zip file from this PRs branch to get a good install option for testing.

@jeffpaul
Copy link
Member

@gusaus you can use this ZIP file for testing: simple-podcasting.zip

@gusaus
Copy link

gusaus commented Jun 14, 2024

@jeffpaul Thank you so much for providing the ZIP! That said, I actually researched the Zip action workflow (thanks to my friend ChatGPT) and managed to create a zip on my fork yesterday. Comparing them today, it looks like they're almost identical. I'm amazed!

With regards to testing, I've installed on a Newspack sandbox and created a few podcasts and episodes (using the Podcast block) and it seems like all the enhancements outlined in this PR are working!

Would love to see some of the other enhancements you listed in #191 go in.

  • Player bar alternate colors, likely inherited from theme
  • Ability to have player docked to header or footer location on site (some prior art with 10up's work on WAMU's site and bottom docked player experience).
  • Ability to have a playlist of all episodes in a season (or a custom list of episodes)

Considering so many publishers are podcasting, I'm wondering if there's an opportunity to work with Newspack/Automattic on integrating and including in Newspack.

@github-actions github-actions bot added the needs:refresh This requires a refreshed PR to resolve. label Jun 18, 2024
@dkotter
Copy link
Collaborator

dkotter commented Jun 18, 2024

Would love to see some of the other enhancements you listed in #191 go in.

Player bar alternate colors, likely inherited from theme
Ability to have player docked to header or footer location on site (some prior art with 10up's work on WAMU's site and bottom docked player experience).
Ability to have a playlist of all episodes in a season (or a custom list of episodes)

Thanks for testing @gusaus! After discussing internally, we're going to pull these three items out to separate issues so we can proceed with getting this PR finalized and merged.

@gusaus
Copy link

gusaus commented Jun 18, 2024

@dkotter Great to know and really appreciate all the work y'all are doing!

We've set up new branch on our Newspack platform (https://github.com/OpenProducer/newspack-platform/tree/podcast) and will continue to test provide feedback in the corresponding issues.

@github-actions github-actions bot removed the needs:refresh This requires a refreshed PR to resolve. label Jun 25, 2024
@jeffpaul jeffpaul requested a review from faisal-alvi June 26, 2024 18:15
@jeffpaul jeffpaul merged commit b4b0810 into develop Jun 27, 2024
13 checks passed
@jeffpaul jeffpaul deleted the feature/issue-229-191-player-enhancements branch June 27, 2024 13:03
@dkotter dkotter mentioned this pull request Aug 22, 2024
15 tasks
@dkotter dkotter modified the milestones: 1.8.1, 1.9.0 Nov 15, 2024
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.

Add Listening Time Block Player enhancements
9 participants