Peach: Local-first video metadata scraper and media manager.
fix(web): 关注管理的排序框把弹出列表交回主题
longmeidaod3c6b3524043
diff --git a/tests/test_web_ui.py b/tests/test_web_ui.pyindex 8041aac71..aafc8a47a 100644--- a/tests/test_web_ui.py+++ b/tests/test_web_ui.py@@ -5840,6 +5840,34 @@ class WebUiSourceTests(unittest.TestCase):self.assertPageContains(".fsechead .fmeta{flex:1 1 0;min-width:0;overflow:hidden")self.assertPageContains(" .fsechead .fmeta{display:none}")+ def test_manage_sort_select_lets_the_active_theme_decide_its_option_list(self):+ """排序框的原生弹出列表跟随当前主题,控件自己不声明 color-scheme。++ `color-scheme` 是继承属性,两条主题选择路径(prefers-color-scheme 与+ `:root[data-theme]`)都已经把它落在 `html` 上。控件再声明一档,浅色主题下就出现+ 闭合的框是浅底、展开的选项列表是深底浅字的两套配色。+ """+ css = stylesheet_source()+ start = css.index(".fmanagesort select{")+ rule = css[start:css.index("}", start)]+ for declaration in ("background:var(--surface)", "color:var(--ink-2)"):+ self.assertIn(declaration, rule, f".fmanagesort select 缺少 {declaration}")+ self.assertNotIn("color-scheme", rule, ".fmanagesort select 不该自己声明 color-scheme")+ # 主题两条路径都把 color-scheme 落在 `html`,控件靠继承拿到它。+ self.assertPageContains("html{color-scheme:light")+ self.assertPageContains(+ '@media (prefers-color-scheme:dark){html:not([data-theme="light"]){color-scheme:dark}}')+ self.assertPageContains('html[data-theme="dark"]{color-scheme:dark}')+ # 自绘箭头由后面的规则给 background-image,而这条规则的 background 简写会清掉它:+ # 两者的层叠顺序反过来,下拉就只剩一个空的右内边距。+ self.assertLess(+ start, css.index(".settingrow select,.tasteactions select,.fmanagesort select{"),+ "自绘箭头必须排在 .fmanagesort select 的 background 简写之后")+ # 高度不收进 --control-h:这一行的按钮和版式开关都在 32px 上,排序框单独抬一档+ # 就是同一行里出现两种「同一种控件」。+ self.assertIn("height:32px", rule, ".fmanagesort select 与标题行同高")+ self.assertPageContains("gap:6px;height:32px")+def test_destructive_buttons_fill_red_on_hover(self):"""危险动作的悬停态一律是 --drop 实底加白字,全站一个写法。diff --git a/web/css/22-followmanage.css b/web/css/22-followmanage.cssindex af2d83945..73ad93fac 100644--- a/web/css/22-followmanage.css+++ b/web/css/22-followmanage.css@@ -44,8 +44,11 @@/* 版式开关和排序框、按钮同处分区标题行,收到同一个 32px 高度上(fieldset 自带 1px 边框)。 */.fsechead .iconswitch{display:inline-flex;gap:2px;flex:none;padding:2px}.fsechead .iconswitch label{width:32px;height:26px}+/* 原生弹出的选项列表由 color-scheme 决定,而 color-scheme 是继承属性:01-base.css 把+ prefers-color-scheme 和 `[data-theme]` 两条选择路径都映射到 `html`,控件这里只声明颜色。+ 在控件上单独写一档,浅色主题下闭合的框是浅底,展开的选项列表是深底浅字。 */.fmanagesort select{height:32px;padding:0 10px;border:1px solid var(--border-15);border-radius:var(--control-radius);- background:var(--surface);color:var(--ink-2);font:inherit;font-size:var(--fs-sm);color-scheme:dark;cursor:pointer}+ background:var(--surface);color:var(--ink-2);font:inherit;font-size:var(--fs-sm);cursor:pointer}.fmanagesort select:focus-visible{outline:2px solid var(--tungsten);outline-offset:2px}/* 全站原生下拉共用同一个自绘箭头。SVG 笔画自身有 4px 透明边,背景右移 6px 后,可见笔画到右边框正好与文字到左边框同为 10px。 */