Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/block-library/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
### Bug Fixes

- Footnotes: Treat unreadable `footnotes` post meta as no footnotes instead of throwing, so the block shows its placeholder rather than the block crash warning ([#81201](https://github.com/WordPress/gutenberg/pull/81201)).
- Playlist Track: Show the upload loading indicator inline with the track row.
- Playlist: Improve handling of declarative waveform player configuration ([#81342](https://github.com/WordPress/gutenberg/pull/81342)).

### Internal
Expand Down
4 changes: 3 additions & 1 deletion packages/block-library/src/playlist-track/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ const PlaylistTrackEdit = ( {
</PanelBody>
</InspectorControls>
<li { ...blockProps }>
{ !! temporaryURL && <Spinner /> }
<button
className="wp-block-playlist-track__button"
onClick={ () => setCurrentTrackClientId( clientId ) }
Expand Down Expand Up @@ -300,6 +299,9 @@ const PlaylistTrackEdit = ( {
</span>
) }
{ length }
{ !! temporaryURL && (
<Spinner className="wp-block-playlist-track__spinner" />
) }
</span>
<span className="screen-reader-text">{ __( 'Play' ) }</span>
</button>
Expand Down
8 changes: 8 additions & 0 deletions packages/block-library/src/playlist-track/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
object-fit: cover;
}

.wp-block-playlist-track__spinner {
flex: 0 0 auto;
margin: 0;
}

.wp-block-playlist-track__content {
flex: 1 1 0;
min-width: 0;
Expand All @@ -60,6 +65,9 @@
}

.wp-block-playlist-track__length {
display: flex;
align-items: center;
justify-content: flex-end;
margin-left: auto;
font-size: 0.85em;
opacity: 0.7;
Expand Down
10 changes: 9 additions & 1 deletion packages/block-library/src/playlist-track/test/edit.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fireEvent, render, screen } from '@testing-library/react';
import { fireEvent, render, screen, within } from '@testing-library/react';
import { useDispatch } from '@wordpress/data';
import PlaylistTrackEdit from '../edit';
import { PlaylistContext } from '../../playlist/context';
Expand Down Expand Up @@ -169,6 +169,7 @@ describe( 'PlaylistTrackEdit', () => {
renderEdit( {
attributes: {
blob: 'blob:https://example.com/temporary-track',
length: undefined,
src: undefined,
},
} );
Expand All @@ -178,6 +179,13 @@ describe( 'PlaylistTrackEdit', () => {
url: 'blob:https://example.com/temporary-track',
} )
);
const trackButton = screen.getByRole( 'button', {
name: /Song One/,
} );

expect(
within( trackButton ).getByRole( 'presentation', { hidden: true } )
).toBeInTheDocument();
} );

it( 'preserves the current track source when a replacement upload fails', () => {
Expand Down
Loading