diff --git a/src/ui/mobileShell.test.mjs b/src/ui/mobileShell.test.mjs index 87286240f..c0e0b909f 100644 --- a/src/ui/mobileShell.test.mjs +++ b/src/ui/mobileShell.test.mjs @@ -977,3 +977,20 @@ test('a slow downward pull is claimed before Android native scroll takes ownersh assert.equal(shell.getSheet(), null); shell.destroy(); }); + +test('on phones the News panel shows in the Context sheet only, like Weather', () => { + const css = readFileSync( + new URL('./styles/mobile-shell.css', import.meta.url), + 'utf8', + ); + // Hidden by id: the rail's own `#news-panel:not(.collapsed)` rule outranks + // the generic `#right-context-rail > *` hiding rule. + assert.match( + css, + /body\.mobile-shell #right-context-rail > #news-panel,\n[^{}]*\{\s*display: none;/, + ); + assert.match( + css, + /body\.mobile-shell\[data-mobile-sheet='context'\]\s+#right-context-rail\s+> #news-panel:not\(\[hidden\]\),/, + ); +}); diff --git a/src/ui/styles/mobile-shell.css b/src/ui/styles/mobile-shell.css index b607391de..06811baab 100644 --- a/src/ui/styles/mobile-shell.css +++ b/src/ui/styles/mobile-shell.css @@ -156,9 +156,10 @@ body.mobile-shell[data-mobile-sheet='more'] #right-context-rail { body.mobile-shell #left-panel-stack > *, body.mobile-shell #right-context-rail > *, -/* Rail rules show expanded Weather and Recent Imagery by id; on phones they - belong to the Context sheet only. */ +/* Rail rules show expanded Weather, News and Recent Imagery by id; on phones + they belong to the Context sheet only. */ body.mobile-shell #right-context-rail > #weather-panel, +body.mobile-shell #right-context-rail > #news-panel, body.mobile-shell #right-context-rail > #recent-imagery-panel { display: none; } @@ -182,6 +183,9 @@ body.mobile-shell[data-mobile-sheet='context'] body.mobile-shell[data-mobile-sheet='context'] #right-context-rail > #weather-panel:not([hidden]), +body.mobile-shell[data-mobile-sheet='context'] + #right-context-rail + > #news-panel:not([hidden]), body.mobile-shell[data-mobile-sheet='context'] #right-context-rail > #recent-imagery-panel:not([hidden]),