Skip to content

armgit / peach

Public Imported from GitHub
0

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

feat(web): 对齐 Geist 语义控件,报错透传上游原因

longmeidao509efca260d2
diff --git a/AGENTS.md b/AGENTS.md
index c77c3c43d..bcfc5c43b 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -68,6 +68,7 @@
- 新增、恢复或重写实现前必须按 `peach-reuse-first` 依次检查当前树、`docs/REUSE.md`、Git 历史和成熟外部实现,并用真实输入做最小 POC;只有外部方案不满足已验证约束时才自研,并把例外写回复用清单。旧文件名不存在不等于能力缺失。
- When the user says to imitate, reference or align with another product, obtain current reproducible evidence first and register it per `peach-reference-evidence`. If evidence is unavailable, write `未取得`; do not ship a guessed approximation as a faithful reproduction.
- Never require the user to relay implementation details between agents. Put current facts in `docs/STATUS.md`, durable rules in `docs/HANDOFF.md`/`docs/REUSE.md`, procedures in a skill, and architecture decisions in an ADR.
+- 截图与视觉验收的画面保护:审查遮挡(设置面板「安全」组,`#censorSetting`,localStorage `peach-censor`)默认关闭、不在导航栏。只有当本轮截图会交给会审查内容的模型(自动视觉审查/外发工具)时才开启;开完记得关。普通个人浏览一律不遮挡。
- During concurrent code work, the main `peach-app` checkout is integration-only. Each agent works in an isolated Git worktree created by `scripts/agent_worktree.py create` under `peach-worktrees/`, never anywhere else and never in the main checkout; a worker commits its branch and reports it ready, but never merges itself. Before every commit confirm you are still in that worktree — `git rev-parse --show-toplevel` must not be the main checkout. Details in `peach-worktree`.
- Never use `git add .`, `git add -A`, a directory path, or a glob in an agent checkout. Stage only the exact files owned by the task, then inspect `git diff --cached --name-status`. Implementation and its tests must be committed atomically.
- Run the relevant functional scope from `README.md` before committing: `scripts/test.ps1` on Windows, `scripts/test.sh` on macOS. Cross-domain, migration, shared-harness, dependency, build/release, or broad changes require `full`; both platform entry contracts must stay green.
diff --git a/docs/STATUS.md b/docs/STATUS.md
index e0ffa37a7..5bd61bb25 100644
--- a/docs/STATUS.md
+++ b/docs/STATUS.md
@@ -36,6 +36,7 @@
## 本批修正与验证
+- 2026-08-29 按用户设计复核(对齐 Vercel Geist 与后台 dashboard,取证 `docs/reference-snapshots/vercel-geist-semantics-measured.md`,浏览器 getComputedStyle 实测)修一批界面与反馈:检查失败的报错带明确原因——rule34.xxx 限流(HTTP 200 + "limit of 60 requests every 60 second(s)" 正文)识别为「触发频率限制:每 60 秒最多 60 次」,429 报「请求过于频繁」,网络错误带异常摘要,非 JSON 带正文摘要;连接器统一走 `_upstream_reason`/`_body_snippet`。检查失败报告条改为 danger 语义(红发丝边 + 微红底,去掉左侧粗条),关注页 `.fwarn` 补 14px 下间距消除贴身;来源行 ok/error 改 Geist 低饱和状态徽章 `.sbadge`(顺带修掉 `--success` 变量从未定义、`.resourcesources .online` 静默失效的既有 bug);「全部标记已看/全部忽略」按用户回执回到计数行内(inline-flex,不另起一行);清空回收站改 danger 色按钮。审查遮挡移出导航栏:开关移入设置面板「安全」组,默认关闭,只在与会审查内容的模型的测试会话开启,规则写入 AGENTS.md;主题字体栈全部补 CJK sans(`Bahnschrift,sans-serif` 短栈在中文 Chrome 落宋体)。设置面板选项分六组(浏览/播放/搜索/关注/界面/安全);统计/口味/复核/高清版限宽 1004px 居中(对齐后台设置列 914px 实测),浏览页保持全宽,页面表面经 `body[data-surface]` 驱动。PikPak 图标改用官方 `mypikpak.com/apple-touch-icon.png`。follow 432 项、catalog 408 项通过;浏览器实测:默认不遮挡、设置开关链路生效、徽章配色、批量同 行、限宽 1004px、PikPak 图标加载。
- 2026-08-29 关注 tag 反转义修复(`70a6216`)已切换到生产:正式 EXE 替换为 SHA-256 `1EA6C18BEC9D30ED8D5D54F5F4B473F1400B3DCC9426CB37D1B3623AABF4A481`,上版备份为 `dist/Peach/Peach.pre-70a6216-20260829-181842.exe`(SHA-256 `FCD54E557D9FE36FE3D3B0FFC50E486701CA5B990334A280F203691BF94EC9B0`)。打包入口在真实数据根确认 22 个迁移、0 待处理;全量 1215 项通过后按 `replace_windows_tray` 受控换装,替换助手曾因备份文件未预建拒绝一次(服务树与托盘已停、生产短暂离线约 1 分钟),补齐备份后换装成功。新托盘重新拉起服务,80/443 由新子进程接管,`/healthz` 返回 0.7.13、writer、非只读。线上 `/api/follow` 脏 tag/标题 0 命中,`miqo'te`、`y'shtola` 正常渲染;关注详情点 `miqo'te` 胶囊精确过滤 2 条。替换期间未触发关注检查、未写 ledger。
- 2026-08-29 修关注页 tag 转义(用户报告 `'` 显示成 `'`):rule34.xxx 的 dapi 返回 HTML 转义形态,实体原样入库、页面二次转义后显示成字面量;真实账本 132 行中招(131 行 rule34xxx 的 tags、12 行标题、3 行 source URL),全部 `new` 状态。入库侧连接器统一反转义 tags 与 source URL(归组键只取 path,既有分组不受影响);读取侧 `_item_tags` 与条目标题在出口幂等归一——旧行不写账本即恢复正常显示与筛选,同一标签的脏/净写法合并为同一身份。其余主要 tag 面排查干净:Rule34Video/Paheal 走 BeautifulSoup 已解码,目录 `/api/index`(tags/performers/studios)与 `asset_tag` 词汇 0 命中,fanbox 行的 `&` 是合法字符非实体。follow 430 项通过。账本存量实体的物理清理待另行授权;当前读取层已归一,展示与筛选不受影响。
- 2026-08-29 按用户复核意见改两处关注反馈:检查回执 toast 带具名动作「去看更新」(点击关掉自己并跳转关注流),统计文案收掉悬空的「条详情」——它曾被当成可点的链接;关注管理的批量操作(全部标记已看/全部忽略)从计数行内的裸链接改为独立 `.fbulk` 行的 `.fbtn` 次级按钮,与本页「检查全部/去看更新」同一套控件语言。follow 427 项通过;生产页面实测:toast 动作点击后正确跳转 `/follow`,批量按钮渲染正常,全程未触发真实检查、未写 ledger。
diff --git a/docs/reference-snapshots/follow-source-icons-measured.md b/docs/reference-snapshots/follow-source-icons-measured.md
index a6c964766..bb7f0ee1d 100644
--- a/docs/reference-snapshots/follow-source-icons-measured.md
+++ b/docs/reference-snapshots/follow-source-icons-measured.md
@@ -18,6 +18,7 @@
| rule34video.com | 200 | `/favicon-32x32.png` | 200 `image/png` 1,764 B `sha256:5282045bdc85` |
| rule34.xxx | 200 | `/favicon.ico` | 200 `image/x-icon` 1,150 B `sha256:68bd5752e7b0` |
| f95zone.to | 200 | `/assets/favicon-32x32.png` | 200 `image/png` 1,679 B `sha256:f658dc0b364c` |
+| mypikpak.com | 未测 | `/apple-touch-icon.png` | 200 `image/png` 3,832 B(2026-08-29 实测,HTTP 头核验;目录来源图标的直连地址,`SRCICON.pikpak` 用它替代 `/logo?studio=pikpak` 的生成 logo) |
## 两条容易判错的地方
diff --git a/docs/reference-snapshots/vercel-geist-semantics-measured.md b/docs/reference-snapshots/vercel-geist-semantics-measured.md
new file mode 100644
index 000000000..0053b98b7
--- /dev/null
+++ b/docs/reference-snapshots/vercel-geist-semantics-measured.md
@@ -0,0 +1,68 @@
+# Geist 语义控件实测记录(按钮/徽章/标题/布局)
+
+- 取证日期:2026-08-29
+- URL:<https://vercel.com/geist/button>、<https://vercel.com/geist/banner>、<https://vercel.com/geist/badge>
+- 取证方式:浏览器加载页面后读 `getComputedStyle`(与 `vercel-geist-controls-measured.md` 同法)
+- **不在 `docs/reference-sources.json` 里登记**:理由同上,渲染结果没有可哈希上游快照。
+
+## Button(dark 主题实测)
+
+| 变体 | 背景 | 文字 | 几何 |
+| --- | --- | --- | --- |
+| primary | `rgb(237,237,237)` | `rgb(10,10,10)` | 500 字重 |
+| danger | `rgb(217,48,54)` | `#fff` | 同上 |
+| warning | `rgb(255,153,10)` | `rgb(10,10,10)` | 同上 |
+| secondary | `rgb(10,10,10)` 或透明 | `rgb(237,237,237)` | 同上 |
+
+- 小号(default):32 px 高、`border-radius:6px`、`padding:0 6px`、14 px 字。
+- 大号(large):40 px 高、`border-radius:8px`、`padding:0 14px`、16 px 字。
+
+语义对应:销毁类操作用 danger 实底,暂停/降级类用 warning,主推进动作用 primary
+(dark 主题下是白),其余一律 secondary。Dashboard 的危险设置卡(Delete Project)
+是红发丝边框 + 底部一条红 tint 区放危险按钮。
+
+## Badge
+
+- 彩色变体:24 px 高、12 px 字、正圆胶囊(radius 999px)、`padding:2px 12px`、实底。
+ blue `rgb(0,98,209)`、red `rgb(217,48,54)`、amber `rgb(255,178,36)`(黑字)、
+ green `rgb(26,147,56)`、teal `rgb(12,151,132)`、purple `rgb(95,46,133)`、pink `rgb(179,26,87)`。
+- 灰色默认(代码示例里量到的):bg `rgb(26,26,26)`、边 `rgb(41,41,41)`、字
+ `rgb(161,161,161)`、radius 6px、mono 字体。Dashboard 的状态徽章走低饱和
+ tint(如 subtle 绿/红),不是每行都上实底彩色。
+
+## 标题
+
+- H1:40 px / 600 / `letter-spacing:-2.4px` / `line-height:48px` / `margin:0 0 12px`。
+- H2:24 px / 600 / `letter-spacing:-0.96px` / `line-height:32px`。
+
+## 布局与字体
+
+- 文档正文列:body `max-width:1265px`,main 实测 1220px;Dashboard 的设置类
+ 页面内容列实测约 943px(用户提供的 Team Settings 截图)——低密度页面不全宽。
+- 正文字体栈:`Geist, Inter, -apple-system, …, sans-serif`,全程无衬线;站方
+ 栈里没有 CJK 名字,中文站必须自行补 CJK sans,否则 Chrome 的中文默认字体
+ (宋体)会接管标题。
+
+## Dashboard 后台实测(2026-08-29,登录态)
+
+- 设置页内容列:卡片实测 **914px**(1265px 视口),居中;低密度管理页不全宽。
+- 设置卡:bg `rgb(10,10,10)`,radius **6px**,发丝边(文档示例卡为
+ `1px rgba(255,255,255,0.14)`、radius 8px);卡内标题 **20px/600/26px 行高**,
+ 描述为 muted 灰;卡底与主体之间发丝分隔,底部一行「左侧 helper 灰字 +
+ 右侧动作按钮」。
+- 危险设置卡(Delete Project,用户截图):整卡红发丝边框,底部一条红 tint
+ 区,右侧 danger 实底按钮;Pause Project 用 warning(amber)实底按钮。
+- 文档页排版:H1 40px/48 行高/600/`-2.4px`/`mb 12px`;导语 20px/30 行高 muted;
+ 正文段落 16px/24 行高,`mt 16px`。
+
+
+## Peach 对应
+
+- 语义按钮:`.fbtn.danger`(清空回收站等销毁类)、`.fbtn.primary` 保持主推进、
+ 批量已看/忽略保持 secondary;回收站清空区用红发丝边框卡。
+- 行内状态:`ok`/`error` 用低饱和 tint 徽章(`.sbadge`),不再是裸文字。
+- 检查失败报告条:对齐 danger 卡语义——红发丝边 + 微红底,去掉左侧粗条。
+- 低密度管理页(统计/口味/复核等)内容列限宽约 1000px 居中;浏览页(首页/
+ 关注)保持全宽。
+- 正文字体栈补 CJK sans:`"Microsoft YaHei UI","Microsoft YaHei","PingFang SC",
+ "Hiragino Sans GB","Noto Sans CJK SC"` 置于 sans-serif 前。
diff --git a/src/peach/follow_sources.py b/src/peach/follow_sources.py
index 0d205011e..1ae6da487 100644
--- a/src/peach/follow_sources.py
+++ b/src/peach/follow_sources.py
@@ -270,6 +270,12 @@ def _is_opaque_filename(stem: str) -> bool:
return bool(re.fullmatch(r"[0-9a-f]{16,}", stem.strip().lower()))
+def _exc_summary(exc: Exception, limit: int = 140) -> str:
+ """把底层网络异常压成一行能看懂的原因,跟着「请求失败」一起报给用户。"""
+ text = f"{type(exc).__name__}: {exc}".strip()
+ return re.sub(r"\s+", " ", text)[:limit]
+
+
class _BaseConnector:
provider = ""
semantics = "work"
@@ -308,7 +314,8 @@ class _BaseConnector:
response = self.transport(HttpRequest("GET", url, merged),
self.timeout, self.max_bytes)
except (OSError, httpx.HTTPError) as exc:
- raise FollowSourceError(f"{self.provider} 请求失败") from exc
+ raise FollowSourceError(
+ f"{self.provider} 请求失败:{_exc_summary(exc)}") from exc
if len(response.body) > self.max_bytes:
raise FollowSourceError(f"{self.provider} 响应超出大小上限")
return response
@@ -323,7 +330,8 @@ class _BaseConnector:
response = self.transport(HttpRequest("POST", url, merged, body),
self.timeout, self.max_bytes)
except (OSError, httpx.HTTPError) as exc:
- raise FollowSourceError(f"{self.provider} 请求失败") from exc
+ raise FollowSourceError(
+ f"{self.provider} 请求失败:{_exc_summary(exc)}") from exc
if len(response.body) > self.max_bytes:
raise FollowSourceError(f"{self.provider} 响应超出大小上限")
return response
@@ -339,15 +347,45 @@ class _BaseConnector:
raise FollowSourceError(
f"{self.provider} 拒绝访问(HTTP {response.status}):需要有效凭据,"
"或站点已加机器人验证")
+ if response.status == 429:
+ raise FollowSourceError(
+ f"{self.provider} 返回 HTTP 429:请求过于频繁,稍后再试")
if response.status != 200:
raise FollowSourceError(f"{self.provider} 返回 HTTP {response.status}")
+ #: 上游限流页的固定句式(2026-08-29 实测 rule34.xxx):HTTP 200 + 文本正文
+ #: "You currently have a limit of 60 requests every 60 second(s)"。不识别的话
+ # 会被报成「请求失败/不是合法 JSON」,用户看不出是被限流了。
+ _RATE_LIMIT_RE = re.compile(
+ r"limit of (\d+) requests? every (\d+) seconds?", re.IGNORECASE)
+
+ def _upstream_reason(self, response: HttpResponse) -> str | None:
+ """能从响应正文里读出的明确失败原因;读不出就返回 None。"""
+ text = response.body.decode("utf-8", errors="replace")
+ matched = self._RATE_LIMIT_RE.search(text)
+ if matched:
+ count, seconds = matched.group(1), matched.group(2)
+ return (f"{self.provider} 触发频率限制:每 {seconds} 秒最多 "
+ f"{count} 次请求,请稍后再试")
+ return None
+
+ @staticmethod
+ def _body_snippet(response: HttpResponse, limit: int = 120) -> str:
+ text = re.sub(r"<[^>]+>", " ", response.body.decode("utf-8", errors="replace"))
+ return re.sub(r"\s+", " ", text).strip()[:limit]
+
def parse_json(self, response: HttpResponse):
"""解析一份已经取回的响应;不是合法 JSON 就抛错。"""
try:
return json.loads(response.body.decode("utf-8"))
except (UnicodeDecodeError, json.JSONDecodeError) as exc:
- raise FollowSourceError(f"{self.provider} 返回的不是合法 JSON") from exc
+ reason = self._upstream_reason(response)
+ if reason:
+ raise FollowSourceError(reason) from exc
+ snippet = self._body_snippet(response)
+ detail = f":{snippet}" if snippet else ""
+ raise FollowSourceError(
+ f"{self.provider} 返回的不是合法 JSON{detail}") from exc
def _request(self, url: str, *, ref: str, etag: str | None = None,
last_modified: str | None = None, page: int = 0,
diff --git a/tests/test_follow_sources.py b/tests/test_follow_sources.py
index 5cda31ab2..0d4d4fe35 100644
--- a/tests/test_follow_sources.py
+++ b/tests/test_follow_sources.py
@@ -926,6 +926,30 @@ class Rule34XxxConnectorTests(unittest.TestCase):
candidate.extra["source"],
"https://porn3dx.com/post/42957/aranea?list_type=key&sort=new")
+ def test_rate_limit_body_is_reported_as_rate_limit_not_bad_json(self):
+ """限流要报成限流:用户需要知道「等一会儿再试」而不是「响应坏了」。
+
+ rule34.xxx 限流时回 HTTP 200 + 文本正文(实测句式 "You currently have
+ a limit of 60 requests every 60 second(s)")。按「不是合法 JSON」上报,
+ 检查失败的红色明细里就只剩一句没头没尾的原因。
+ """
+ body = (b"<!doctype html><html><body>You currently have a limit of "
+ b"60 requests every 60 second(s). Please try again later."
+ b"</body></html>")
+ with self.assertRaises(FollowSourceError) as caught:
+ self._connector(body=body).fetch("lazyprocrastinator")
+ message = str(caught.exception)
+ self.assertIn("频率限制", message)
+ self.assertIn("60", message)
+ self.assertNotIn("JSON", message)
+
+ def test_http_429_reports_throttling(self):
+ connector = self._connector(body=b"{}", status=429)
+ with self.assertRaises(FollowSourceError) as caught:
+ connector.fetch("lazyprocrastinator")
+ self.assertIn("429", str(caught.exception))
+ self.assertIn("频繁", str(caught.exception))
+
def test_authentication_rejection_is_reported_as_a_credential_error(self):
connector = self._connector(
diff --git a/tests/test_follow_web.py b/tests/test_follow_web.py
index 1925e0e9f..3292c50d5 100644
--- a/tests/test_follow_web.py
+++ b/tests/test_follow_web.py
@@ -1570,7 +1570,8 @@ class FollowWebSourceTests(unittest.TestCase):
self.assertPageContains('<button class="fbtn" data-follow-bulk="seen">全部标记已看</button>')
self.assertPageContains('<button class="fbtn" data-follow-bulk="ignored">全部忽略</button>')
self.assertPageLacks('class="flink" data-follow-bulk')
- self.assertPageContains('.fbulk{display:flex;gap:8px;margin:8px 0 0}')
+ # 不另起一行:按钮内联在计数行里(用户回执)。
+ self.assertPageContains('.fbulk{display:inline-flex;gap:8px;margin-left:10px;vertical-align:middle}')
def test_sources_by_the_same_author_are_one_block(self):
"""同一个作者在几个站上是几条来源、一个人。
diff --git a/tests/test_web_ui.py b/tests/test_web_ui.py
index 2cce30edd..20b0d48fb 100644
--- a/tests/test_web_ui.py
+++ b/tests/test_web_ui.py
@@ -783,7 +783,7 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageLacks(".index .ihead h2{margin:0;font-size:20px;font-weight:500}")
self.assertPageLacks(".playlistpage h2{margin:0 0 5px;font-size:28px}")
self.assertPageContains('<h2 class="disp pagetitle">关注</h2>')
- self.assertPageContains(".listtitle,.managetitle,.follow>.pagetitle{margin:0 0 14px}")
+ self.assertPageContains(".listtitle,.managetitle,.follow>.pagetitle{margin:0 0 12px}")
self.assertPageContains('id="listTitle" hidden')
def test_immersive_progress_bar_is_reachable_and_draggable(self):
@@ -1262,29 +1262,62 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains("const canSelect=catalog||entity||path==='/tags'")
self.assertPageContains("$('#selectMode').hidden=!canSelect;$('#density').hidden=!canDensity;$('#refresh').hidden=!canRefresh")
- def test_censor_obscures_all_content_media_by_default(self):
- """审查遮挡必须默认开启,且盖住的是全站所有内容图与视频。
+ def test_censor_lives_in_settings_and_stays_off_by_default(self):
+ """审查遮挡在设置面板,默认关闭;导航栏不出现。
- 封面和预览图一旦以原始画面进截图,截图管道的内容审查会拦下整张图
- (关注页实测发生过),所以遮挡是默认态:localStorage 只记「用户显式
- 关闭」('0'),没动过开关的会话一律先盖住。CSS 按 element 类型生效
- 而不是按页面类名,新页面、关注流、灯箱、沉浸模式不需要各自接入;
- 悬停预览的启动路径必须查这个开关——动起来的画面比静帧更漏。
+ 日常浏览不该被遮挡(用户回执);截图会交给会审查内容的模型时才在
+ 设置里打开(AGENTS.md 工作规则)。规则按元素类型生效(img/video/
+ videojs 海报层),开关一开仍然全站覆盖;悬停预览的启动路径必须查
+ 这个开关——动起来的画面比静帧更漏。
"""
- # 默认遮挡:只有显式 '0' 才恢复画面。
- self.assertPageContains("applyCensor(localStorage.getItem(CENSOR_KEY)!=='0')")
- # 全站按元素类型盖:内容 img / video / videojs 海报层一个不落,
- # 模糊 + 重度去饱和 + 压暗,截图里只剩深灰块。
+ # 顶栏不出现独立开关,开关在设置面板「安全」组。
+ self.assertPageLacks('id="censorBtn"')
+ self.assertPageContains('<input type="checkbox" id="censorSetting">')
+ # 默认关闭:localStorage 记 '1' 才开,没动过的会话一律不遮。
+ self.assertPageContains("applyCensor(localStorage.getItem(CENSOR_KEY)==='1')")
+ # 全站按元素类型盖:内容 img / video / videojs 海报层一个不落。
self.assertPageContains("body.censor img,body.censor video,body.censor .vjs-poster{\n filter:blur(30px) saturate(.3) brightness(.6)}")
# 豁免只给与内容无关的界面小图:品牌标、来源徽章、favicon。
self.assertPageContains("body.censor .brand .mark,body.censor .src img,body.censor .ficon{filter:none}")
- # 顶栏开关开启时撤掉正在飞的悬停预览。
+ # 开关变化写回 localStorage 并撤掉正在飞的悬停预览。
+ self.assertPageContains("$('#censorSetting').onchange=")
self.assertPageContains("if(on)releaseHoverPreviews()")
# 悬停预览三条启动路径(长按轮播、悬停起播、定时器到点)都要被拦。
self.assertIn("if(selectMode||censorOn())return;armLong()", self.page)
self.assertIn("if(selectMode||censorOn()||window.__scrolling)return;", self.page)
self.assertIn("if(window.__scrolling||censorOn())return;", self.page)
+ def test_management_surfaces_are_narrow_and_geist_semantics_hold(self):
+ """低密度管理页不全宽;语义色与状态徽章对齐 Geist 实测。
+
+ Vercel 后台设置列实测约 914px(vercel-geist-semantics-measured.md),
+ 统计/口味/复核/高清版限宽居中;首页/关注等浏览页保持全宽。检查失败
+ 报告是红发丝边 + 微红底的 danger 语义块,不是左侧粗条;来源行状态
+ 用低饱和徽章;清空回收站是销毁类操作,用 danger 色而不是主色实底。
+ """
+ for surface in ("/stats", "/taste", "/review", "/quality-goals"):
+ self.assertPageContains(f'body[data-surface="{surface}"] #stats')
+ self.assertPageContains("document.body.dataset.surface=path")
+ # 报告条:danger 语义(红发丝边 + 微红底),不再是左侧粗条。
+ self.assertPageContains("background:color-mix(in srgb,var(--drop) 7%,transparent);\n border:1px solid color-mix(in srgb,var(--drop) 30%,transparent);")
+ self.assertPageLacks("border-left:2px solid var(--drop)")
+ # 来源行状态徽章(ok 绿 tint / 失败红 tint / 未检查灰)。
+ self.assertPageContains('<span class="sbadge ${badge}">${esc(state)}</span>')
+ self.assertPageContains(".sbadge.ok{background:color-mix(in srgb,var(--success) 14%,transparent);color:var(--success)}")
+ self.assertPageContains(".sbadge.error{background:color-mix(in srgb,var(--drop) 14%,transparent);color:var(--drop)}")
+ # 清空回收站:danger 语义色。
+ self.assertPageContains('class="batchaction danger" id="emptyTrash"')
+ self.assertPageContains(".count .sorts .batchaction.danger{background:transparent;border-color:color-mix(in srgb,var(--drop) 38%,transparent);color:var(--drop)}")
+ # 全站字体栈必须有 CJK sans 兜底:Bahnschrift/Consolas 都没有中文字形,
+ # generic sans-serif/monospace 在中文 Chrome 的默认可能落到宋体。
+ css = (Path(__file__).resolve().parents[1] / "web" / "app.css").read_text(
+ encoding="utf-8")
+ for i, line in enumerate(css.splitlines(), 1):
+ if "font-family" not in line or "inherit" in line:
+ continue
+ if "sans-serif" in line or "monospace" in line:
+ self.assertIn("YaHei", line, f"app.css:{i} 字体栈缺 CJK 兜底:{line.strip()[:90]}")
+
def test_no_page_grows_its_own_back_control(self):
"""索引页原本有个返回按钮,现在顶栏入口本身就是返回路径。
diff --git a/web/app.css b/web/app.css
index 6cc056e43..2ed04480f 100644
--- a/web/app.css
+++ b/web/app.css
@@ -10,7 +10,7 @@
--line:#D9DDE4; --line-soft:#E8EBF0;
--ink:#14161A; --ink-2:#454B55; --muted:#767C87;
--tungsten:#0095F6; --tungsten-soft:#DCEEFD;
- --loupe:#127A72; --keep:#2E7D32; --meter:#B26A10; --drop:#C0392B;
+ --loupe:#127A72; --keep:#2E7D32; --meter:#B26A10; --drop:#C0392B; --success:#2E7D32;
--tile:336px; --topH:56px; --filterH:58px; --sortH:53px; --railW:72px;
/* 圆角也是有词汇的,不是随手挑一个数。
--pill:整圆,只给真正的胶囊——标签、筛选令牌、滚动条和进度条这类连续的条。
@@ -37,7 +37,7 @@
--tungsten:#0095F6; --tungsten-soft:#0A2B45;
--frost-panel:rgba(6,9,14,.94); --frost-light:rgba(14,18,24,.90);
--overlay-5:rgba(245,250,255,.05);--border-10:rgba(245,250,255,.10);--border-15:rgba(245,250,255,.15);
- --loupe:#6FD0C8; --keep:#5FB95F; --meter:#E0912F; --drop:#FF5252; --ambient-opacity:1;}}
+ --loupe:#6FD0C8; --keep:#5FB95F; --meter:#E0912F; --drop:#FF5252; --success:#5FB95F; --ambient-opacity:1;}}
:root[data-theme="dark"]{
--ground:#020408; --surface:#0C0F14; --sunk:#0B0D11; --hover:rgba(255,255,255,.07);
--line:#3A3A3D; --line-soft:#2C2C30;
@@ -45,7 +45,7 @@
--tungsten:#0095F6; --tungsten-soft:#0A2B45;
--frost-panel:rgba(6,9,14,.94); --frost-light:rgba(14,18,24,.90);
--overlay-5:rgba(245,250,255,.05);--border-10:rgba(245,250,255,.10);--border-15:rgba(245,250,255,.15);
- --loupe:#6FD0C8; --keep:#5FB95F; --meter:#E0912F; --drop:#FF5252; --ambient-opacity:1;}
+ --loupe:#6FD0C8; --keep:#5FB95F; --meter:#E0912F; --drop:#FF5252; --success:#5FB95F; --ambient-opacity:1;}
*,*::before,*::after{box-sizing:border-box}
html{color-scheme:light;scroll-padding-top:calc(var(--topH) + 8px)}
@@ -69,7 +69,7 @@ body::before{content:"";position:absolute;z-index:0;pointer-events:none;top:var(
@keyframes ambient-in{from{opacity:0}to{opacity:var(--ambient-opacity)}}
.disp{font-family:Bahnschrift,"Segoe UI Variable Display","Microsoft YaHei UI",sans-serif;
font-weight:600;letter-spacing:.02em}
-.mono{font-family:"Cascadia Mono",Consolas,ui-monospace,monospace;
+.mono{font-family:"Cascadia Mono",Consolas,ui-monospace,"Microsoft YaHei UI","PingFang SC",monospace;
font-variant-numeric:tabular-nums;font-size:var(--fs-xs)}
button,input,textarea{font:inherit;color:inherit}
button,a,input,textarea,select,summary{touch-action:manipulation}
@@ -113,7 +113,7 @@ button.busy>svg{animation:peach-spin .8s linear infinite}
.ib[aria-pressed="true"]{color:var(--tungsten);background:var(--tungsten-soft)}
.brand{display:flex;align-items:center;gap:9px;flex:none;text-decoration:none;color:inherit;height:32px}
.mark{width:28px;height:28px;flex:none;display:block;object-fit:contain}
-.brand h1{font-family:Bahnschrift,"Segoe UI Variable Display",sans-serif;font-weight:600;margin:0;font-size:var(--fs-xl);line-height:1;letter-spacing:.08em}
+.brand h1{font-family:Bahnschrift,"Segoe UI Variable Display","Microsoft YaHei UI","PingFang SC",sans-serif;font-weight:600;margin:0;font-size:var(--fs-xl);line-height:1;letter-spacing:.08em}
.brand .sub{font-size:var(--fs-xs);line-height:1;letter-spacing:.14em;color:var(--muted);padding-top:2px}
.search{flex:1;max-width:620px;margin:0 auto;display:flex;align-items:center;gap:8px;
background:var(--surface);border:1px solid var(--line);border-radius:var(--pill-radius);padding:8px 16px;position:relative}
@@ -153,7 +153,7 @@ button.busy>svg{animation:peach-spin .8s linear infinite}
.av[aria-pressed="true"] .ring{box-shadow:0 0 0 2px var(--tungsten)}
.av .ring img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.av .ring .ini{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
- font-size:var(--fs-xl);color:var(--muted);font-family:Bahnschrift,sans-serif}
+ font-size:var(--fs-xl);color:var(--muted);font-family:Bahnschrift,"Microsoft YaHei UI","Microsoft YaHei","PingFang SC",sans-serif}
.av .nm{display:block;font-size:var(--fs-xs);color:var(--ink-2);overflow:hidden;
text-overflow:ellipsis;white-space:nowrap;max-width:76px}
.av[aria-pressed="true"] .nm{color:var(--tungsten)}
@@ -165,7 +165,7 @@ button.busy>svg{animation:peach-spin .8s linear infinite}
.brandpill[aria-pressed="true"]{border-color:var(--tungsten);background:var(--tungsten-soft)}
.brandpill .mk{width:32px;height:32px;border-radius:50%;background:#CFCFCF;flex:none;
display:flex;align-items:center;justify-content:center;font-size:var(--fs-xs);
- font-family:Bahnschrift,sans-serif;color:var(--tungsten);overflow:hidden;position:relative}
+ font-family:Bahnschrift,"Microsoft YaHei UI","Microsoft YaHei","PingFang SC",sans-serif;color:var(--tungsten);overflow:hidden;position:relative}
.brandpill .mk img{position:absolute;inset:3px;width:calc(100% - 6px);height:calc(100% - 6px);
object-fit:contain;display:block;filter:saturate(.72) brightness(.84);opacity:.9}
@@ -197,7 +197,7 @@ button.busy>svg{animation:peach-spin .8s linear infinite}
.playlistcards{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px}.playlistcard{display:grid;grid-template-columns:112px minmax(0,1fr);gap:12px;padding:12px;border:1px solid var(--line-soft);border-radius:12px;background:var(--surface);min-width:0}.playlistcover{position:relative;aspect-ratio:16/10;border:0;border-radius:8px;background:#000;overflow:hidden;padding:0;cursor:pointer}.playlistcover:disabled{cursor:default}.playlistcover img{width:100%;height:100%;object-fit:cover}.playlistcover span{position:absolute;right:5px;bottom:5px;border-radius:5px;background:#000b;color:#fff;padding:3px 6px;font-size:var(--fs-xs)}.playlistmeta{display:grid;align-content:center;gap:6px;min-width:0}.playlistmeta input{min-width:0;width:100%;font-weight:600}.playlistmeta small{color:var(--muted)}.playlistactions{grid-column:1/-1;display:flex;gap:7px;justify-content:flex-end}.playlistactions .danger{color:var(--drop)}
.playlistdialog{width:min(520px,calc(100vw - 28px));border:1px solid var(--line);border-radius:var(--floating-radius);background:var(--surface);color:var(--ink);padding:0;box-shadow:0 2px 4px #0003,0 24px 80px #000b}.playlistdialog::backdrop{background:#000a;backdrop-filter:blur(5px)}.playlistdialoghead{display:flex;align-items:center;justify-content:space-between;padding:16px 17px;border-bottom:1px solid var(--line-soft)}.playlistdialoghead h2{margin:0;font-size:var(--fs-xl)}.playlistdialoghead button{width:34px;height:34px;border:0;border-radius:var(--control-radius);background:transparent;color:var(--ink);display:grid;place-items:center;cursor:pointer}.playlistdialoghead button:hover{background:var(--hover)}.playlistdialoghead svg{width:19px;height:19px;stroke:currentColor;fill:none}.playlistdialogbody{padding:17px}.playlistpicklist{display:grid;gap:7px;margin-top:16px;max-height:320px;overflow-y:auto;overscroll-behavior:contain}.playlistpickrow{display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid var(--border-10);border-radius:var(--control-radius);background:var(--overlay-5);color:var(--ink);padding:11px 12px;text-align:left;cursor:pointer}.playlistpickrow:hover{border-color:var(--tungsten)}.playlistpickrow small{color:var(--muted)}
.runtimegate{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 12px;padding:10px 12px;border:1px solid color-mix(in srgb,var(--meter) 35%,var(--line));border-radius:var(--control-radius);background:color-mix(in srgb,var(--meter) 8%,var(--surface));color:var(--ink);font-size:var(--fs-sm)}.runtimegate span{flex:1 1 320px;min-width:0}.runtimegate a{flex:0 0 auto;color:var(--ink);font-weight:650;text-decoration:none}.runtimegate a:hover{text-decoration:underline}
-.review{padding:8px 0 42px}.reviewhead{display:flex;align-items:baseline;gap:12px;padding:2px 2px 14px;margin-bottom:14px}.reviewhead h2{margin:0;font-size:var(--fs-xl)}.reviewtabs{display:flex;gap:6px;overflow-x:auto;margin-bottom:18px;scrollbar-width:none}.reviewtabs::-webkit-scrollbar{display:none}.reviewtabs button{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--border-15);border-radius:var(--control-radius);background:transparent;color:var(--ink-2);padding:7px 14px;cursor:pointer;font-size:var(--fs-sm);white-space:nowrap}.reviewtabs button:hover{border-color:var(--tungsten);color:var(--ink)}.reviewtabs button[aria-pressed="true"]{background:var(--tungsten-soft);border-color:var(--tungsten);color:var(--tungsten);font-weight:600}.reviewtabs .n{color:var(--muted);font-size:var(--fs-xs)}.reviewsection{margin-bottom:20px}.reviewsection h3{margin:0 0 9px;font-size:var(--fs-lg)}.reviewlist{display:grid;grid-template-columns:repeat(auto-fill,minmax(360px,1fr));gap:14px}
+.review{padding:8px 0 42px}.reviewhead{display:flex;align-items:baseline;gap:12px;padding:2px 2px 0;margin-bottom:12px}.reviewhead h2{margin:0;font-size:var(--fs-xl)}.reviewtabs{display:flex;gap:6px;overflow-x:auto;margin-bottom:16px;scrollbar-width:none}.reviewtabs::-webkit-scrollbar{display:none}.reviewtabs button{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--border-15);border-radius:var(--control-radius);background:transparent;color:var(--ink-2);padding:7px 14px;cursor:pointer;font-size:var(--fs-sm);white-space:nowrap}.reviewtabs button:hover{border-color:var(--tungsten);color:var(--ink)}.reviewtabs button[aria-pressed="true"]{background:var(--tungsten-soft);border-color:var(--tungsten);color:var(--tungsten);font-weight:600}.reviewtabs .n{color:var(--muted);font-size:var(--fs-xs)}.reviewsection{margin-bottom:20px}.reviewsection h3{margin:0 0 9px;font-size:var(--fs-lg)}.reviewlist{display:grid;grid-template-columns:repeat(auto-fill,minmax(360px,1fr));gap:14px}
/* 判定状态用左侧色条表达:整卡描边在一列里扫过去时反而认不出来 */
.reviewitem{position:relative;background:var(--surface);border:1px solid var(--line-soft);border-radius:12px;padding:15px 15px 13px 18px;min-width:0;overflow:hidden}.reviewitem::before{content:'';position:absolute;left:0;top:0;bottom:0;width:3px;background:transparent}.reviewitem[data-decision="approved"]::before{background:var(--keep)}.reviewitem[data-decision="rejected"]::before{background:var(--drop)}.reviewitem[data-decision="skipped"]::before{background:var(--muted)}.reviewitem[data-decision="rejected"],.reviewitem[data-decision="skipped"]{opacity:.6}.reviewitem h4{margin:0 0 6px;font-size:var(--fs-lg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reviewitem p{margin:4px 0;color:var(--muted);font-size:var(--fs-xs);line-height:1.55;overflow-wrap:anywhere}.reviewtags{display:flex;flex-wrap:wrap;gap:5px;margin:9px 0}.reviewtags span{padding:3px 9px;border:1px solid var(--border-15);border-radius:var(--pill-radius);font-size:var(--fs-xs);color:var(--ink-2)}
/* 唯一候选:纯展示,几何对齐 .revieworigin,不画单选圈。radio 仍在 DOM 里,
@@ -266,7 +266,7 @@ button.busy>svg{animation:peach-spin .8s linear infinite}
background:var(--sunk);position:relative}
.icell .ring img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.icell .ring .ini{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
- font-size:var(--fs-2xl);color:var(--muted);font-family:Bahnschrift,sans-serif}
+ font-size:var(--fs-2xl);color:var(--muted);font-family:Bahnschrift,"Microsoft YaHei UI","Microsoft YaHei","PingFang SC",sans-serif}
.icell .nm{font-size:var(--fs-xs);text-align:center;line-height:1.3;word-break:break-all}
.icell .n{font-size:var(--fs-xs);color:var(--muted)}
.tagwall{display:flex;flex-wrap:wrap;gap:7px}
@@ -495,7 +495,7 @@ button.serieslink.entitylink:hover{color:var(--tungsten);text-decoration:none}
在侧栏里一路点过去就是三种大小;间距由各自的版式决定,字形不再各拍各的。 */
.pagetitle,.listtitle,.managetitle,.index .ihead h2,.playlistpage h2{
font-size:var(--fs-2xl);line-height:1.2;letter-spacing:.02em;font-weight:600}
-.listtitle,.managetitle,.follow>.pagetitle{margin:0 0 14px}
+.listtitle,.managetitle,.follow>.pagetitle{margin:0 0 12px}
.listtitle[hidden],.managetitle[hidden]{display:none}
.dupsum{color:var(--muted);margin:0 0 12px}
.dupactions{display:flex;gap:8px;margin-bottom:16px}
@@ -622,6 +622,8 @@ main{position:relative;z-index:1;padding:14px 16px 90px}
.entitycollectionhead .sorts .entitybatch{width:36px;padding:0;display:inline-grid;place-items:center}
.entitycollectionhead .sorts .entitybatch svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2}
.count .sorts .batchaction:hover,.entitycollectionhead .sorts .batchaction:hover{background:color-mix(in srgb,var(--tungsten) 82%,#000);color:#fff}
+.count .sorts .batchaction.danger{background:transparent;border-color:color-mix(in srgb,var(--drop) 38%,transparent);color:var(--drop)}
+.count .sorts .batchaction.danger:hover{background:color-mix(in srgb,var(--drop) 10%,transparent);border-color:color-mix(in srgb,var(--drop) 58%,transparent);color:var(--drop)}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--tile),1fr));gap:16px 8px}
.shorts-inline{grid-column:1/-1;margin:28px 0 8px;padding-top:0}
.shorts-inline h2{margin:0 0 10px;font-size:var(--fs-lg);display:flex;align-items:center;gap:10px}
@@ -748,7 +750,7 @@ body.select-mode .selectionMark,.card.selected .selectionMark{display:grid}
.mav:hover{box-shadow:0 0 0 2px var(--tungsten)}
.mav img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.mav .ini{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
- font-size:var(--fs-sm);color:var(--muted);font-family:Bahnschrift,sans-serif}
+ font-size:var(--fs-sm);color:var(--muted);font-family:Bahnschrift,"Microsoft YaHei UI","Microsoft YaHei","PingFang SC",sans-serif}
/* 共演头像叠放:靠左的在上层,hover 时抬到最前,保证每一位都点得到。 */
.mavstack{display:flex;flex:none;margin-top:2px}
.mavstack .mav{margin-top:0;box-shadow:0 0 0 2px var(--ground)}
@@ -1016,7 +1018,9 @@ body.settings-open{overflow:hidden}
内边距**里侧**,于是离右边框差着一大截,和桌面 Chromium 的样子也对不上。
`appearance:none` 关掉系统绘制,用背景图贴住右边框。 */
.settingrow select{min-width:148px;border:1px solid var(--line);border-radius:var(--control-radius);background:#181a1d;color:#f5f7fa;color-scheme:dark;padding:9px 34px 9px 11px;font:inherit;font-size:var(--fs-md);appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;background-size:16px 16px}.settingrow select:focus-visible{outline:2px solid var(--tungsten);outline-offset:2px}.settingrow select option{background:#181a1d;color:#f5f7fa}.settingrow input[type=checkbox]{width:20px;height:20px;accent-color:var(--tungsten)}
-.sidebarsetting{display:grid;gap:12px;padding:14px 0 0;border-top:1px solid var(--line-soft)}.sidebarsetting>span b,.sidebarsetting>span small{display:block}.sidebarsetting>span small{margin-top:3px;color:var(--muted);line-height:1.45}.sidebarorder{display:grid;gap:6px}.sidebarorderrow{position:relative;display:flex;align-items:center;justify-content:space-between;min-height:48px;padding:5px 6px;border:1px solid var(--line-soft);border-radius:9px;background:var(--overlay-3);cursor:grab}.sidebarorderrow:active{cursor:grabbing}.sidebarorderrow.dragging{opacity:.42}.sidebarorderrow.drop-before::before,.sidebarorderrow.drop-after::after{content:'';position:absolute;z-index:2;left:7px;right:7px;height:2px;border-radius:2px;background:var(--tungsten)}.sidebarorderrow.drop-before::before{top:-5px}.sidebarorderrow.drop-after::after{bottom:-5px}.sidebarorderrow>span{display:flex;align-items:center;gap:8px}.sidebarorderrow svg{width:18px;height:18px;stroke:currentColor;fill:none}.sidebarorderlabel{min-width:0}.sidebarorderlabel>b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sidebardrag{display:grid;place-items:center;width:24px;color:var(--muted)}.sidebardrag svg{width:20px;height:20px}.sidebarorderactions{flex:none}.sidebarorderrow button,.sidebaradd button{display:grid;place-items:center;min-width:34px;height:34px;border:0;border-radius:7px;background:transparent;color:var(--muted);cursor:pointer}.sidebarorderrow button:hover:not(:disabled),.sidebaradd button:hover:not(:disabled){background:var(--hover);color:var(--ink)}.sidebarorderrow button:disabled,.sidebaradd button:disabled{opacity:.25;cursor:default}.sidebaradd{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin-top:5px}.sidebaradd select{min-width:0;border:1px solid var(--line);border-radius:8px;background:#181a1d;color:#f5f7fa;color-scheme:dark;padding:9px 34px 9px 11px;font:inherit;appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;background-size:16px 16px}.sidebaradd button{grid-template-columns:auto auto;gap:6px;padding:0 11px;border:1px solid var(--line);color:var(--ink-2)}.sidebaradd svg{width:17px;height:17px;stroke:currentColor;fill:none}
+.settinggroup>h3{margin:0 0 2px;font-size:var(--fs-sm);font-weight:600;color:var(--ink-2)}
+.settinggroup+.settinggroup{border-top:1px solid var(--line-soft);margin-top:14px;padding-top:14px}
+.sidebarsetting{display:grid;gap:12px;padding:14px 0 0}.sidebarsetting>span b,.sidebarsetting>span small{display:block}.sidebarsetting>span small{margin-top:3px;color:var(--muted);line-height:1.45}.sidebarorder{display:grid;gap:6px}.sidebarorderrow{position:relative;display:flex;align-items:center;justify-content:space-between;min-height:48px;padding:5px 6px;border:1px solid var(--line-soft);border-radius:9px;background:var(--overlay-3);cursor:grab}.sidebarorderrow:active{cursor:grabbing}.sidebarorderrow.dragging{opacity:.42}.sidebarorderrow.drop-before::before,.sidebarorderrow.drop-after::after{content:'';position:absolute;z-index:2;left:7px;right:7px;height:2px;border-radius:2px;background:var(--tungsten)}.sidebarorderrow.drop-before::before{top:-5px}.sidebarorderrow.drop-after::after{bottom:-5px}.sidebarorderrow>span{display:flex;align-items:center;gap:8px}.sidebarorderrow svg{width:18px;height:18px;stroke:currentColor;fill:none}.sidebarorderlabel{min-width:0}.sidebarorderlabel>b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sidebardrag{display:grid;place-items:center;width:24px;color:var(--muted)}.sidebardrag svg{width:20px;height:20px}.sidebarorderactions{flex:none}.sidebarorderrow button,.sidebaradd button{display:grid;place-items:center;min-width:34px;height:34px;border:0;border-radius:7px;background:transparent;color:var(--muted);cursor:pointer}.sidebarorderrow button:hover:not(:disabled),.sidebaradd button:hover:not(:disabled){background:var(--hover);color:var(--ink)}.sidebarorderrow button:disabled,.sidebaradd button:disabled{opacity:.25;cursor:default}.sidebaradd{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin-top:5px}.sidebaradd select{min-width:0;border:1px solid var(--line);border-radius:8px;background:#181a1d;color:#f5f7fa;color-scheme:dark;padding:9px 34px 9px 11px;font:inherit;appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;background-size:16px 16px}.sidebaradd button{grid-template-columns:auto auto;gap:6px;padding:0 11px;border:1px solid var(--line);color:var(--ink-2)}.sidebaradd svg{width:17px;height:17px;stroke:currentColor;fill:none}
.sidebaradd select,.sidebaradd button{height:42px;box-sizing:border-box}.sidebaradd select{padding-top:0;padding-bottom:0}
@media(max-width:600px){.settingsscroll{padding:0 17px 17px}.settingshead{padding-top:17px}.settingrow{grid-template-columns:1fr;gap:9px}.settingrow select{width:100%;min-width:0}.settingrow input[type=checkbox]{justify-self:start}}
@@ -1078,6 +1082,11 @@ body.censor .brand .mark,body.censor .src img,body.censor .ficon{filter:none}
.edge svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:2;
stroke-linecap:round;stroke-linejoin:round}
/* 窄栏从 y=0 贯通到底,顶栏只在右侧内容列里。 */
+/* 低密度管理页不全宽:内容列对齐 Vercel 后台设置卡实测(约 914px,见
+ vercel-geist-semantics-measured.md);首页/关注等浏览页保持全宽。 */
+body[data-surface="/stats"] #stats,body[data-surface="/taste"] #stats,
+body[data-surface="/review"] #stats,body[data-surface="/quality-goals"] #stats{
+ max-width:1004px;margin-inline:auto}
body{padding-left:var(--railW)}
@media (max-width:760px){body{padding-left:0}.edge{display:none}}
/* 抽屉从窄栏右侧开始,不再盖住窄栏。
@@ -1501,9 +1510,10 @@ body.drawer-open .edge{opacity:0;pointer-events:none} /* 展开时窄栏让位
检查的失败明细)。Geist 的 toast 处方:失败不能只发 toast——那是转身就丢的
通知;原因和恢复入口必须留在页面上。左侧红条让「没有更新」和「检查失败」
不用读文字就能分辨。成功的摘要不再落在这里,整条交给 toast。 */
-.fcheckreport,.fwarn{display:flex;align-items:flex-start;gap:8px;margin:10px 0 0;
- padding:9px 12px;border-radius:var(--control-radius);
- background:var(--overlay-5);border-left:2px solid var(--drop);
+.fcheckreport,.fwarn{display:flex;align-items:flex-start;gap:8px;margin:10px 0 14px;
+ padding:10px 12px;border-radius:var(--control-radius);
+ background:color-mix(in srgb,var(--drop) 7%,transparent);
+ border:1px solid color-mix(in srgb,var(--drop) 30%,transparent);
font-size:var(--fs-sm);line-height:1.7;color:var(--ink-2)}
.fcheckreport>svg,.fwarn>svg{width:14px;height:14px;flex:none;margin-top:4px;
stroke:var(--drop);fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
@@ -1512,9 +1522,16 @@ body.drawer-open .edge{opacity:0;pointer-events:none} /* 展开时窄栏让位
.fcheckreport b{color:var(--ink);font-variant-numeric:tabular-nums}
.fcheckfail{color:var(--drop)}
.fchecknote{color:var(--muted);font-size:var(--fs-xs)}
+/* 行级状态徽章:Geist Badge 的低饱和变体(取证 vercel-geist-semantics-measured.md)。
+ 行内状态不上实底彩色——ok 绿 tint、失败红 tint、未检查灰。 */
+.sbadge{display:inline-flex;align-items:center;height:20px;padding:0 8px;flex:none;
+ border-radius:var(--pill-radius);font-size:var(--fs-xs);font-variant-numeric:tabular-nums}
+.sbadge.ok{background:color-mix(in srgb,var(--success) 14%,transparent);color:var(--success)}
+.sbadge.error{background:color-mix(in srgb,var(--drop) 14%,transparent);color:var(--drop)}
+.sbadge.none{background:var(--overlay-5);color:var(--muted)}
/* 批量动作是 2292 条级别的操作,不是行内文字链接:按钮的边界让「这会改状态」
在点击前就看得见,也和本页其他 .fbtn(检查全部/去看更新)同一套语言。 */
-.fbulk{display:flex;gap:8px;margin:8px 0 0}
+.fbulk{display:inline-flex;gap:8px;margin-left:10px;vertical-align:middle}
/* 状态标签:四种状态四种颜色,待办和完成一眼分得开。 */
/* 凭据状态。类名不能叫 `.fstate`——观看页的卡片错误行已经占了那个名字
diff --git a/web/app.js b/web/app.js
index 4dcf50957..8965bf17e 100644
--- a/web/app.js
+++ b/web/app.js
@@ -20,7 +20,13 @@ const pageTitle=path=>{
? parts.slice(1).join('/') : fixed[parts[0]];
return label?`${label} · Peach`:'Peach · 蜜桃';
};
-const syncPageTitle=path=>{document.title=pageTitle(path)};
+/* 路由同时把页面表面写进 body[data-surface]:限宽等按表面生效的版式
+ (管理页不全宽)靠它切换,不用每个渲染函数自己记得加类。
+ 调用方有传 path 也有传 href 的,这里统一归一成 pathname。 */
+const syncPageTitle=path=>{
+ document.title=pageTitle(path);
+ document.body.dataset.surface=new URL(path,location.origin).pathname;
+};
const STATE_ROUTES={fresh:'/unseen',later:'/watch-later',flagged:'/flagged'};
const ROUTE_STATES=Object.fromEntries(Object.entries(STATE_ROUTES).map(([state,path])=>[path,state]));
const STATE_LABELS={fresh:'没看过',later:'稍后看',flagged:'已标记'};
@@ -165,7 +171,8 @@ $('#followScheduleSetting').onchange=async e=>{
const SRCICON={
local:icon('hard-drive'),
'115':'<img class="source-icon" src="/logo?studio=115" alt="" onerror="this.remove()">',
- pikpak:'<img class="source-icon" src="/logo?studio=pikpak" alt="" onerror="this.remove()">',
+ // PikPak 官方触屏图标(取证 follow-source-icons-measured.md);/logo 的生成 logo 不对版。
+ pikpak:'<img class="source-icon" src="https://mypikpak.com/apple-touch-icon.png" alt="" loading="lazy" referrerpolicy="no-referrer" onerror="this.remove()">',
online:icon('globe'),
};
const srcBadge=(loc,cost,cls)=>{const label=`${LOC[loc]||loc}${cost==='metered'?' · 计费':''}`;
@@ -944,7 +951,7 @@ function renderCount(){
`<span class="mono">${total.toLocaleString()} 个符合 · 显示 ${n}</span>`
+(state.state==='trash'
// 回收站是待清理队列,不是浏览列表:换一批和九种排序在这里没有意义。
- ? `<span class="sorts"><button class="batchaction" id="emptyTrash" title="永久删除回收站内容">清空回收站</button></span>`
+ ? `<span class="sorts"><button class="batchaction danger" id="emptyTrash" title="永久删除回收站内容">清空回收站</button></span>`
: `<span class="sorts">`
// 顶栏已有「换一批推荐」(#refresh),排序行不再放同一个动作;
// 版式按钮跟排序连成一条。
@@ -2208,6 +2215,9 @@ function followAuthorBlock(group){
function followSourceRow(source){
const state=source.last_status||'未检查';
const bad=state==='error'||state==='unauthorized';
+ /* 状态用 Geist 的低饱和徽章(取证 vercel-geist-semantics-measured.md):
+ 行级状态不上实底彩色,ok 绿 tint、失败红 tint、未检查灰。 */
+ const badge=state==='ok'?'ok':bad?'error':'none';
return `<div class="frow fsource${bad?' bad':''}${source.enabled?'':' disabled'}">
<label class="fchannelcheck" title="${source.enabled?'参与检查更新':'暂停检查更新'}">
<input type="checkbox" data-follow-enabled="${source.id}" ${source.enabled?'checked':''}
@@ -2218,7 +2228,7 @@ function followSourceRow(source){
rel="noreferrer noopener" title="打开原来源">${esc(source.label)}</a></b>
<span class="fmeta fprovider">${sourceIcon(source.provider)}${esc(source.provider_label)}</span>
<span class="fmeta fchecked">${esc(source.last_checked_at?localTime(source.last_checked_at):'未检查')}</span>
- <span class="fmeta fstatus${bad?' warn':''}">${esc(state)}</span>
+ <span class="sbadge ${badge}">${esc(state)}</span>
<span class="fsourceactions">
<button class="frowicon" data-follow-check="${source.id}" title="检查更新"
${source.enabled?'':'disabled'}
@@ -2343,10 +2353,10 @@ function renderFollowManage(credentials){
${broken.length?`<p class="fnote warn">${broken.length} 个来源上次检查失败,原因见对应那一行。</p>`:''}
${sources.length?`<div class="frows fsources">${
followAuthorGroups(sources).map(followAuthorBlock).join('')}</div>
- ${counts.new?`<p class="fnote">未看 ${counts.new} · 已看 ${counts.seen||0}
- · 已保存 ${counts.saved||0} · 已忽略 ${counts.ignored||0}</p>
- <div class="fbulk"><button class="fbtn" data-follow-bulk="seen">全部标记已看</button>
- <button class="fbtn" data-follow-bulk="ignored">全部忽略</button></div>`:''}`
+ ${counts.new?`<p class="fnote fbulkrow">未看 ${counts.new} · 已看 ${counts.seen||0}
+ · 已保存 ${counts.saved||0} · 已忽略 ${counts.ignored||0}
+ <span class="fbulk"><button class="fbtn" data-follow-bulk="seen">全部标记已看</button>
+ <button class="fbtn" data-follow-bulk="ignored">全部忽略</button></span></p>`:''}`
:'<p class="fnote">还没有关注任何来源。</p>'}
</section>
</div>
@@ -4547,22 +4557,21 @@ $('#refresh').onclick=async()=>{const b=$('#refresh');
try{await refreshAll()}finally{b.classList.remove('busy')}};
/* ── 审查遮挡 ──
- 共享屏幕 / 录屏 / 截图时把全站内容画面盖住:封面与预览图一旦以原始画面
- 进截图,截图管道的审查就会拦下整张图。所以默认遮挡,localStorage 只记
- 「用户显式关掉」('0')这一种状态;从没动过开关的新会话一律先盖住。
- 开启时顺手撤掉正在飞的悬停预览——动起来的画面比静帧更漏。悬停预览的
- 启动路径也查这个开关,遮挡期间不再拉流。 */
+ 共享屏幕 / 录屏 / 截图时把全站内容画面盖住。开关在设置面板(安全组),
+ 默认关闭:日常浏览不需要遮挡;只在「用会审查内容的模型做截图或视觉
+ 测试」的会话里打开(项目规则见 AGENTS.md)。开启时顺手撤掉正在飞的
+ 悬停预览——动起来的画面比静帧更漏。悬停预览的启动路径也查这个开关,
+ 遮挡期间不再拉流。 */
const CENSOR_KEY='peach-censor';
const censorOn=()=>document.body.classList.contains('censor');
function applyCensor(on){
document.body.classList.toggle('censor',on);
- const b=$('#censorBtn');
- b.setAttribute('aria-pressed',String(on));
- b.title=on?'审查遮挡:开启中,点击恢复画面':'审查遮挡:已恢复画面,共享屏幕或截图前请重新开启';
+ const box=$('#censorSetting');
+ if(box)box.checked=on;
}
-applyCensor(localStorage.getItem(CENSOR_KEY)!=='0');
-$('#censorBtn').onclick=()=>{
- const on=!censorOn();
+applyCensor(localStorage.getItem(CENSOR_KEY)==='1');
+$('#censorSetting').onchange=e=>{
+ const on=e.target.checked;
localStorage.setItem(CENSOR_KEY,on?'1':'0');
applyCensor(on);
if(on)releaseHoverPreviews();
diff --git a/web/index.html b/web/index.html
index d177f6846..b37a92e80 100644
--- a/web/index.html
+++ b/web/index.html
@@ -79,7 +79,6 @@
<button class="ib" id="searchBtn" title="搜索" aria-label="搜索"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-search"/></svg></button>
<button class="ib" id="selectMode" title="多选(Ctrl 单项,Shift 连续)" aria-label="多选模式" aria-pressed="false"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-square-check-big"/></svg></button>
<button class="ib" id="density" title="密度:大图 / 密集" aria-label="切换卡片密度"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-layout-grid"/></svg></button>
- <button class="ib" id="censorBtn" title="审查遮挡:共享屏幕时遮住封面与预览图" aria-label="审查遮挡" aria-pressed="false"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-eye-off"/></svg></button>
<button class="ib" id="refresh" title="换一批推荐" aria-label="换一批推荐"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-refresh-cw"/></svg></button>
<button class="ib" id="settingsBtn" title="设置" aria-label="打开设置"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-settings"/></svg></button>
@@ -139,15 +138,29 @@
<div class="settingscard">
<div class="settingsscroll">
<div class="settingshead"><h2 id="settingsTitle">设置</h2><button id="settingsClose" aria-label="关闭设置"><svg viewBox="0 0 24 24"><use href="#i-x"/></svg></button></div>
+ <section class="settinggroup"><h3>浏览</h3>
<label class="settingrow"><span><b>换一批</b><small>排序多久换一次。页面不会自己重排,换的结果在下次刷新时体现。</small></span><select id="rotateSetting"><option value="0">每次刷新</option><option value="5">5 分钟</option><option value="10">10 分钟</option><option value="30">30 分钟</option><option value="1440">每天</option><option value="-1">从不(只手动)</option></select></label>
<label class="settingrow"><span><b>每批作品</b><small>首页每次加载的作品数量。</small></span><select id="batchSizeSetting"><option value="30">30 个</option><option value="60">60 个</option><option value="90">90 个</option></select></label>
<label class="settingrow"><span><b>默认排序</b><small>打开首页时使用的排序。「推荐顺序」按上面的「换一批」频率轮换。</small></span><select id="defaultSortSetting"><option value="seed">推荐顺序</option><option value="daily">每日轮换</option><option value="rand">随机</option><option value="rating">评分</option><option value="o">高潮计数</option><option value="plays">观看次数</option><option value="long">时长</option><option value="big">体积</option><option value="new">最近入库</option><option value="played">最近看的</option></select></label>
<label class="settingrow"><span><b>悬停放大</b><small>转圈完成后进入放大预览。</small></span><select id="hoverDelaySetting"><option value="3">3 秒</option><option value="5">5 秒</option><option value="8">8 秒</option></select></label>
+ </section>
+ <section class="settinggroup"><h3>播放</h3>
<label class="settingrow"><span><b>快进 / 快退</b><small>卡片预览和详情播放器共用。</small></span><select id="seekSecondsSetting"><option value="5">5 秒</option><option value="10">10 秒</option><option value="30">30 秒</option></select></label>
- <label class="settingrow"><span><b>搜索记录</b><small>保存在 Peach 账本,所有访问端同步。</small></span><select id="searchHistoryLimitSetting"><option value="5">最近 5 条</option><option value="10">最近 10 条</option><option value="20">最近 20 条</option></select></label>
<label class="settingrow"><span><b>相关推荐</b><small>详情下方一次显示的相似作品数量。</small></span><select id="relatedLimitSetting"><option value="12">12 个</option><option value="20">20 个</option><option value="30">30 个</option></select></label>
+ </section>
+ <section class="settinggroup"><h3>搜索</h3>
+ <label class="settingrow"><span><b>搜索记录</b><small>保存在 Peach 账本,所有访问端同步。</small></span><select id="searchHistoryLimitSetting"><option value="5">最近 5 条</option><option value="10">最近 10 条</option><option value="20">最近 20 条</option></select></label>
+ </section>
+ <section class="settinggroup"><h3>关注</h3>
<label class="settingrow"><span><b>关注自动更新</b><small id="followScheduleState" aria-live="polite">读取运行状态…</small></span><select id="followScheduleSetting"><option value="0">关闭</option><option value="15">每 15 分钟</option><option value="30">每 30 分钟</option><option value="60">每小时</option><option value="180">每 3 小时</option><option value="360">每 6 小时</option><option value="720">每 12 小时</option><option value="1440">每天</option></select></label>
+ </section>
+ <section class="settinggroup"><h3>界面</h3>
<section class="sidebarsetting" aria-labelledby="sidebarOrderTitle"><span><b id="sidebarOrderTitle">左侧导航</b><small>直接拖动排序;可隐藏入口,也可从具体页面列表重新添加。窄栏和筛选抽屉会保持一致。</small></span><div class="sidebarorder" id="sidebarOrderSetting"></div></section>
+ </section>
+ <section class="settinggroup"><h3>安全</h3>
+ <label class="settingrow"><span><b>审查遮挡</b><small>共享屏幕或截图前开启,遮住全站封面与预览图。默认关闭;只在用会审查内容的模型做测试时需要。</small></span><input type="checkbox" id="censorSetting"></label>
+ </section>
+</section>
</div>
</div>
</section>