Peach: Local-first video metadata scraper and media manager.
fix(web): 框体按 Geist 规范收口,关注标签按 rule34 分类排序
longmeidaob1f0303bba9d
diff --git a/docs/STATUS.md b/docs/STATUS.mdindex c1032c844..f6f12b03f 100644--- a/docs/STATUS.md+++ b/docs/STATUS.md@@ -19,6 +19,7 @@## 已核验能力+- 2026-09-02 管理区归并到「数据管理」,界面口径说明整批清退,三处交互缺陷已修。人工复核、回收站、高清版和垃圾文件、重复文件、空文件夹是同一件事的不同步骤,此前散在管理菜单里各占一行;统计页还挂着链接管理与资源同步两块面板——它们改的是账本和外部现实的对齐,跟「库里现在有多少」不是一件事。现在都归到数据管理一页(原「数据清理」,路由 `/data-cleanup` 不变),管理菜单只留统计/口味/数据管理/关注;`MANAGE_SECTIONS` 仍是全量身份注册表,直达 URL 和「钉到顶层侧栏」都不受影响。新增 `/api/review?counts=1` 只回计数:卡片要的是一个数字,完整 payload 带着每条候选全文是兆级。**文案判据**(已写回 `peach-web-ui`):界面不解释数字是怎么算出来的,口径、免责、隐私声明、「不会做什么」「按什么汇总」一律删,单位跟着数字走(`待同步 497 项`);上一轮跑完的扫描结果不常态显示——那是那一刻的快照,而页面上没有任何东西说它是旧的,因此只有仍在跑的扫描才自动接管页面。**框体**按用户指出的 Geist 规范重做了两轮:第一版给标题加了独立横条和下边框,实际 `vercel.com/geist/fieldset` 的 Multiple Fieldsets 示例全框只有一条线(在底部操作条上方),标题是正文区第一行;现为 `fieldsetTitle()` + `--fieldset-bar-h:52px` 的操作条,按钮一律靠右,左侧有说明时说明推到最左。原生 `<legend>` 不再使用:它在上边框上开缺口,同组卡片内容高度不同时缺口位置也跟着不齐。链接统计不再挤成一行——`官网 · 事务所` 里的间隔点和拼接用的间隔点撞在一起,读出来是「社媒 373 · 官网 · 事务所 224」,分不清哪个数字属于哪一类;类型名改成 `官网/事务所`,每类各占一格,「最多的站点」单独一行。**三个缺陷**:直接打开 `/parts/28125/28125` 再关闭播放器,首页永远停在加载骨架上——判据原先是「`#grid` 有没有子节点」,而深链启动时网格里正躺着那张骨架,它也是子节点;卡片一定带 `data-id`,骨架没有(浏览器实测复现并验证)。撤销原先是「关掉回执 + 另发一条已撤销」,底部对齐的栈里一进一出会整块跳一格,改成结果写回同一条 toast,退场也先把高度写死再过渡到 0。设置面板给 body 加 `overflow:hidden`,滚动条一消失整页横向跳一次,`html` 预留 `scrollbar-gutter:stable`(实测位移 0)。**关注详情标签**按 rule34.xxx 自己的分类顺序分组:2026-09-01 实测帖子页 `18622796`/`18622794`,`#tag-sidebar` 的 `li.tag-type-*` 出现顺序均为 copyright → character → artist → general → metadata,组内按名升序,缺的类型跳过不占位,证据与哈希已登记进 `rule34-follow-tags-and-collections`。**合并分卷与版本**成为设置项(浏览组,默认开);折叠逻辑本来就在,缺的只是开关,实测关掉后首页卡片 77 → 78。Windows 正式全量通过、13 项按平台跳过;数据管理、统计与设置面板在隔离预览实例(127.0.0.1:8900,账本副本、只读)核对渲染。本轮只改静态 JS/CSS/HTML 与一个只读 API 分支,未新增依赖,未写真实 ledger、候选或媒体,未重启或替换生产入口。- 2026-09-01 `/api/related` 从 6.2 秒降到 0.48 秒:`rank_related` 的 MMR 每选中一条,就把整个候选池和**全部**已选重算一遍 closeness,代价是 O(limit² × 池);候选池上限 4000,生产实测 limit=20 要 3.4 秒、28 要 6.3 秒、60 要 32.8 秒,而单张 poster 只要 4.8 毫秒——耗时几乎全在排序,不在 SQL。「候选对已选集的最大 closeness」改为增量维护(新选中一条时只和这一条比一次、取较大值),并把 `_sets` 的重复构造提到循环外;代价降到 O(limit × 池),同一台机器对比 limit=28 为 6.29 → 0.48 秒、limit=60 为 32.75 → 1.10 秒。这是等价变换,不是调参:同一账本上 6 个 seed(2413/485/31025/22887/86187,limit 8/20/28)的 `/api/related` 响应新旧**逐字节相同**;朴素实现作为基准留在 `tests/test_related.py`,等价性对 limit 0/1/3/8/25/200 × diversity 0/0.22/0.6 全部成立,另加一条线性代价上界,任何「每轮重算全部已选」的写法会当场超出。详情页「接着看」、点开 Mix 和悬浮翻动共用这条路径,一起受益。Mix 悬浮翻动跟着从 5 张提到 9 张,第一张改为面板建好后 420 毫秒就翻、不再干等一个完整间隔:实测鼠标停下到第一次翻动 942 毫秒(上一版 1801 毫秒,旧 related 下为 3.1–7.6 秒),9 张面板全部解码成功,中途离开能把预热定时器一并收掉,1440 视口横向溢出 0。变基后工作树 Windows 正式全量 1640 项通过、13 项按平台跳过。本轮未写真实 ledger、候选或媒体,也未新增接口、依赖或迁移。- 2026-09-01 首页 Mix 卡片不再复用同屏第一张封面,并按用户指定加了悬浮封面翻动(这一条动效是用户当场要求,覆盖 `peach-web-ui` 的「无证据不新增动效」默认)。seed 旧写法是 `visible.find(有署名)`,而馆藏里几乎每条都有 creator,那个 `find` 恒等于 `visible[0]`,Mix 卡片又固定插在第 8 位,两者必然同屏;内容一直是对的(队列仍是 seed + `/api/related`),错的只是代表图的选取,因此只改选 seed 这一步:从 Mix 位再往下隔一屏开始找,且要求这一条真能画出图。悬浮时把该 Mix 的前 5 部作品逐张翻走,1.1 秒一张,翻动的每一张与静止封面共用 `mixFacePoster`,门槛沿用悬停预览(多选、遮挡、滞后动画偏好和滚动中都不启动,离开即停)并注册 `_stopHover` 交给 `releaseHoverPreviews` 统一收掉;相关作品按 seed 只取一次,悬浮预取后点开 Mix 不再发第二个请求。浏览器实测揪出两个只看代码看不出的缺陷:翻动的封面插进的是 `hidden` 容器,`loading="lazy"` 没有布局盒就根本不发请求,实测除第一张外四张 `naturalWidth` 全为 0,故翻动一律 `eager`、静止封面仍 lazy;能否画出图的判据必须和渲染器一致,只看 `has_cover||has_thumb` 会把非 JAV 模式下只有官方封套的条目当成有图,选作 seed 或翻到它都是一张「无预览」,现已收敛为共用的 `mixHasPicture`。变基当前主线后 Windows 正式全量 1592 项通过、13 项按平台跳过。开发服务 1440×1000 实测三次刷新:Mix 均在第 8 位、seed 落在 DOM 第 16/19/20 位且与首张卡片不同,5 张面板全部解码成功、`on` 索引 0→1→2→3→4→0 循环,移出后容器清空并 `hidden`,整轮只发一个 `/api/related?id=…&limit=28`,`body.scrollWidth` 1430 ≤ 1440;390×844 为单列 358 px、横向溢出 0,触屏无 hover 且 `openItem` 开头即调 `releaseHoverPreviews`,不留野 interval。截图未取得:内置浏览器在视口模拟下连续返回纯黑画面,上述结论来自 DOM 与 computed style 读取。本轮只改静态 JS/CSS,未新增接口或依赖,未写真实 ledger、候选或媒体,未重启或替换生产入口。- 2026-09-01 死链分「搬走了」和「没了」,资料页链接按实体类型分工,管理页新增链接管理。**404 复查**:新增 `rediscover_entity_links.py`,从死链所在站点的索引页逐层上溯找锚点,候选必须回 200 **且标题里有这个人的名字**——列表页 `/talent/` 同样回 200,少了这一关四百个人会被改写成同一个链接。84 条 official 404 里只有 5 条真的还在,全是 T-POWERS 的同一种结构变更(`/official/talent/X` → `/talent/X/`)。第一版还把 `上川星空` 的 KRONE 死链「修」成了 `x.com/tenma_yui2`:人是对的(`天馬ゆい` 就在账本别名里),但那不是事务所页面,结果会是一条标着「KRONE(クローネ)」、点开却是 Twitter 的 official 链接——比死链更糟,因为它看起来是对的。已加同站约束(`registrable` 取末两段,`co.jp` 这类二级后缀取三段,`evil-t-powers.co.jp` 不算同站)。**资料页分工**:社媒收成纯图标;官网在厂牌页只显示大写域名、不放图标(那一页的头像就是厂牌 logo,再放同品牌小图标是把一件事说两遍),在女优页保留图标与事务所名(头像是人,不构成重复)。别名去掉「别名 ·」前缀、空则整行不出;馆藏检索词整行删除;数字提到正文色;同台艺人不再显示部数。**外链圆标**:新增 `link_marks.py` 与 `/link-mark`,把单色字形 favicon 做成「品牌色底 + 白色主体」。实测 T-POWERS 带透明且只有一种绿,做得出;HEYZO 是白底多色字形,抠图会反转成一团糟,因此判据收成「有真透明 + 色相簇 ≤ 2」,不满足就原样缩放,取不到就回落地球——半吊子的抠图比原图更难看。端点按**链接 id** 解析地址,绝不接受前端递来的 URL(和 `/follow-stream` 同一条规矩,否则就是一个任意地址抓取的口子),顺带浏览器不再直接向对方站点发请求。**管理页**:`web_links.py` 提供 `/api/links`(纯读库的分布概览)、`/api/links/check`(后台线程 + 可轮询,七百多条要几分钟)、`/api/links/prune`(删除前逐条重验,只接受刚跑完那次的 `check_id`);面板放在资源同步上方、沿用同一套盒子,结果分成「已失效」和「取不到」两张表,后者不删只重试。表里的地址用 Geist 中间截断——`/official/talent/X` 与 `/talent/X` 的差别就在尾部。diff --git a/docs/reference-snapshots/rule34-follow-tags-and-collections.md b/docs/reference-snapshots/rule34-follow-tags-and-collections.mdindex bda0a9794..b30126fbe 100644--- a/docs/reference-snapshots/rule34-follow-tags-and-collections.md+++ b/docs/reference-snapshots/rule34-follow-tags-and-collections.md@@ -45,3 +45,21 @@ URL:`https://rule34video.com/video/4533145/…/`Peach 保留类型差异,但不复制白底站点的低亮度原色;在深色界面换成可读的同色相描边和浅底。General 沿用 Peach 蓝色。`2d`、`3d`、`animated`、`video`、`sound`、`tagme` 等载体标签仍留在原始证据里,但不进入前 24 个内容筛选标签。++## Rule34.xxx 帖子页的标签排列顺序++- 取证日期:2026-09-01+- 取证通道:Python HTTPX 直接读取公开 HTML;`#tag-sidebar` 的 `li.tag-type-*` 按出现顺序读取。++| 帖子 | 响应 | SHA-256 | `#tag-sidebar` 类型出现顺序 | 各类型条数 |+| --- | --- | --- | --- | --- |+| `index.php?page=post&s=view&id=18622796` | 200 · 41,563 字节 | `10B3DF9247D0A146274928A50092512575E05F47FAE78B4CEA80F2B82392184C` | copyright → character → artist → general → metadata | 2 / 1 / 1 / 40 / 3 |+| `index.php?page=post&s=view&id=18622794` | 200 · 40,710 字节 | `91EE6DAF284249823EDF3E13D17082E4C3ABDA7D2EF11F2FF08915BD5BAF36A8` | copyright → character → artist → general → metadata | 2 / 1 / 1 / 38 / 2 |++同一次取证里 `id=18622795` 没有 copyright 标签,其余四类顺序不变;缺的类型直接跳过,+不占位。组内按标签名升序:`18622796` 的 general 组前 12 个是+`1girls, abs, bare_arms, bare_legs, bare_shoulders, bare_thighs, big_breasts, bikini,+bikini_bottom, bikini_top, clothed, clothing`,与排序后完全一致。++页面含动态内容,整页哈希只标识这一次响应。Peach 的关注详情按同一顺序分组排列;+来源没有记录类型的标签排在最后,保持中性色,不按词形猜类型。diff --git a/docs/reference-sources.json b/docs/reference-sources.jsonindex ce8391ff5..fb72e42e3 100644--- a/docs/reference-sources.json+++ b/docs/reference-sources.json@@ -68,8 +68,8 @@"name": "Rule34 标签类型与 Rule34Video 合集证据","url": "https://rule34.xxx/css/desktop.css?46","snapshot": "docs/reference-snapshots/rule34-follow-tags-and-collections.md",- "checked_on": "2026-08-27",- "sha256": "011656482c8f503790116da9387c6288b1b37ddba4fc74ce0538beff02a23bdc",+ "checked_on": "2026-09-01",+ "sha256": "28c61584dbb2218964254f603d27eff0852f1b7b02939c1b782b44c7198d28cc","role": "关注页标签类型配色、Rule34Video 内容标签补全与超大跨作者合集排除证据。","consumers": ["src/peach/follow_sources.py",diff --git a/tests/test_follow_web.py b/tests/test_follow_web.pyindex 770533ee4..fd8a60596 100644--- a/tests/test_follow_web.py+++ b/tests/test_follow_web.py@@ -2105,6 +2105,25 @@ class FollowWebSourceTests(unittest.TestCase):self.assertPageContains("if(act)act.onclick=()=>{setActionBusy(act);action.run()};")self.assertPageLacks("条详情")+ def test_detail_tags_follow_rule34s_own_category_order(self):+ """详情标签按 rule34.xxx 帖子页 `#tag-sidebar` 的类型顺序分组,不按字母。++ 2026-09-01 实测两个帖子页(18622796 / 18622794),`li.tag-type-*` 的出现+ 顺序都是 copyright → character → artist → general → metadata,组内按名升序;+ 缺的类型直接跳过不占位。证据见+ docs/reference-snapshots/rule34-follow-tags-and-collections.md。+ """+ self.assertPageContains(+ "const FOLLOW_TAG_ORDER=['copyright','character','artist','general','metadata'];")+ self.assertPageContains("function followDetailTags(item)")+ self.assertPageContains("return at<0?FOLLOW_TAG_ORDER.length:at};")+ self.assertPageContains(+ "return [...tags].sort((a,b)=>rank(a)-rank(b)||tagLabel(a).localeCompare(tagLabel(b)));")+ self.assertPageContains(+ "const tags=followDetailTags(item).map(tag=>followTagChip(item,tag,'button')).join('');")+ # 来源没记类型的排最后、保持中性色:不按词形猜类型是关注标签的既有门槛。+ self.assertPageContains(".followdetailtags .r34-unknown{--r34-tag:var(--muted)}")+def test_follow_bulk_actions_are_buttons_not_inline_links(self):"""批量标记已看/全部忽略是 2292 条级别的操作,不能长得像行内文字链接。diff --git a/tests/test_web_ui.py b/tests/test_web_ui.pyindex 252f29d10..dd1c7c435 100644--- a/tests/test_web_ui.py+++ b/tests/test_web_ui.py@@ -1025,6 +1025,19 @@ class WebUiSourceTests(unittest.TestCase):"统计页只讲库里现在有多少,不该再挂对齐外部现实的面板")self.assertNotIn("resourceSyncMarkup()", stats)+ def test_link_totals_get_one_cell_each_instead_of_one_crammed_line(self):+ """「社媒 373 · 官网 · 事务所 224」读不出哪个数字属于哪一类。++ 类型名自己带间隔点(`官网 · 事务所`),和拼接用的间隔点撞在一起;挤成+ 一行后标签与数字之间也只剩那个点。每类各占一格,类型名改用斜杠。+ """+ self.assertPageContains("official:'官网/事务所'")+ self.assertPageLacks("official:'官网 · 事务所'")+ self.assertPageContains("const stat=(label,value,note='')=>")+ self.assertPageContains(".map(([kind,count])=>stat(KINDS[kind]||kind,Number(count).toLocaleString())).join('');")+ self.assertPageContains(".linkstats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))")+ self.assertPageContains('<div class="linkhosts"><span>最多的站点</span>')+def test_taste_page_combines_private_exports_and_peach_behavior(self):self.assertPageContains("if(path==='/taste'){await openTaste(false);return}")self.assertPageContains("/api/taste?window=")@@ -2298,11 +2311,11 @@ class WebUiSourceTests(unittest.TestCase):self.assertPageContains("async function openDataCleanup(push=true)")self.assertPageContains("route('/data-cleanup')")self.assertPageContains("api('/api/ads?limit=1'),api('/api/duplicates?limit=1'),api('/api/sources')")- # 标题在框体里,不用原生 legend——legend 会在上边框上开个缺口,+ # 标题是正文区的第一行,不用原生 legend——legend 会在上边框上开个缺口,# 三张卡内容高度不同时那道缺口的位置也跟着不齐。- for title in ("fieldsetHeader('cleanupJunkTitle','垃圾文件')",- "fieldsetHeader('cleanupDupTitle','重复文件')",- "fieldsetHeader('cleanupEmptyTitle','空文件夹')"):+ for title in ("fieldsetTitle('cleanupJunkTitle','垃圾文件')",+ "fieldsetTitle('cleanupDupTitle','重复文件')",+ "fieldsetTitle('cleanupEmptyTitle','空文件夹')"):self.assertPageContains(title)self.assertPageLacks("<legend>垃圾文件</legend>")self.assertPageContains('class="cleanupfieldset" data-geist-fieldset aria-labelledby=')@@ -2310,12 +2323,15 @@ class WebUiSourceTests(unittest.TestCase):self.assertPageContains("api('/api/data-cleanup/empty-folders',{method:'POST',body:'{}'})")self.assertPageContains("来源根目录不会删除")self.assertPageContains(".cleanupfieldset>.geist-fieldset-content{flex:1;min-height:0;padding:20px}")- # 头尾两条横条同一份尺寸口径,文字与按钮竖直居中。+ # Geist 的 Fieldset 全框只有一条线,在底部操作条上方;标题底下不划线。self.assertPageContains("--fieldset-bar-h:52px;")- self.assertPageContains(- ".geist-fieldset-header,.cleanupfieldset>.geist-fieldset-footer{box-sizing:border-box;")- self.assertPageContains("height:var(--fieldset-bar-h);margin:0;padding:0 16px 0 20px;"- "display:flex;align-items:center;gap:8px}")+ self.assertPageContains(".geist-fieldset-title{margin:0 0 10px;")+ self.assertPageLacks(".geist-fieldset-header")+ self.assertPageContains(".cleanupfieldset>.geist-fieldset-footer{box-sizing:border-box;"+ "height:var(--fieldset-bar-h);")+ # 按钮一律靠右;左边有说明时说明推到最左。+ self.assertPageContains("justify-content:flex-end;gap:8px;")+ self.assertPageContains(".resourcesyncfooter>p,.resourceapplyrow>p{margin-right:auto}")self.assertPageContains("if(path==='/data-cleanup'){await openDataCleanup(false);return}")def test_duplicate_batch_keeps_one_per_cluster_not_one_per_code(self):@@ -2618,6 +2634,22 @@ class WebUiSourceTests(unittest.TestCase):self.assertPageContains("openEditions(it.edition_group.seed_id,id,true,anchor)")self.assertPageContains("if(parts[0]==='editions'", "刷新或前进后退要能回到同一个版次")+ def test_group_collapse_is_a_setting_and_defaults_to_on(self):+ """合并分卷与版本可以关掉,关掉后同番号的每一卷/每一版各占一张卡。++ 折叠是渲染时做的,所以改完必须重取当前列表:不重画的话,之前被跳过的+ 那些卡不会自己冒出来,看上去像开关没生效。+ """+ self.assertPageContains("groupCollapse:true,sidebarOrder:DEFAULT_SIDEBAR_ORDER};")+ self.assertPageContains("appSettings.groupCollapse=appSettings.groupCollapse!==false;")+ self.assertPageContains('<input type="checkbox" id="groupCollapseSetting">')+ self.assertPageContains("$('#groupCollapseSetting').checked=appSettings.groupCollapse;")+ self.assertPageContains(+ "$('#groupCollapseSetting').onchange=e=>{appSettings.groupCollapse=!!e.target.checked;"+ "saveSettings();reloadCurrentSurface()};")+ self.assertEqual(self.page.count("if(!appSettings.groupCollapse)return items;"), 2,+ "分卷和版次两套折叠都要认这个开关")+def test_both_collapse_sets_are_cleared_together(self):"""折叠用的集合必须和分卷那套一起清。diff --git a/web/app.css b/web/app.cssindex b9a44d875..9de36f3ac 100644--- a/web/app.css+++ b/web/app.css@@ -253,13 +253,15 @@ button[aria-busy="true"],[role="button"][aria-busy="true"]{.reviewactions button{box-sizing:border-box;height:32px;border:1px solid var(--border-15);border-radius:8px;background:transparent;color:var(--ink-2);padding:0 12px;font-size:var(--fs-sm);cursor:pointer}.reviewactions button:hover{border-color:var(--tungsten);color:var(--ink)}.reviewactions .approve{background:var(--tungsten);border-color:var(--tungsten);color:#fff;font-weight:600}.reviewactions .approve:hover{background:color-mix(in srgb,var(--tungsten) 82%,#000);color:#fff}.reviewactions .skip{color:var(--meter)}.reviewactions .skip:hover{background:var(--meter);border-color:var(--meter);color:#fff}.reviewactions .reject{color:var(--drop)}.reviewactions .reject:hover{background:var(--drop);border-color:var(--drop);color:#fff}.cleanuploading,.junkloading{grid-column:1/-1;min-height:280px;display:grid;place-items:center}.cleanupgrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;padding:0 0 42px}-/* 框体的上下两条横条只有一份尺寸口径:52px、竖直居中。三张卡内容高度不同时- 仍然共用同一行网格,不会一张比一张矮半格。 */-.geist-fieldset-header,.cleanupfieldset>.geist-fieldset-footer{box-sizing:border-box;- height:var(--fieldset-bar-h);margin:0;padding:0 16px 0 20px;display:flex;align-items:center;gap:8px}-.geist-fieldset-header{border-bottom:1px solid var(--border-10)}-.geist-fieldset-header h3{margin:0;color:var(--ink);font-size:var(--fs-lg);font-weight:600}-.cleanupfieldset>.geist-fieldset-footer{border-top:1px solid var(--border-10);background:var(--overlay-5)}+/* Geist Fieldset:全框只有一条线,在底部操作条上方。标题是正文区的第一行,+ 底下不划线(证据:vercel.com/geist/fieldset 的 Multiple Fieldsets 示例)。+ 操作条固定 52px、竖直居中,按钮一律靠右;左侧有说明时说明推到最左。 */+.geist-fieldset-title{margin:0 0 10px;color:var(--ink);font-size:var(--fs-lg);font-weight:600}+.cleanupfieldset>.geist-fieldset-footer{box-sizing:border-box;height:var(--fieldset-bar-h);+ margin:0;padding:0 16px 0 20px;display:flex;align-items:center;justify-content:flex-end;gap:8px;+ border-top:1px solid var(--border-10);background:var(--overlay-5)}+.geist-fieldset-footer>p,.geist-fieldset-footer>span,+.resourcesyncfooter>p,.resourceapplyrow>p{margin-right:auto}.cleanupfieldset{display:flex;flex-direction:column;min-width:0;min-height:176px;margin:0;padding:0;overflow:hidden;border:1px solid var(--line-soft);border-radius:12px;background:var(--surface)}.cleanupfieldset>.geist-fieldset-content{flex:1;min-height:0;padding:20px}.cleanupfieldset strong{display:block;margin-bottom:10px;font-size:var(--fs-xl)}@@ -752,7 +754,7 @@ main{position:relative;z-index:1;padding:14px 16px 90px}.count.count-actions-only{position:relative;top:auto;min-height:0;margin:0 0 16px;padding:0;justify-content:flex-end}.count.count-actions-only:empty{display:none}.resourcesync{scroll-margin-top:calc(var(--topH) + 18px);display:grid;gap:16px}.resourcesync>h2{margin:0;font-size:var(--fs-xl)}-.resourcesyncbox,.resourcepanel{overflow:clip;border:1px solid var(--line-soft);border-radius:12px;background:var(--surface)}.resourcesyncbody{padding:20px}.resourcesyncbody p{max-width:760px;margin:0;color:var(--muted);font-size:var(--fs-sm);line-height:1.55}.resourcesyncfooter,.resourceapplyrow{box-sizing:border-box;height:var(--fieldset-bar-h);display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 16px;border-top:1px solid var(--line-soft);background:var(--overlay-5)}.resourcesyncfooter p,.resourceapplyrow>p{margin:0;color:var(--muted);font-size:var(--fs-xs);line-height:1.5}.resourceaction{box-sizing:border-box;height:36px;padding:0 12px;border:1px solid var(--border-15);border-radius:var(--control-radius);background:var(--surface);color:var(--ink-2);display:inline-flex;align-items:center;justify-content:center;gap:8px;flex:none;font:inherit;font-size:var(--fs-sm);font-weight:550;cursor:pointer;transition:background-color .12s,border-color .12s,color .12s}.resourceaction:hover:not(:disabled){background:var(--hover);border-color:color-mix(in srgb,var(--ink) 28%,transparent);color:var(--ink)}.resourceaction:focus-visible{outline:2px solid var(--tungsten);outline-offset:2px}.resourceaction:disabled{cursor:default;opacity:.68}.resourceaction svg{width:16px;height:16px;stroke:currentColor;fill:none}#resourceSyncResult:empty{display:none}.resourcescanning,.resourceerror{margin:0;padding:14px 16px;border:1px solid var(--line-soft);border-radius:var(--control-radius);color:var(--muted)}.resourceerror{color:var(--drop)}.resourcesources{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.resourcesources article{display:grid;gap:4px;min-width:0;padding:16px}.resourcesources article+article{border-left:1px solid var(--line-soft)}.resourcesourcetitle{display:flex;align-items:center;justify-content:space-between;gap:12px}.resourcesourcetitle span{font-size:var(--fs-xs)}.resourcesources .online{color:var(--success)}.resourcesources .offline{color:var(--drop)}.resourcesources strong{margin-top:10px;font-size:var(--fs-2xl);font-variant-numeric:tabular-nums}.resourcesources small,.resourcecache small{color:var(--muted)}/* 这里是一排读数,不是又一个盒子。原先它自带填色和分格线,和下面的操作条同色,+.resourcesyncbox,.resourcepanel{overflow:clip;border:1px solid var(--line-soft);border-radius:12px;background:var(--surface)}.resourcesyncbody{padding:20px}.resourcesyncbody p{max-width:760px;margin:0;color:var(--muted);font-size:var(--fs-sm);line-height:1.55}.resourcesyncfooter,.resourceapplyrow{box-sizing:border-box;height:var(--fieldset-bar-h);display:flex;align-items:center;justify-content:flex-end;gap:16px;padding:0 20px;border-top:1px solid var(--line-soft);background:var(--overlay-5)}.resourcesyncfooter p,.resourceapplyrow>p{margin:0;color:var(--muted);font-size:var(--fs-xs);line-height:1.5}.resourceaction{box-sizing:border-box;height:36px;padding:0 12px;border:1px solid var(--border-15);border-radius:var(--control-radius);background:var(--surface);color:var(--ink-2);display:inline-flex;align-items:center;justify-content:center;gap:8px;flex:none;font:inherit;font-size:var(--fs-sm);font-weight:550;cursor:pointer;transition:background-color .12s,border-color .12s,color .12s}.resourceaction:hover:not(:disabled){background:var(--hover);border-color:color-mix(in srgb,var(--ink) 28%,transparent);color:var(--ink)}.resourceaction:focus-visible{outline:2px solid var(--tungsten);outline-offset:2px}.resourceaction:disabled{cursor:default;opacity:.68}.resourceaction svg{width:16px;height:16px;stroke:currentColor;fill:none}#resourceSyncResult:empty{display:none}.resourcescanning,.resourceerror{margin:0;padding:14px 16px;border:1px solid var(--line-soft);border-radius:var(--control-radius);color:var(--muted)}.resourceerror{color:var(--drop)}.resourcesources{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.resourcesources article{display:grid;gap:4px;min-width:0;padding:16px}.resourcesources article+article{border-left:1px solid var(--line-soft)}.resourcesourcetitle{display:flex;align-items:center;justify-content:space-between;gap:12px}.resourcesourcetitle span{font-size:var(--fs-xs)}.resourcesources .online{color:var(--success)}.resourcesources .offline{color:var(--drop)}.resourcesources strong{margin-top:10px;font-size:var(--fs-2xl);font-variant-numeric:tabular-nums}.resourcesources small,.resourcecache small{color:var(--muted)}/* 这里是一排读数,不是又一个盒子。原先它自带填色和分格线,和下面的操作条同色,两条带子连在一起看不出边界;框里再套框也是多余的一层。 */.resourcecache{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 32px;border-top:1px solid var(--line-soft);padding:16px 20px}.resourcecache>div{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;gap:4px 16px}.resourcecache b{font-size:var(--fs-2xl);font-variant-numeric:tabular-nums}.resourcecache span{font-weight:650}.resourcecache small{grid-column:1/-1}.resourceapplyrow .resourcesyncok{color:var(--success)}.resourcedanger{color:var(--drop)}.resourcedanger:hover:not(:disabled){border-color:color-mix(in srgb,var(--drop) 42%,transparent);background:color-mix(in srgb,var(--drop) 8%,transparent);color:var(--drop)}.resourcesyncok{margin:0;color:var(--success)}.tagbar,.count,.entitytagbar,.entitycollectionhead{transition:background-color .16s ease,border-color .16s ease}@@ -2302,7 +2304,12 @@ details.fcred{display:block}*[data-middle-truncate]{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:clip}/* 链接管理沿用资源同步那套盒子,只加这里独有的两块:概览格和结果表。表格必须自己横向滚动——地址列很长,让它撑破 body 会把整页拖成横向可滚。 */-.linksummary .resourcecache{border-top:0;padding:0}+.linkstats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px 32px;margin-top:16px}+.linkstats>div,.linkhosts{display:grid;gap:2px;min-width:0}+.linkstats span,.linkhosts span{color:var(--muted);font-size:var(--fs-xs)}+.linkstats b{font-size:var(--fs-xl);font-variant-numeric:tabular-nums}+.linkstats small{color:var(--muted);font-size:var(--fs-xs)}+.linkhosts{margin-top:16px}.linkhosts b{font-weight:500;font-size:var(--fs-sm);overflow-wrap:anywhere}.linksummary .resourcecache b{font-size:var(--fs-lg)}.linkgroup{padding:16px;border-top:1px solid var(--line-soft)}.linkgroup:first-child{border-top:0}.linkgroup h4{margin:0 0 4px;font-size:var(--fs-md);font-weight:600}diff --git a/web/app.js b/web/app.jsindex 7822a0aae..a6e3959ba 100644--- a/web/app.js+++ b/web/app.js@@ -1,7 +1,7 @@import {$, ENTITY_ROUTES, LOC, ROUTE_ENTITIES, ROUTE_STATES, SITE_FAVICONS, STATE_LABELS, STATE_ROUTES, api, brandIcon, entityPath, esc, faviconFallbackUrl, faviconUrl, linkHost, linkMarkUrl, fmtClock, fmtDur, fmtSize, foldName, icon, isCatalogPath, pageTitle, realDuration} from './js/core.js';import { initMiddleTruncate } from './js/middle-truncate.js';import {- emptyStateHtml, fieldsetHeader, loadingDotsHtml, mediaViewButtonsHtml, noteHtml, progressHtml,+ emptyStateHtml, fieldsetTitle, loadingDotsHtml, mediaViewButtonsHtml, noteHtml, progressHtml,scrollerHtml, setActionBusy, skeletonHtml, spinnerHtml, wireBusyActions, wireScrollers,} from './js/ui-components.js';@@ -153,7 +153,7 @@ const SORTS=[['seed','随机'],['rating','评分'],['o','高潮计数'],['plays'['big','体积'],['new','最近入库'],['played','最近看的']];const JAV_RELEASE_SORT=['release','发行时间'];const SORT_KEYS=[...SORTS,JAV_RELEASE_SORT].map(([key])=>key);-const DEFAULT_SETTINGS={batchSize:60,defaultSort:'seed',sortDefaultsVersion:2,hoverDelaySeconds:5,seekSeconds:10,searchHistoryLimit:10,relatedLimit:20,javLayout:'big',ambientMode:true,theaterMode:false,sidebarOrder:DEFAULT_SIDEBAR_ORDER};+const DEFAULT_SETTINGS={batchSize:60,defaultSort:'seed',sortDefaultsVersion:2,hoverDelaySeconds:5,seekSeconds:10,searchHistoryLimit:10,relatedLimit:20,javLayout:'big',ambientMode:true,theaterMode:false,groupCollapse:true,sidebarOrder:DEFAULT_SIDEBAR_ORDER};let appSettings={...DEFAULT_SETTINGS};try{appSettings={...DEFAULT_SETTINGS,...JSON.parse(localStorage.getItem(SETTINGS_KEY)||'{}')}}catch(_e){}const allowedSetting=(value,allowed,fallback)=>allowed.includes(value)?value:fallback;@@ -171,6 +171,7 @@ appSettings.hoverDelaySeconds=allowedSetting(+appSettings.hoverDelaySeconds,[3,5appSettings.seekSeconds=allowedSetting(+appSettings.seekSeconds,[5,10,30],10);appSettings.ambientMode=appSettings.ambientMode!==false;appSettings.theaterMode=appSettings.theaterMode===true;+appSettings.groupCollapse=appSettings.groupCollapse!==false;appSettings.searchHistoryLimit=allowedSetting(+appSettings.searchHistoryLimit,[5,10,20],10);appSettings.relatedLimit=allowedSetting(+appSettings.relatedLimit,[12,20,30],20);const sidebarKeyAlias=key=>key==='ads'||key==='dupes'?'data-cleanup':key;@@ -183,6 +184,7 @@ function syncSettingsPanel(){$('#batchSizeSetting').value=String(appSettings.batchSize);$('#defaultSortSetting').value=appSettings.defaultSort;$('#hoverDelaySetting').value=String(appSettings.hoverDelaySeconds);+ $('#groupCollapseSetting').checked=appSettings.groupCollapse;$('#seekSecondsSetting').value=String(appSettings.seekSeconds);$('#searchHistoryLimitSetting').value=String(appSettings.searchHistoryLimit);$('#relatedLimitSetting').value=String(appSettings.relatedLimit);@@ -224,6 +226,9 @@ $('#settingsPanel').onkeydown=e=>{$('#batchSizeSetting').onchange=e=>{appSettings.batchSize=+e.target.value||60;saveSettings();if(location.pathname==='/')load(true)};$('#defaultSortSetting').onchange=e=>{appSettings.defaultSort=e.target.value;saveSettings();state.sort=appSettings.defaultSort;if(location.pathname==='/')load(true)};$('#hoverDelaySetting').onchange=e=>{appSettings.hoverDelaySeconds=+e.target.value||5;document.documentElement.style.setProperty('--hover-delay',`${appSettings.hoverDelaySeconds}s`);saveSettings()};+/* 关掉后同一番号的每个分卷/版次各占一张卡。改完要重取当前列表:折叠是在渲染+ 时做的,不重画的话已经被跳过的那些卡不会自己冒出来。 */+$('#groupCollapseSetting').onchange=e=>{appSettings.groupCollapse=!!e.target.checked;saveSettings();reloadCurrentSurface()};$('#seekSecondsSetting').onchange=e=>{appSettings.seekSeconds=+e.target.value||10;saveSettings()};$('#searchHistoryLimitSetting').onchange=e=>{appSettings.searchHistoryLimit=+e.target.value||10;saveSettings();writeSearchHistory(readSearchHistory())};$('#relatedLimitSetting').onchange=e=>{appSettings.relatedLimit=+e.target.value||20;saveSettings()};@@ -1377,6 +1382,7 @@ let renderedPartGroups=new Set();——有码、中字、无码。它们能同时出现在一个番号上,所以两套 key 分开记,不共用。 */let renderedEditionGroups=new Set();function collapseMultipartItems(items){+ if(!appSettings.groupCollapse)return items;return items.filter(it=>{const key=it.part_group?.key;if(!key)return true;@@ -1385,6 +1391,7 @@ function collapseMultipartItems(items){});}function collapseEditionGroups(items){+ if(!appSettings.groupCollapse)return items;return items.filter(it=>{const key=it.edition_group?.key;if(!key)return true;@@ -1953,8 +1960,9 @@ function closeStats(push=true){if(push)route('/');showHomeSurfaces();load(true)}function linkManagerMarkup(){return `<section class="resourcesync" id="link-manager" aria-labelledby="linkManagerTitle"><h2 id="linkManagerTitle">链接管理</h2>- <div class="resourcesyncbox" data-geist-fieldset>${fieldsetHeader('linkBoxTitle','外链与实体')}- <div class="resourcesyncbody geist-fieldset-content"><div id="linkSummary" class="linksummary"></div></div>+ <div class="resourcesyncbox" data-geist-fieldset>+ <div class="resourcesyncbody geist-fieldset-content">${fieldsetTitle('linkBoxTitle','外链与实体')}+ <div id="linkSummary" class="linksummary"></div></div><div class="resourcesyncfooter geist-fieldset-footer" data-geist-fieldset-footer><button class="resourceaction" type="button" id="linkCheck">${icon('refresh-cw')}<span>检查死链</span></button></div></div><div id="linkCheckResult" aria-live="polite"></div></section>`;@@ -1963,12 +1971,21 @@ async function wireLinkManager(){const button=$('#linkCheck'),result=$('#linkCheckResult'),summary=$('#linkSummary');if(!button||!result)return;const active=()=>location.pathname==='/data-cleanup'&&!$('#stats').hidden&&document.body.contains(result);- const KINDS={official:'官网 · 事务所',social:'社媒',catalog:'资料库',source_reference:'来源记录'};+ /* `官网 · 事务所` 里的间隔点会和「按类型」那行的分隔点撞在一起,读出来是+ 「社媒 373 · 官网 · 事务所 224」——分不清哪个数字属于哪一类。 */+ const KINDS={official:'官网/事务所',social:'社媒',catalog:'资料库',source_reference:'来源记录'};try{const info=await api('/api/links');- summary.innerHTML=`<div class="resourcecache"><div><span>链接</span><b>${info.total.toLocaleString()}</b><small>分布在 ${info.entities.toLocaleString()} 个实体上</small></div>- <div><span>按类型</span><b>${Object.entries(info.by_kind||{}).map(([k,n])=>`${KINDS[k]||k} ${n}`).join(' · ')||'—'}</b>- <small>最多的站点:${(info.top_hosts||[]).slice(0,3).map(([h,n])=>`${esc(h)} ${n}`).join(' · ')||'—'}</small></div></div>`;+ /* 每一类各占一格。挤成一行时标签和数字之间只剩间隔点,数字归谁全靠猜。 */+ const stat=(label,value,note='')=>`<div><span>${esc(label)}</span><b>${value}</b>${+ note?`<small>${note}</small>`:''}</div>`;+ const kinds=Object.entries(info.by_kind||{})+ .map(([kind,count])=>stat(KINDS[kind]||kind,Number(count).toLocaleString())).join('');+ const hosts=(info.top_hosts||[]).slice(0,3).map(([host,count])=>`${esc(host)} ${count}`).join(' · ');+ summary.innerHTML=`<div class="linkstats">+ ${stat('链接',info.total.toLocaleString(),`分布在 ${info.entities.toLocaleString()} 个实体上`)}+ ${kinds}</div>+ ${hosts?`<div class="linkhosts"><span>最多的站点</span><b>${hosts}</b></div>`:''}`;}catch(error){summary.innerHTML=noteHtml(error.message,{variant:'error',label:'读取失败'})}const row=item=>`<tr><td>${esc(item.entity)}</td><td>${esc(KINDS[item.link_kind]||item.link_kind)}</td>@@ -2021,8 +2038,9 @@ async function wireLinkManager(){function resourceSyncMarkup(){return `<section class="resourcesync" id="resource-sync" aria-labelledby="resourceSyncTitle"><h2 id="resourceSyncTitle">资源同步</h2>- <div class="resourcesyncbox" data-geist-fieldset>${fieldsetHeader('resourceBoxTitle','网盘与账本')}- <div class="resourcesyncbody geist-fieldset-content"><p>网盘上已删除的条目进入回收站;只清理没有在用的预览与播放缓存。</p></div>+ <div class="resourcesyncbox" data-geist-fieldset>+ <div class="resourcesyncbody geist-fieldset-content">${fieldsetTitle('resourceBoxTitle','网盘与账本')}+ <p>网盘上已删除的条目进入回收站;只清理没有在用的预览与播放缓存。</p></div><div class="resourcesyncfooter geist-fieldset-footer" data-geist-fieldset-footer><button class="resourceaction" type="button" id="resourceScan">${icon('refresh-cw')}<span>扫描差异</span></button></div></div><div id="resourceSyncResult" aria-live="polite"></div></section>`;@@ -2366,25 +2384,25 @@ async function openDataCleanup(push=true){`<span class="cleanupsource" data-online="${source.online?'true':'false'}">${esc(LOC[source.location]||source.location)} · ${source.online?'在线':'离线'}</span>`).join('');$('#stats').innerHTML=`<div class="cleanupgrid"><section class="cleanupfieldset" data-geist-fieldset aria-labelledby="cleanupJunkTitle">- ${fieldsetHeader('cleanupJunkTitle','垃圾文件')}- <div class="geist-fieldset-content"><strong>${Number(junk.pending_total||0).toLocaleString()} 个待判断</strong></div>+ <div class="geist-fieldset-content">${fieldsetTitle('cleanupJunkTitle','垃圾文件')}+ <strong>${Number(junk.pending_total||0).toLocaleString()} 个待判断</strong></div><footer class="geist-fieldset-footer" data-geist-fieldset-footer><button type="button" data-cleanup-open="junk">查看垃圾文件</button></footer></section><section class="cleanupfieldset" data-geist-fieldset aria-labelledby="cleanupDupTitle">- ${fieldsetHeader('cleanupDupTitle','重复文件')}- <div class="geist-fieldset-content"><strong>${Number(duplicates.total||0).toLocaleString()} 组 · ${Number(duplicates.files||0).toLocaleString()} 个文件</strong></div>+ <div class="geist-fieldset-content">${fieldsetTitle('cleanupDupTitle','重复文件')}+ <strong>${Number(duplicates.total||0).toLocaleString()} 组 · ${Number(duplicates.files||0).toLocaleString()} 个文件</strong></div><footer class="geist-fieldset-footer" data-geist-fieldset-footer><button type="button" data-cleanup-open="duplicates">查看重复文件</button></footer></section><section class="cleanupfieldset cleanupemptyfolders" data-geist-fieldset aria-labelledby="cleanupEmptyTitle">- ${fieldsetHeader('cleanupEmptyTitle','空文件夹')}- <div class="geist-fieldset-content"><p>不会删除来源根目录。</p>+ <div class="geist-fieldset-content">${fieldsetTitle('cleanupEmptyTitle','空文件夹')}+ <p>不会删除来源根目录。</p><div class="cleanupsources">${sourceState}</div><p class="cleanupstate" aria-live="polite"></p></div><footer class="geist-fieldset-footer" data-geist-fieldset-footer><button type="button" class="danger" data-cleanup-empty>${icon('trash')}<span>删除空文件夹</span></button></footer></section>${DATA_MANAGEMENT_ENTRIES.map(([section,title,label])=>`<section class="cleanupfieldset" data-geist-fieldset aria-labelledby="cleanup-${section}-title">- ${fieldsetHeader(`cleanup-${section}-title`,title)}- <div class="geist-fieldset-content"><strong data-cleanup-count="${section}">—</strong></div>+ <div class="geist-fieldset-content">${fieldsetTitle(`cleanup-${section}-title`,title)}+ <strong data-cleanup-count="${section}">—</strong></div><footer class="geist-fieldset-footer" data-geist-fieldset-footer><button type="button" data-cleanup-go="${section}">${esc(label)}</button></footer></section>`).join('')}</div>@@ -2786,6 +2804,17 @@ const followTagType=(item,tag)=>item.tag_types&&item.tag_types[tag]||'unknown';const followCardTags=item=>item.tags||[];const followTagChip=(item,tag,kind='span')=>`<${kind} class="tg r34-${esc(followTagType(item,tag))}" data-follow-tag="${esc(tag)}">${esc(tagLabel(tag))}</${kind}>`;+/* 详情标签按 rule34.xxx 帖子页 `#tag-sidebar` 的类型顺序分组,组内按名升序——+ 证据见 docs/reference-snapshots/rule34-follow-tags-and-collections.md(2026-09-01+ 两个帖子页实测,顺序一致,缺的类型直接跳过不占位)。+ 来源没记类型的排最后并保持中性色:不按词形猜类型是关注标签的既有门槛。 */+const FOLLOW_TAG_ORDER=['copyright','character','artist','general','metadata'];+function followDetailTags(item){+ const tags=item.detail_tags||item.tags||[];+ const rank=tag=>{const at=FOLLOW_TAG_ORDER.indexOf(followTagType(item,tag));+ return at<0?FOLLOW_TAG_ORDER.length:at};+ return [...tags].sort((a,b)=>rank(a)-rank(b)||tagLabel(a).localeCompare(tagLabel(b)));+}function followBadges(group){const badges=[];@@ -2981,8 +3010,7 @@ async function openFollowDetail(id,push=true,mediaIndex=null,preserveReturn=fals<div class="followimagedots" role="group" aria-label="${imageMedia.length} 张图片">${imageMedia.map((image,index)=>`<button data-follow-image-item="${image.index}" aria-current="${index===imagePosition}" aria-label="第 ${index+1} 张,共 ${imageMedia.length} 张" title="第 ${index+1} 张"></button>`).join('')}</div>`:'';const badges=followBadges({primary:item,variants:[],duplicates:[],has_wip:item.variant_kind==='wip'});// 卡片只消费 general 内容投影;详情保留来源记录的全部类型,并按类型着色。- const tags=(item.detail_tags||item.tags||[])- .map(tag=>followTagChip(item,tag,'button')).join('');+ const tags=followDetailTags(item).map(tag=>followTagChip(item,tag,'button')).join('');const author=followAuthorName(authorSources)||item.author||item.source_label||'作者未取得';const postedBy=item.author&&foldName(item.author)!==foldName(author)?item.author:'';const mediaIssue=followMediaIssue(item);diff --git a/web/index.html b/web/index.htmlindex 8b336dae3..4950f355e 100644--- a/web/index.html+++ b/web/index.html@@ -175,6 +175,7 @@<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="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>+ <label class="settingrow"><span><b>合并分卷与版本</b><small>同一番号的多个分卷或版次只占一张卡,展示第一个。</small></span><input type="checkbox" id="groupCollapseSetting"></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>diff --git a/web/js/ui-components.js b/web/js/ui-components.jsindex 91ace6293..4e8faed69 100644--- a/web/js/ui-components.js+++ b/web/js/ui-components.js@@ -12,15 +12,14 @@ export function noteHtml(message,{variant='secondary',label='',className=''}={})}/**- * Geist Fieldset 的标题条。标题放在框体里,不用原生 `<legend>`。+ * Geist Fieldset 的标题。标题是正文区的第一行,不是独立横条。*- * `<legend>` 会在上边框上开一个缺口,标题看起来骑在线上而不是在框里;三张卡的- * 内容高度不同时,那道缺口的位置也跟着不齐。改成框内固定 52px 的横条后,- * 标题条、内容区、底部操作条三段在同一行网格上对齐。+ * 不用原生 `<legend>`:它会在上边框上开一个缺口,标题看起来骑在线上而不是在+ * 框里。也不给标题加下边框——Geist 的 Fieldset 全框只有一条线,在底部操作条+ * 上方(证据:https://vercel.com/geist/fieldset 的 Multiple Fieldsets 示例)。*/-export function fieldsetHeader(id,title){- return `<header class="geist-fieldset-header" data-geist-fieldset-header>- <h3 id="${esc(id)}">${esc(title)}</h3></header>`;+export function fieldsetTitle(id,title){+ return `<h3 class="geist-fieldset-title" id="${esc(id)}">${esc(title)}</h3>`;}/** Determinate progress only. Callers supply real units instead of a decorative width. */