Skip to content

Move AudioLayout to grid - #16133

Merged
frederickobrien merged 8 commits into
mainfrom
move-audio-layout-to-grid
Jul 28, 2026
Merged

Move AudioLayout to grid#16133
frederickobrien merged 8 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. The changes here are built atop some general tidying/refactoring of how audio player components work in #16339.

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Merging into MainMedia makes sense imo, the video play is handled there for video pages, right?

@frederickobrien frederickobrien Jul 24, 2026

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 I'm with you - have had a stab in 01e8d98.

Edit: I get the impression there's a deeper discussion to be had about where best to house the audio player (something else handled by renderElement perhaps) though I'd argue that discussion and any subsequent changes are beyond the scope of this pull request and warrant their own

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah I'm with you - have had a stab in 01e8d98.

Edit: I get the impression there's a deeper discussion to be had about where best to house the audio player (something else handled by renderElement perhaps) though I'd argue that discussion and any subsequent changes are beyond the scope of this pull request and warrant their own

Right that's nicer already! But to expand on what Jamie said I think the AudioPlayer could be added here https://github.com/guardian/dotcom-rendering/blob/main/dotcom-rendering/src/lib/renderElement.tsx#L992, to let renderElement handle it and remove the separate handling for it altogether.

@frederickobrien frederickobrien Jul 24, 2026

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.

Very well. I've had a stab at it in 2dae763 and broken out the change into its own PR here as it feels like a separate (though complimentary) refactor to this grid business: #16456

@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
Comment thread dotcom-rendering/src/components/AudioPlayer.tsx Outdated
@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

@frederickobrien
frederickobrien force-pushed the move-audio-layout-to-grid branch from c067d5e to 78b4938 Compare July 24, 2026 15:18
@frederickobrien frederickobrien added the run_chromatic Runs chromatic when label is applied label Jul 24, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jul 24, 2026
@frederickobrien
frederickobrien force-pushed the move-audio-layout-to-grid branch 2 times, most recently from d8133d0 to e49a970 Compare July 28, 2026 09:27
@frederickobrien frederickobrien added the run_chromatic Runs chromatic when label is applied label Jul 28, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jul 28, 2026
@frederickobrien
frederickobrien force-pushed the move-audio-layout-to-grid branch from 0af5484 to ad4d486 Compare July 28, 2026 13:04
@frederickobrien frederickobrien added the run_chromatic Runs chromatic when label is applied label Jul 28, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jul 28, 2026
@frederickobrien
frederickobrien added this pull request to the merge queue Jul 28, 2026
Merged via the queue into main with commit fe1edc3 Jul 28, 2026
31 checks passed
@frederickobrien
frederickobrien deleted the move-audio-layout-to-grid branch July 28, 2026 13:26
@gu-prout

gu-prout Bot commented Jul 28, 2026

Copy link
Copy Markdown

Seen on PROD (merged by @frederickobrien 12 minutes and 41 seconds ago) Please check your changes!

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 Seen-on-PROD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants