Skip to content

Move AudioLayout to grid#16133

Open
frederickobrien wants to merge 5 commits into
mainfrom
move-audio-layout-to-grid
Open

Move AudioLayout to grid#16133
frederickobrien wants to merge 5 commits into
mainfrom
move-audio-layout-to-grid

Conversation

@frederickobrien

@frederickobrien frederickobrien commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Following on from #15428 and #16119, this absorbs AudioLayout into the grid system. I've extracted the audio player into its own component to keep things tidy.

Open question: I started implementing it but thought it was worth asking the question. Why is the body wider for video articles than for audio ones? This only occurs at the wide breakpoint and to my mind seems needless. If we align their appearance both can be quite happily accommodated by the media grid layout.

Why?

Less code, fewer headaches, reduced existential dread.

Screenshots

Before After
before1 after1
before2 after2

@frederickobrien frederickobrien self-assigned this Jun 11, 2026
@frederickobrien frederickobrien added the maintenance Departmental tracking: maintenance work, not a fix or a feature label Jun 11, 2026
@frederickobrien frederickobrien added this to the Interactives milestone Jun 11, 2026
@frederickobrien frederickobrien force-pushed the move-audio-layout-to-grid branch from d8a8ce0 to 7ab3d37 Compare June 11, 2026 17:01
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

@frederickobrien frederickobrien force-pushed the move-audio-layout-to-grid branch from bb701eb to 33da9a8 Compare June 23, 2026 13:30
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

@frederickobrien frederickobrien marked this pull request as ready for review June 23, 2026 13:45
@github-actions

Copy link
Copy Markdown

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@frederickobrien frederickobrien added the run_chromatic Runs chromatic when label is applied label Jun 23, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jun 23, 2026
@frederickobrien frederickobrien requested a review from a team June 23, 2026 16:05
@frederickobrien frederickobrien force-pushed the move-audio-layout-to-grid branch from 44275d5 to 93243d7 Compare June 28, 2026 19:58
ArticleDisplay[format.display]
}Layout`}
/>
{audioData ? (

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Alternatively this fork could (should?) happen inside <MainMedia /> as the audio player here is just a different type of main media. As far as I can tell it's not used anywhere else.

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.

I think that will ultimately mean the AudioBlockElement gets handled in renderElement along with most other kinds of element? Perhaps then we won't need the separate audio-data.ts file?

One caveat is that renderElement will also get used for body elements. I don't know if @oliverabrahams is aware of a reason we wanted to avoid this when implementing audio articles?

@frederickobrien frederickobrien force-pushed the move-audio-layout-to-grid branch 2 times, most recently from 0bc3a39 to 76e769a Compare June 30, 2026 09:47
@frederickobrien frederickobrien added the run_chromatic Runs chromatic when label is applied label Jun 30, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jun 30, 2026
@frederickobrien frederickobrien force-pushed the move-audio-layout-to-grid branch 2 times, most recently from 961b98a to 546b54a Compare July 3, 2026 09:14
Comment thread dotcom-rendering/src/layouts/StandardLayout.stories.tsx
ArticleDisplay[format.display]
}Layout`}
/>
{audioData ? (

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.

I think that will ultimately mean the AudioBlockElement gets handled in renderElement along with most other kinds of element? Perhaps then we won't need the separate audio-data.ts file?

One caveat is that renderElement will also get used for body elements. I don't know if @oliverabrahams is aware of a reason we wanted to avoid this when implementing audio articles?

Comment thread dotcom-rendering/src/layouts/StandardLayout.tsx Outdated
Comment thread dotcom-rendering/src/layouts/StandardLayout.tsx Outdated
import { AudioPlayerWrapper } from './AudioPlayerWrapper.island';
import { formatAudioDuration } from './ListenToArticle.island';

export const AudioPlayer = ({

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.

If I've understood this correctly, the component hierarchy now looks like this?

AudioPlayer.tsx
    AppsAudioPlayer.island.tsx (the apps version)
    AudioPlayerWrapper.island.tsx (the web version)
        AudioPlayer/AudioPlayer.tsx

Could this be considered a little confusing, and can we simplify it? I'm happy to discuss approaches if helpful.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah fair shout. I've changed the top level one so it now essentially flows like this:

DecideAudioPlayer.tsx
    AppsAudioPlayer.island.tsx (the apps version)
    AudioPlayerWrapper.island.tsx (the web version)
        AudioPlayer/AudioPlayer.tsx

Beyond that I'm very happy to have a go at simplifying though I'd argue that opportunity predates this pull request and probably warrants its own, separate one?

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.

I think prior to this change the apps/web components could have been refactored a bit, but this PR adds an additional wrapper component into the mix? But yeah, a separate PR sounds reasonable!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah what the hell, I've given it a go in 78810ec. With those changes the flow becomes:

AudioPlayer.tsx
    AudioPlayerApps.island.tsx (the apps version)
    AudioPlayerWeb.island.tsx (the web version)

Much tidier!

Happy to to move out into a separate PR if this one's starting to feel a bit involved but that's the crux of the change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've spun up a standalone PR with those changes to keep things tidy: #16339

@frederickobrien frederickobrien force-pushed the move-audio-layout-to-grid branch from a1a3536 to b63fee8 Compare July 7, 2026 13:55
@frederickobrien frederickobrien added the run_chromatic Runs chromatic when label is applied label Jul 7, 2026
@frederickobrien frederickobrien force-pushed the move-audio-layout-to-grid branch 3 times, most recently from 60f41d3 to 1add331 Compare July 7, 2026 14:09
@frederickobrien

Copy link
Copy Markdown
Contributor Author

@copilot please rebase this PR and resolve conflicts

Copilot AI commented Jul 7, 2026

Copy link
Copy Markdown

@copilot please rebase this PR and resolve conflicts

I rebased and resolved the conflicts locally at 01d136b, but I couldn't publish the rewritten branch through the available push tool because it won't force-push a rebased PR branch and its fallback rebase against origin/move-audio-layout-to-grid hit conflicts. The local result is clean and validated; this branch needs a manual force-push (or equivalent) to update the PR.

@frederickobrien frederickobrien force-pushed the move-audio-layout-to-grid branch from 78810ec to a2c6ceb Compare July 7, 2026 15:32
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Departmental tracking: maintenance work, not a fix or a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants