fix(#5385): increase approval card height cap on mobile

The mobile command/tool approval popup rendered too small — options didn't all fit
and required scrolling within the cramped popup to select (Android WebUI wrapper).
Raises the mobile @supports(dvh) .approval-inner max-height cap from
min(52dvh,360px) to min(60dvh,420px) so the options fit without in-popup scrolling;
still overflow-y:auto so very tall content scrolls rather than clipping. Scoped to
the mobile dvh rule; desktop unaffected. Adds a source-level guard test.

Contributor stage; gate-pass. Co-authored-by: nankingjing <nankingjing@users.noreply.github.com>
This commit is contained in:
nesquena-hermes
2026-07-05 04:04:02 +00:00
parent 035e84ae00
commit 39a4d67e5c
2 changed files with 25 additions and 1 deletions
+1 -1
View File
@@ -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;}
@@ -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