From 398d6d767e95e58aff68498ac83e7453b4d7496f Mon Sep 17 00:00:00 2001 From: Sherv Date: Wed, 18 Nov 2026 02:47:49 +0300 Subject: [PATCH 1/2] Render the latest post tile titles as level 4 headings. The three tiles sit under the level 3 heading "Latest post performance since published". A screen reader now lists their titles inside that section, not beside it. A new test checks the level of each heading in the section. Their look stays the same. Their class styles set the colour, the font size and the margin, which WordPress sets differently for an `h3` and an `h4`. --- .../LatestPostPerformance.test.tsx | 26 +++++++++++++++++++ .../recent-activity/LatestPostTile.tsx | 1 + 2 files changed, 27 insertions(+) diff --git a/assets/js/modules/analytics-4/components/traffic-overview/recent-activity/LatestPostPerformance.test.tsx b/assets/js/modules/analytics-4/components/traffic-overview/recent-activity/LatestPostPerformance.test.tsx index b65837f43ab..a3287210c16 100644 --- a/assets/js/modules/analytics-4/components/traffic-overview/recent-activity/LatestPostPerformance.test.tsx +++ b/assets/js/modules/analytics-4/components/traffic-overview/recent-activity/LatestPostPerformance.test.tsx @@ -171,6 +171,32 @@ describe( 'LatestPostPerformance', () => { ] ); } ); + it( 'should render the titles of the tiles as headings one level below the heading of the section', async () => { + provideLatestPostKeywordReport( registry ); + + const { getAllByRole, waitForRegistry } = render( + , + { registry } + ); + + await waitForRegistry(); + + expect( + getAllByRole( 'heading', { level: 3 } ).map( + ( heading ) => heading.textContent + ) + ).toEqual( [ 'Latest post performance since published' ] ); + expect( + getAllByRole( 'heading', { level: 4 } ).map( + ( heading ) => heading.textContent + ) + ).toEqual( [ + 'Visitor breakdown', + 'Traffic sources', + 'Engagement & outcomes', + ] ); + } ); + it( 'should request the top keyword for the post URL on the reference site, and should keep the Analytics rows, when the reference site URL differs from the home URL', async () => { provideSiteInfo( registry, { homeURL: 'https://example.com/', diff --git a/assets/js/modules/analytics-4/components/traffic-overview/recent-activity/LatestPostTile.tsx b/assets/js/modules/analytics-4/components/traffic-overview/recent-activity/LatestPostTile.tsx index 6e61bb9557a..5b2c3cf9271 100644 --- a/assets/js/modules/analytics-4/components/traffic-overview/recent-activity/LatestPostTile.tsx +++ b/assets/js/modules/analytics-4/components/traffic-overview/recent-activity/LatestPostTile.tsx @@ -37,6 +37,7 @@ const LatestPostTile: FC< LatestPostTileProps > = ( { title, children } ) => { baseClassName="googlesitekit-table-tile" className="googlesitekit-traffic-overview__latest-post-tile" title={ title } + titleAs="h4" > { children } From 4a7b10f5ee65459bd0fce1769c5b7ddc8d38effe Mon Sep 17 00:00:00 2001 From: Sherv Date: Wed, 18 Nov 2026 02:47:49 +0300 Subject: [PATCH 2/2] Reword the doc line of `titleAs` in `TileShell`. It named one use, a tile under an `h3` heading. It now says what the prop is, in the words `TableTile` gives the same prop. --- .../modules/analytics-4/components/common/tiles/TileShell.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/modules/analytics-4/components/common/tiles/TileShell.tsx b/assets/js/modules/analytics-4/components/common/tiles/TileShell.tsx index 9498e76e06f..8b95b1dfcca 100644 --- a/assets/js/modules/analytics-4/components/common/tiles/TileShell.tsx +++ b/assets/js/modules/analytics-4/components/common/tiles/TileShell.tsx @@ -35,7 +35,7 @@ export interface TileShellProps { className?: string; /** Tile title, shown as the heading element that `titleAs` sets. */ title: ReactNode; - /** Heading element of the title, `h3` by default, or `h4` for a tile under an `h3` heading. */ + /** Heading element of the title, `h3` by default. */ titleAs?: 'h3' | 'h4'; /** Label at the end of the header, such as a column name. */ headerLabel?: string;