diff --git a/assets/components.css b/assets/components.css index 729f73e..8d4b50e 100644 --- a/assets/components.css +++ b/assets/components.css @@ -1741,7 +1741,11 @@ download-fields { inline-size: 100%; margin-inline: 0; - overflow: visible; + + /* The slides beside the current one sit a card's width off to either + side, which would widen the page and have a phone zoom out to fit + them. Clipped across only, so the card's shadow still shows. */ + overflow: clip visible; } } diff --git a/tests/test_homepage.py b/tests/test_homepage.py index f92efa9..5264681 100644 --- a/tests/test_homepage.py +++ b/tests/test_homepage.py @@ -60,6 +60,30 @@ def test_the_featured_mods_are_the_ones_picked( expect(featured).not_to_contain_text("Not Picked") +def test_the_carousel_does_not_widen_a_phones_page( + browser, actor: Actor, appview: Appview, starhaven_binary: Path +): + """The slides beside the current one sit off the screen, and a phone + zooms out to fit anything that does.""" + actor.login() + actor.create_mod("master-quest", title="Master Quest") + actor.create_mod("black-pit", title="Black Pit") + feature( + starhaven_binary, appview, f"{actor.handle}/master-quest", f"{actor.handle}/black-pit" + ) + + context = browser.new_context( + viewport={"width": 390, "height": 844}, is_mobile=True, has_touch=True + ) + try: + page = context.new_page() + page.goto(appview.url) + expect(page.locator(".featured-slide-current")).to_be_visible() + assert page.evaluate("[innerWidth, visualViewport.scale]") == [390, 1] + finally: + context.close() + + def test_without_scripts_the_first_featured_mod_shows( browser, actor: Actor, appview: Appview, starhaven_binary: Path ):