Peach: Local-first video metadata scraper and media manager.
fix: 用信息提示条展示可用更新
longmeidao397dde1c0bed
diff --git a/docs/reference-snapshots/geist-settings.md b/docs/reference-snapshots/geist-settings.mdindex 18993b233..73ee81700 100644--- a/docs/reference-snapshots/geist-settings.md+++ b/docs/reference-snapshots/geist-settings.md@@ -47,6 +47,8 @@## 管理页面间距审查+更新可用提示复用中性 Note、信息图标与“有可用更新”标签;普通更新不是错误或有风险的后果。2026-09-06 复核 `https://vercel.com/geist/note` 的 Best Practices:Note 用于局部持续信息,secondary 用于中性信息;Status Dot 文档限定部署状态。Note HTML 版本沿用本页登记的 `f3471155…`。检查为最新后恢复普通状态文字,更新按钮仍放在原操作栏,不重复增加 CTA。+站内文字链接参考本页 Fieldset 的 `View documentation` 示例:`text-[var(--geist-link-color)]`、`hover:underline`、`focus-visible:outline-2` 与 `outline-offset-4`。Peach 使用主题链接色、悬停下划线及 2px 焦点轮廓,访问后颜色保持一致;“配置 Peach 代理”跳转 `/configuration#peachProxy`,不附外链箭头。独立 `/geist/link` 页面未取得,证据来自官方 Fieldset 示例及本页已登记 HTML。2026-09-06 再次通过 HTTPX 获取官方 Fieldset、Input、Description、Note 的 HTML/CSS。Fieldset 与共同 CSS 的 SHA-256 与本页首表一致;Input 为 `df3a8b7ba933798842915d06056ef079878faa091af6b8d67e61d69cc0a08962`,Description 为 `7a16d502b3fdba316ef740057b275d2acdeb85f79d4944201331af906d9b497f`。浏览器参考页返回 `js execution timed out`,实时参考布局未取得。diff --git a/frontend/src/islands/release-updates.tsx b/frontend/src/islands/release-updates.tsxindex 0a690ba78..127ea933c 100644--- a/frontend/src/islands/release-updates.tsx+++ b/frontend/src/islands/release-updates.tsx@@ -1,5 +1,5 @@import { useEffect, useRef, useState } from 'preact/hooks';-import { fieldsetTitle, setActionBusy, progressHtml, confirmModal } from '@peach/legacy/ui';+import { fieldsetTitle, setActionBusy, progressHtml, confirmModal, noteHtml } from '@peach/legacy/ui';import { apiGet, apiSend, errorMessage } from '../api';export interface ReleaseState {@@ -91,9 +91,9 @@ export function ReleaseUpdates({ initial, initialJob }: { initial: ReleaseState;<dt>更新通道</dt><dd>{data.channel}</dd><dt>最新版本</dt><dd>{data.latest_version || (data.state === 'unchecked' ? '尚未检查' : '未取得')}</dd></dl>- <p class={error || data.state === 'error' ? 'configbad' : 'confighelp'} role={error || data.state === 'error' ? 'alert' : 'status'}>+ {data.state === 'available' && !error ? <div role="status" dangerouslySetInnerHTML={{__html:noteHtml(data.message,{label:'有可用更新'})}} /> : <p class={error || data.state === 'error' ? 'configbad' : 'confighelp'} role={error || data.state === 'error' ? 'alert' : 'status'}>{error || data.message}- </p>+ </p>}{job.state !== 'idle' ? <div aria-live="polite"><p class={job.state === 'error' ? 'configbad' : 'confighelp'}>{job.message}</p>{job.state !== 'error' ? <>diff --git a/frontend/test/release-updates.test.tsx b/frontend/test/release-updates.test.tsxnew file mode 100644index 000000000..d4aae37d7--- /dev/null+++ b/frontend/test/release-updates.test.tsx@@ -0,0 +1,22 @@+import { render } from 'preact';+import { afterEach, expect, it, vi } from 'vitest';+import { ReleaseUpdates } from '../src/islands/release-updates';++// @ts-expect-error 遗留组件使用正式实现验证图标与提示语义。+vi.mock('@peach/legacy/ui', () => import('../../web/js/ui-components.js'));+const host = document.createElement('div');+afterEach(() => { render(null, host); host.remove(); });+const initial = { current_version:'0.22.2',latest_version:'0.22.3',channel:'测试版',installation:'独立测试包',state:'available',message:'发现新测试版 0.22.3。',release_url:'https://example.com/releases' };++it('可用更新用持续信息提示且检查为最新后移除提示', () => {+ document.body.append(host);+ render(<ReleaseUpdates initial={initial} />, host);+ expect(host.querySelector('[role="status"] .geist-note-secondary')?.textContent).toContain('有可用更新');+ expect(host.querySelector('.geist-note svg')).not.toBeNull();+ expect(host.querySelector('.geist-note-warning,.geist-note-error')).toBeNull();+ expect(host.textContent).toContain('下载并安装');+ render(null, host);+ render(<ReleaseUpdates initial={{...initial,state:'current',message:'已是最新测试版。'}} />, host);+ expect(host.querySelector('.geist-note')).toBeNull();+ expect(host.textContent).not.toContain('下载并安装');+});