Skip to content

armgit / peach

Public Imported from GitHub
0

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

Fix studio logo pill centering

longmeidao1c210e0f82ed
diff --git a/tests/test_web_ui.py b/tests/test_web_ui.py
index 468a5f819..d843f43f6 100644
--- a/tests/test_web_ui.py
+++ b/tests/test_web_ui.py
@@ -1365,6 +1365,13 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains("img.dataset.studio&&!img.dataset.fallback")
self.assertPageLacks('<span class="mono" style="color:var(--muted)">${labels[kind]||kind}资料页</span>')
+ def test_brand_pill_logo_has_one_centered_size_contract(self):
+ # The stylesheet centers the logo with an equal 3 px inset. Inline 100%
+ # dimensions used to override that size while leaving the inset active,
+ # shifting the clipped image down and right inside the round mark.
+ self.assertPageContains(".brandpill .mk img{position:absolute;inset:3px;width:calc(100% - 6px);height:calc(100% - 6px);")
+ self.assertPageLacks('style="width:100%;height:100%;object-fit:contain"')
+
def test_status_tags_are_separated_and_nonessential_states_are_hidden(self):
self.assertPageContains(".sep{flex:none;width:1px;height:19px")
self.assertPageContains("{k:'later',label:'稍后看'},{k:'flagged',label:'已标记'}")
diff --git a/web/app.js b/web/app.js
index 0dea786bb..3a28faa58 100644
--- a/web/app.js
+++ b/web/app.js
@@ -1084,8 +1084,7 @@ async function buildBars(){
const bpHtml=x=>{
const fallback=`${esc(x.k.slice(0,2))}`;
return `<button class="brandpill" data-entity-kind="studio" data-entity-name="${esc(x.k)}">
- <span class="mk" data-fallback="${fallback}"><img src="/logo?studio=${encodeURIComponent(x.k)}" alt=""
- style="width:100%;height:100%;object-fit:contain"></span>${esc(x.k)}</button>`;
+ <span class="mk" data-fallback="${fallback}"><img src="/logo?studio=${encodeURIComponent(x.k)}" alt=""></span>${esc(x.k)}</button>`;
};
// 空的一排仍占 28px,在「已标记」这种窄集合上就是两条什么都没有的空带。
// 没人就不画那一排,两排都没人就整块收起。