File tree Expand file tree Collapse file tree
scripts/generate-news-indexes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -244,11 +244,13 @@ describe('News Page - Navigation', () => {
244244 it ( 'should support language switching on news page' , ( ) => {
245245 cy . visit ( '/news/' ) ;
246246
247- // Try to switch to Swedish version
247+ // Try to switch to Swedish version. The canonical chrome renders the
248+ // top-of-page lang switcher inside a collapsed <details> dropdown, so
249+ // filter to the visible anchor (footer language row, or open dropdown).
248250 cy . get ( 'body' ) . then ( ( $body ) => {
249251 const svLink = $body . find ( 'a[href*="index_sv.html"]' ) ;
250252 if ( svLink . length > 0 ) {
251- cy . get ( 'a[href*="index_sv.html"]' ) . first ( ) . click ( ) ;
253+ cy . get ( 'a[href*="index_sv.html"]:visible ' ) . first ( ) . click ( ) ;
252254 cy . url ( ) . should ( 'include' , 'index_sv.html' ) ;
253255 } else {
254256 cy . log ( 'Swedish language link not found - skipping language switch test' ) ;
Original file line number Diff line number Diff line change @@ -183,6 +183,14 @@ export function generateIndexHTML(
183183 const body = ` <div class="container">
184184${ needsLanguageNotice ? generateLanguageNotice ( langKey ) : '' }
185185
186+ <!-- Page heading (canonical chrome puts brand only in <header>; the
187+ news-index page itself owns the document <h1> for a11y heading
188+ hierarchy and SEO, matching sitemap.html and political-intelligence.html). -->
189+ <header class="news-page-heading">
190+ <h1>${ escapeHtml ( lang . title ) } </h1>
191+ <p class="news-page-subtitle">${ escapeHtml ( lang . subtitle ) } </p>
192+ </header>
193+
186194 <!-- Filter Bar -->
187195 <div class="filter-bar">
188196 <div class="filter-group">
Original file line number Diff line number Diff line change @@ -12235,12 +12235,21 @@ html[data-theme="light"] .footer-disclaimer a {
1223512235 border-radius : 6px ;
1223612236 padding : 0.5rem ;
1223712237 box-shadow : 0 8px 24px rgba (0 , 0 , 0 , 0.5 );
12238- display : flex;
12238+ /* Hidden by default so the closed <details> doesn't leave dropdown
12239+ anchors as click targets (Cypress would otherwise hit them through
12240+ the sticky rm-site-header). The class selector previously beat the
12241+ UA-default `details:not([open]) > *:not(summary) { display: none }`
12242+ rule and forced the dropdown visible even when collapsed. */
12243+ display : none;
1223912244 flex-direction : column;
1224012245 gap : 0.125rem ;
1224112246 z-index : 120 ;
1224212247}
1224312248
12249+ .rm-lang-switcher [open ] > .rm-lang-switcher-dropdown {
12250+ display : flex;
12251+ }
12252+
1224412253.rm-lang-switcher-dropdown a {
1224512254 color : var (--light-text , # e0e0e0 );
1224612255 text-decoration : none;
You can’t perform that action at this time.
0 commit comments