Skip to content

armgit / peach

Public Imported from GitHub
0

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

fix(web): 顶栏外壳对 iOS 状态栏取色不可见,滚动后状态栏仍透出内容

longmeidao082955a32c3e
diff --git a/tests/test_web_ui.py b/tests/test_web_ui.py
index 5cae90fa8..3012bca4f 100644
--- a/tests/test_web_ui.py
+++ b/tests/test_web_ui.py
@@ -7871,6 +7871,15 @@ class WebUiSourceTests(unittest.TestCase):
self.assertIn(" .stage{inset:calc(env(safe-area-inset-top) + 8px) 8px auto;margin:0 auto;", board)
self.assertIn(" max-height:calc(100dvh - env(safe-area-inset-top) - 16px)}", board)
+ def test_top_bar_shell_is_invisible_to_ios_status_bar_tinting(self):
+ """通栏吸顶的 `<header>` 永远落在 iOS 26 Safari 给状态栏取色的那一点上,取到过一次颜色就一直沿用。
+ 顶栏本身 visibility:hidden,直接子元素各自成层保持可见,WebKit 就把这条栏判成不可见的容器跳过;
+ ::before 铺满接住按钮间隙的点按。"""
+ board = (Path(__file__).resolve().parents[1] / "web/board.css").read_text(encoding="utf-8")
+ self.assertIn(".top.top{visibility:hidden}\n"
+ ":where(.top>*){visibility:visible;position:relative}\n"
+ ".top::before{content:'';position:absolute;inset:0;z-index:-1;visibility:visible}\n", board)
+
def test_card_hover_hides_source_and_duration_and_missing_size_is_explicit(self):
self.assertPageContains('.card:hover .badge,.card:hover .dur{opacity:0}')
# max-height 兜住 WebKit:标题里的番号块是 inline-flex,line-clamp 在那里不截。
diff --git a/web/board.css b/web/board.css
index 3793182fa..a8feb4305 100644
--- a/web/board.css
+++ b/web/board.css
@@ -369,6 +369,15 @@ html.board-high-contrast .board-filter-frame.board-filter-frame.board-filter-fra
.gridstack .card:not(.junkcard) .pic{border-radius:12px;overflow:hidden}
.gridstack>.grid{row-gap:24px;column-gap:16px}
.top{isolation:isolate}
+/* 顶栏本身 visibility:hidden,只让里面的控件可见。iOS 26 的 Safari 在状态栏下沿正中命中元素,顺着祖先找第一个
+ fixed/sticky 容器给状态栏上色:这条通栏吸顶的 `<header>` 永远被选中,头一次取到页面底色就一直沿用,状态栏
+ 变成一条实色,内容透不上去。WebKit 判容器是否可见只看它自己画的内容,自带图层的后代不算,所以直接子元素都
+ 带上 position 各自成层;`:where` 不占特异性,已有的定位和隐藏规则照旧生效。空的 ::before 铺满整条接住按钮
+ 间隙的点按,不让它落到栏下面的卡片上。门槛见 WebKit LocalFrameView::fixedContainerEdges 与
+ RenderLayer::computeHasVisibleContent。 */
+.top.top{visibility:hidden}
+:where(.top>*){visibility:visible;position:relative}
+.top::before{content:'';position:absolute;inset:0;z-index:-1;visibility:visible}
body.board-scrolled .top{box-shadow:none;border-bottom:0}
/* 吸顶那一刻这块板离开纸面往上抬一档,三层影跟着加重:它盖住内容滚过去,两层之间
要有东西说明谁在上面。类名写三遍是为了压过上面那组玻璃规则——两条都从