Skip to content

armgit / peach

Public Imported from GitHub
0

Peach: Local-first video metadata scraper and media manager.

fix(web): 确认弹层在窄屏按 Geist 的 20px 边距铺开

longmeidao0ee4fb239acf
diff --git a/tests/test_web_ui.py b/tests/test_web_ui.py
index 08ed3caba..5ee7ef7e3 100644
--- a/tests/test_web_ui.py
+++ b/tests/test_web_ui.py
@@ -3970,8 +3970,9 @@ class WebUiSourceTests(unittest.TestCase):
# 实测 https://vercel.com/geist/modal(2026-09-04),见
# docs/reference-snapshots/vercel-geist-modal-measured.md。
self.assertPageContains(
- ".geist-modal{box-sizing:border-box;width:min(540px,calc(100vw - 20px));"
- "max-height:min(800px,80vh);")
+ ".geist-modal{box-sizing:border-box;width:min(540px,calc(100vw - 20px));")
+ # <dialog> 的 UA 样式带一条更小的 max-width,窄屏上会把卡片再压窄十几像素。
+ self.assertPageContains("max-width:min(540px,calc(100vw - 20px));max-height:min(800px,80vh);")
self.assertPageContains("border-radius:var(--floating-radius);")
# 遮罩纯黑不带模糊:Geist 的 backdrop 没有 blur。
self.assertPageContains(".geist-modal::backdrop{background:#0009;opacity:0;")
diff --git a/web/css/01-base.css b/web/css/01-base.css
index 48ac6bfeb..1331e5787 100644
--- a/web/css/01-base.css
+++ b/web/css/01-base.css
@@ -186,7 +186,10 @@ button[aria-busy="true"],[role="button"][aria-busy="true"]{
540px 宽、12px 圆角、窄屏两侧各留 10px,正文 20px 内边距,操作条粘在底、12px 内边距、
两端对齐,遮罩纯黑不带模糊。淡入用它给出的 .3s cubic-bezier(.175,.885,.32,1.1);
它同时过渡 transform,起始值未取得,所以这里只做透明度。 */
-.geist-modal{box-sizing:border-box;width:min(540px,calc(100vw - 20px));max-height:min(800px,80vh);
+.geist-modal{box-sizing:border-box;width:min(540px,calc(100vw - 20px));
+ /* max-width 要自己写死:<dialog> 的 UA 样式带一条 calc((100% - 6px) - 2em),
+ 窄屏上它比 Geist 的 calc(100vw - 20px) 更小,卡片会莫名再窄十几像素。 */
+ max-width:min(540px,calc(100vw - 20px));max-height:min(800px,80vh);
padding:0;border:0;border-radius:var(--floating-radius);
background:var(--surface);color:var(--ink);overflow:hidden auto;overscroll-behavior:contain;
box-shadow:0 0 0 1px var(--border-15),0 32px 72px -12px #0009,0 8px 32px -12px #0009;