Skip to content

armgit / peach

Public Imported from GitHub
0

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

fix(web): 查看发布页带上外链标

longmeidaoc8721ba321ac
diff --git a/frontend/src/islands/release-updates.tsx b/frontend/src/islands/release-updates.tsx
index 0a690ba78..9ea5bbed6 100644
--- a/frontend/src/islands/release-updates.tsx
+++ b/frontend/src/islands/release-updates.tsx
@@ -103,7 +103,7 @@ export function ReleaseUpdates({ initial, initialJob }: { initial: ReleaseState;
</div> : null}
</div>
<div class="geist-fieldset-footer" data-geist-fieldset-footer>
- <a class="geist-button" href={data.release_url} target="_blank" rel="noreferrer">查看发布页</a>
+ <a class="geist-button" href={data.release_url} target="_blank" rel="noreferrer">查看发布页<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-external-link" /></svg></a>
{job.state === 'ready' ? <button type="button" class="geist-button primary" onClick={() => { void confirmModal({title:'更新已准备好',body:`Peach ${job.version || ''} 将在重启后安装。`,confirmLabel:'立即重启',cancelLabel:'稍后',onConfirm:restart}); }}>重启安装</button> : null}
{data.state === 'available' && data.installation === '独立测试包' && job.state !== 'ready' ? <button ref={downloadButton} type="button" class="geist-button primary" onClick={(event) => download(event.currentTarget)}>下载并安装</button> : null}
<button type="button" class="geist-button" disabled={active.has(job.state)} onClick={(event) => check(event.currentTarget)}>检查更新</button>
diff --git a/tests/test_web_ui.py b/tests/test_web_ui.py
index b3a348dc7..fc27657e8 100644
--- a/tests/test_web_ui.py
+++ b/tests/test_web_ui.py
@@ -1581,6 +1581,21 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageLacks('entitylinkarrow', "外链箭头应当已删除")
self.assertPageLacks('↗', "外链箭头字符应当已删除")
+ def test_links_that_leave_peach_carry_the_external_mark(self):
+ """走出 Peach 的链接带一枚外链标,站内跳转不带。
+
+ 2026-09-06 实测 vercel.com 团队页:站内链接(PR 号、部署 ID、项目名)一律裸
+ 文字,只有离站的部署域名挂一枚 14×14 的 external-link。标记的是「这一跳会
+ 离开当前应用」,不是「这是个链接」——每个链接都挂就等于谁都没标。
+ """
+ island = (Path(__file__).resolve().parents[1]
+ / 'frontend/src/islands/release-updates.tsx').read_text(encoding='utf-8')
+ self.assertIn('查看发布页<svg aria-hidden="true" viewBox="0 0 24 24">'
+ '<use href="#i-external-link" /></svg>', island)
+ self.assertPageContains('.geist-button svg{width:14px;height:14px;flex:none;'
+ 'stroke:currentColor;fill:none;stroke-width:2}')
+ self.assertPageContains('<symbol id="i-external-link"')
+
def test_the_x_mark_is_a_full_disc_that_takes_the_current_ink(self):
"""圆盘吃 currentColor,字形从圆里挖掉,两个主题下分量一样重。
diff --git a/web/css/01-base.css b/web/css/01-base.css
index 984f79d21..b5a10d67b 100644
--- a/web/css/01-base.css
+++ b/web/css/01-base.css
@@ -192,6 +192,9 @@ button,a,input,textarea,select,summary{touch-action:manipulation}
transition:background-color .15s ease-in-out,color .15s ease-in-out}
.geist-button:hover:not(:disabled){background:var(--surface)}
.geist-button:is(a),.geist-button:is(a):hover{text-decoration:none}
+/* 按钮里唯一还挂图标的一类是走出 Peach 的链接:实测 Geist 的外链标是 14px,
+ 跟着文字的 currentColor 走,落在文字后面。 */
+.geist-button svg{width:14px;height:14px;flex:none;stroke:currentColor;fill:none;stroke-width:2}
.geist-button:focus-visible{outline:2px solid var(--tungsten);outline-offset:2px}
.geist-button:disabled{background:var(--sunk);color:var(--muted);cursor:default}
/* Vercel/Geist loading actions look unavailable and reject repeat activation,
diff --git a/web/dist/peach-ui.js b/web/dist/peach-ui.js
index a2594a60e..2806438b6 100644
--- a/web/dist/peach-ui.js
+++ b/web/dist/peach-ui.js
@@ -726,7 +726,11 @@ function tt({ initial: e, initialJob: t }) {
href: r.release_url,
target: "_blank",
rel: "noreferrer",
- children: "查看发布页"
+ children: ["查看发布页", /* @__PURE__ */ K("svg", {
+ "aria-hidden": "true",
+ viewBox: "0 0 24 24",
+ children: /* @__PURE__ */ K("use", { href: "#i-external-link" })
+ })]
}),
o.state === "ready" ? /* @__PURE__ */ K("button", {
type: "button",