Skip to content

armgit / peach

Public Imported from GitHub
0

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

feat: 沉浸模式点标题进详情;手机上各页标题也统一

longmeidao49ce5df16333
diff --git a/tests/test_web_ui.py b/tests/test_web_ui.py
index effa8b3d9..3cfbd0362 100644
--- a/tests/test_web_ui.py
+++ b/tests/test_web_ui.py
@@ -573,6 +573,16 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains("tokTouch.axis=Math.abs(dx)>Math.abs(dy)?'x':'y';")
self.assertPageContains("{passive:false}")
+ def test_immersive_title_opens_the_detail_page(self):
+ """沉浸模式里只看得到文件名。想看标签、相关推荐或改东西,
+ 原来得先退出再去列表里把它找回来。旁边的创作者一直是可点的,标题不是。
+ """
+ self.assertPageContains('<button type="button" class="toktitle" id="tokTitle">')
+ self.assertPageContains(
+ "$('#tokTitle').onclick=()=>{const id=it.id;$('#tokClose').click();openItem(id)};")
+ # `.tokui` 整层 pointer-events:none,不把标题放行就是个点不到的按钮。
+ self.assertPageContains(".tokui a,.tokui .toktitle{pointer-events:auto}")
+
def test_review_reuses_the_standard_selection_instead_of_its_own_mode(self):
"""复核页曾自造「多选模式」按钮加框选,只在这一页生效,用户得先发现再记住。
diff --git a/web/app.css b/web/app.css
index 810697c89..8525f65cf 100644
--- a/web/app.css
+++ b/web/app.css
@@ -1018,7 +1018,13 @@ body.drawer-open .edge{opacity:0;pointer-events:none} /* 展开时窄栏让位
.tokbar.scrubbing::before,.tokbar.scrubbing i{height:9px}
.tokui a{color:var(--tungsten);text-decoration:none}
.tokui a:hover{text-decoration:underline}
-.tokui{pointer-events:none} .tokui a{pointer-events:auto}
+.tokui{pointer-events:none} .tokui a,.tokui .toktitle{pointer-events:auto}
+/* 标题是进详情页的入口,所以是按钮;但它在画面上就是一行字,
+ 不能长成按钮的样子。只在悬停时用下划线提示可点,和旁边的创作者链接一致。 */
+.tokui .toktitle{display:block;max-width:100%;margin:0 0 5px;padding:0;border:0;background:none;
+ color:inherit;font:inherit;font-size:14px;text-align:left;cursor:pointer;
+ overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
+.tokui .toktitle:hover{text-decoration:underline}
.tokbtns button[aria-pressed="true"]{background:var(--tungsten);color:#1A1206;border-color:var(--tungsten)}
.tokclose{position:absolute;top:15px;right:15px;width:42px;height:42px;background:rgba(0,0,0,.5);color:#EEE;
border:0;border-radius:50%;padding:0;display:grid;place-items:center;cursor:pointer}.tokclose svg{width:21px;height:21px;stroke:currentColor;fill:none}
@@ -1085,6 +1091,9 @@ body.drawer-open .edge{opacity:0;pointer-events:none} /* 展开时窄栏让位
.entityhero{grid-template-columns:92px minmax(0,1fr);gap:14px;padding:8px 0 18px}
.entityportrait{width:92px}.entityhero h2{font-size:20px}
.statshead{align-items:center}.stats h2{font-size:23px}.scards{grid-template-columns:minmax(0,1fr)}
+ /* 窄屏下标题也得一起缩。`/follow` 渲染在 `#stats` 里,上面那条 `.stats h2`
+ 会只把它打到 23px,而 `#manageTitle` 在 `#stats` 外面,手机上又变成两种大小。 */
+ .pagetitle,.managetitle,.index .ihead h2,.playlistpage h2{font-size:23px}
.scard2{padding:16px}.kv .u{display:block;margin-left:0;margin-top:2px}
.ctags .tg:nth-child(n+3){display:none}
}
diff --git a/web/app.js b/web/app.js
index 2226f1a04..bbb2a76b8 100644
--- a/web/app.js
+++ b/web/app.js
@@ -2972,6 +2972,9 @@ async function tokShow(dir){
}
v.play().catch(()=>{});
$('#tokTitle').textContent=it.name;
+ // 标题进详情页。沉浸模式里只看得到文件名,想看标签、相关推荐或改东西
+ // 都得先退出再去列表里把它找回来。路径和旁边的创作者链接一致:先关,再开。
+ $('#tokTitle').onclick=()=>{const id=it.id;$('#tokClose').click();openItem(id)};
// 共演作品在沉浸模式也要念全出镜者;点击仍进第一位的资料页。
const cast=full.performers||[];
const who=cast.length
diff --git a/web/index.html b/web/index.html
index 2ec4fd68d..a1593e352 100644
--- a/web/index.html
+++ b/web/index.html
@@ -112,7 +112,7 @@
<button id="tokO" title="记一次高潮" aria-label="记一次高潮"><svg viewBox="0 0 24 24"><use href="#i-heart"/></svg><span class="toklabel">高潮</span><b class="tokcount" id="tokOn">0</b></button>
</div>
<div class="tokbar" id="tokBar"><i id="tokProg"></i></div>
- <div class="tokui"><div id="tokTitle" style="font-size:14px;margin-bottom:5px"></div>
+ <div class="tokui"><button type="button" class="toktitle" id="tokTitle"></button>
<div class="mono"><a href="#" id="tokWho"></a> <span id="tokMeta"></span></div></div>
</div>