diff --git a/static/style.css b/static/style.css index 04d4ca8a0..c04e8f2a4 100644 --- a/static/style.css +++ b/static/style.css @@ -3159,7 +3159,7 @@ /* Approval card */ .approval-card{padding-left:10px;padding-right:10px;bottom:8px;overflow:visible;} .approval-inner{max-height:min(52vh,360px);overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:12px 12px 14px;border-radius:12px;box-shadow:0 -10px 30px rgba(0,0,0,.24);} - @supports (height:100dvh){.approval-inner{max-height:min(52dvh,360px);}} + @supports (height:100dvh){.approval-inner{max-height:min(60dvh,420px);}} .approval-header{margin-bottom:8px;} .approval-collapse,.approval-dismiss{width:44px;height:44px;line-height:1;overflow:hidden;} .approval-cmd{max-height:86px;margin-bottom:10px;} diff --git a/tests/test_issue5539_mobile_approval_card_height.py b/tests/test_issue5539_mobile_approval_card_height.py new file mode 100644 index 000000000..bb921743b --- /dev/null +++ b/tests/test_issue5539_mobile_approval_card_height.py @@ -0,0 +1,24 @@ +"""#5385 / #5539: the mobile approval card must give command/tool approval +options enough height so they don't require scrolling within a cramped popup. + +The mobile (@supports height:100dvh) rule caps .approval-inner height; the fix +raises that cap from min(52dvh,360px) to min(60dvh,420px). Source-level guard so +the taller cap can't silently regress. +""" + +from pathlib import Path + +ROOT = Path(__file__).resolve().parent.parent +STYLE = (ROOT / "static" / "style.css").read_text(encoding="utf-8") + + +def test_mobile_approval_inner_dvh_cap_raised(): + # The dvh-based cap must be the raised value, not the old cramped one. + assert "max-height:min(60dvh,420px)" in STYLE + assert "max-height:min(52dvh,360px)}" not in STYLE.replace(" ", "") + + +def test_mobile_approval_inner_still_scrolls_as_fallback(): + # The non-dvh fallback keeps overflow-y:auto so very tall content still + # scrolls rather than clipping (the cap is a ceiling, not a fixed height). + assert "overflow-y:auto" in STYLE