Skip to content

Add playlist track length setting#78954

Merged
jeryj merged 1 commit into
WordPress:trunkfrom
scruffian:scruffian/showtracklength-prop
Jun 4, 2026
Merged

Add playlist track length setting#78954
jeryj merged 1 commit into
WordPress:trunkfrom
scruffian:scruffian/showtracklength-prop

Conversation

@scruffian
Copy link
Copy Markdown
Contributor

@scruffian scruffian commented Jun 4, 2026

What?

Extracted from #75060.

Adds a showTrackLength setting to the Playlist block so track lengths can be hidden in the tracklist.

Why?

This extracts the independent track length visibility change from the larger playlist waveform work so it can be reviewed separately.

How?

The PR adds a showTrackLength boolean attribute, exposes it in the Playlist settings panel, applies hidden-length classes in editor and saved markup, and adds CSS to hide .wp-block-playlist-track__length when disabled.

Testing Instructions

  1. Open the editor and insert a Playlist block with audio tracks.
  2. Open the Playlist block settings.
  3. Toggle "Show track length in Tracklist" off and confirm track lengths are hidden.
  4. Toggle it back on and confirm track lengths are shown again.

Testing Instructions for Keyboard

  1. Use the keyboard to focus the Playlist block.
  2. Open block settings and tab to "Show track length in Tracklist".
  3. Toggle it with the keyboard and confirm the track length visibility changes.

Screenshots or screencast

Jun-04-2026 16-18-30

Use of AI Tools

This PR was prepared with assistance from OpenAI Codex. I reviewed the diff and am responsible for the changes.

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Jun 4, 2026
@scruffian scruffian changed the title [codex] Add playlist track length setting Add playlist track length setting Jun 4, 2026
scruffian added a commit that referenced this pull request Jun 4, 2026
The show-track-length toggle moved to its own PR
(#78954), so remove the
showTrackLength attribute, its Tracklist toggle, the
tracklist-length-is-hidden class wiring (edit + save), and the
corresponding style rule. The track length itself is unchanged. Docs
regenerated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@scruffian scruffian marked this pull request as ready for review June 4, 2026 15:12
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: scruffian <scruffian@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@scruffian scruffian self-assigned this Jun 4, 2026
@scruffian scruffian added [Block] Playlist [Type] Enhancement A suggestion for improvement. labels Jun 4, 2026
Copy link
Copy Markdown
Contributor

@jeryj jeryj left a comment

Choose a reason for hiding this comment

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

This follows existing conventions, and works as described. I tested both options (with and without time shown).

Hiding the time on the frontend works well too. Using display: none on the wrapper should remove the length from being announced by the screen reader as well.

@jeryj jeryj merged commit d46d47c into WordPress:trunk Jun 4, 2026
50 of 55 checks passed
@github-actions github-actions Bot added this to the Gutenberg 23.4 milestone Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Playlist [Package] Block library /packages/block-library [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants