Skip to content

armgit / peach

Public Imported from GitHub
0

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

fix(web): unify note and info icons

longmeidaof1bbd9d79de4
diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md
index 48dbdf495..dda706826 100644
--- a/docs/HANDOFF.md
+++ b/docs/HANDOFF.md
@@ -76,7 +76,7 @@ Claude 的 `.claude/settings.json` 已配置 Stop、StopFailure、SessionEnd hoo
但 Tag 仍保留 6px 小圆角,普通排行不复制演示页的大留白或装饰性引导线。
**Vercel Geist 控件(2026-08-28)**:官方 introduction 页实测普通操作使用 4/6px 圆角、图标操作为 32×32px,圆形留给 emoji 反馈等特殊语义。Peach 的普通操作和关闭按钮因此统一用 `--control-radius:6px`,菜单与 Modal 使用 `--floating-radius:12px`,状态标记使用 `--badge-radius:4px`;Tag 保持胶囊,媒体左右切换与头像保留圆形。全站字号、顶栏、搜索、播放列表、设置、管理、详情、关注与移动端共用这套语义 token;弹层自己的滚动容器必须使用 `overscroll-behavior:contain`,粘性标题栏要设置 `scroll-padding-top`,不能遮住键盘焦点。锁定版本、完整测量和有意差异见 `vercel-geist-controls-measured.md`。**Vercel Geist MiddleTruncate(2026-08-30)**:官方页 <https://vercel.com/geist/middle-truncate> 规定只对文件路径、URL、ID、SHA 等首尾都有信息的值做中间省略;单个 `…` 随容器宽度重算,复制和无障碍名称保留完整原文,外层不得再套 `text-overflow:ellipsis`。Peach 用原生 ES module 适配这套行为,不引入 React;资源标识必须显式使用 `data-middle-truncate`,标题、说明、人名和标签保留末尾省略;页面源门槛登记全部末尾省略选择器,任何新增截断都必须先分类。实时浏览器 DOM/CSS/JS 本轮未取得,通道错误与候选判断见 `vercel-geist-middle-truncate.md`。
**Vercel Tooltip/Collapse/Context Card/Projects/Analytics/Speed Insights 与 Geist Note/Progress/Switch/Fieldset/Scroller/Empty State(2026-08-30)**:登录态项目页确认搜索占剩余宽度、筛选为方形图标钮、主操作在右,菜单无展开动画且内部滚动;Analytics 与 Speed Insights 都使用「全局筛选或来源 Switch → 横向摘要指标带 → 主详情 → 同层 tablist 数据面板」层级,不把每个维度堆成独立 Bento。Peach 的统计页用真实库存、观看、覆盖和系统盘指标复用该层级;口味页以浏览器记录/Peach 内部作为真实证据来源,不伪造体验分或时间图。Tooltip 固定在视口内,来源菜单不得套用 Collapse motion,作者别名才使用 Collapse;短元数据浮层最多一个主动作,Escape 关闭并交还焦点,瞬时成功回执用 Toast,错误恢复留在原位置;Note 只放字段/卡片/分区旁的持久上下文,页面问题用 Banner;Progress 必须有真实 value/max 和 ARIA,Switch 只用于 2–3 个互斥视图,布尔值用 Toggle;Fieldset 同组卡片固定同高,变化正文放单一 Scroller,Footer 保持固定动作区;Empty State 必须把图标、标题、说明和可选动作收在同一组件,且与上方工具条保持统一间距。完整 URL、资源 SHA、浏览器失败与恢复路径和 Peach 差异见 `vercel-geist-semantics-measured.md`、`vercel-geist-note-progress-switch-analytics.md` 与 `vercel-geist-fieldset-scroller-empty-state.md`;实现门槛见 `peach-web-ui`。
-**Vercel Command Menu/Search Input/Spinner/Loading Dots(2026-08-30)**:设置覆盖层使用锁定 Dialog CSS 的 350ms、`cubic-bezier(.4,0,.2,1)` 与 -40px 淡入轨迹,普通菜单仍无动画;Search Input 的搜索图标在查询期间原位换成 Spinner。用户直接触发的检查、加载、保存与应用使用 Spinner,后台抓取和扫描进度使用 Loading Dots;“没有更多历史内容”是中性、可关闭的 Note,不得登记为红色故障。证据哈希、未取得面与 Peach 差异见 `vercel-geist-command-search-loading.md`。
+默认 Note、只读提示和 info 入口统一复用图片详情已有的本地 Lucide 圆圈 `i`,不复制未开放许可的 Geist 私有 SVG。**Vercel Command Menu/Search Input/Spinner/Loading Dots(2026-08-30)**:设置覆盖层使用锁定 Dialog CSS 的 350ms、`cubic-bezier(.4,0,.2,1)` 与 -40px 淡入轨迹,普通菜单仍无动画;Search Input 的搜索图标在查询期间原位换成 Spinner。用户直接触发的检查、加载、保存与应用使用 Spinner,后台抓取和扫描进度使用 Loading Dots;“没有更多历史内容”是中性、可关闭的 Note,不得登记为红色故障。证据哈希、未取得面与 Peach 差异见 `vercel-geist-command-search-loading.md`。
**Beeg 资料页(2026-08-30)**:Reislin 与 SweetieFox 页面证据锁定的顺序是头像与名称、简介、外部链接、关联艺人轨道、标签轨道、内容;轨道不另加可见标题。Peach 的女优/厂牌资料页和关注页复用这个阅读顺序;资料页有照片时只显示一个 32×32px `PicsIcon`,放在标签左侧,选中代表照片视图,再点一次回到视频,不保留独立的「视频/照片」文字标签栏。合集详情继续使用普通详情的左媒体、右信息,下方另设 Mix/分卷/播放列表/多视频的横向切换带。锁定样式摘要、哈希、未取得面和主动差异见 `beeg-profile-layout.md`。
YouTube Shorts 沉浸页使用用户截图记录 `docs/reference-snapshots/youtube-shorts-immersive-user-screenshot.md`:竖屏复用中央 9:16 舞台和外置动作列,横屏使用在整个视口视觉居中的 16:9 舞台并把动作列收进视频右侧;Peach 保留自己的反馈语义,不复制订阅或社交动作。沉浸视频每次加载都要带独立 `session`,切片、关闭、失败和页面离开时取消旧会话;只清浏览器的 `src` 不足以停止 CloudDrive 预读或 FFmpeg。普通播放器控制栏另使用用户截图与 YouTube 官方帮助记录 `docs/reference-snapshots/youtube-player-controls-user-screenshot.md`:进度独占上排,播放/音量/时间在左下,画中画/设置/影院/全屏在右下使用同高圆形按钮;已播段、圆点和卡片观看进度统一使用 Peach 蓝。键盘仍按设置前后跳转,控制栏不重复画 10 秒按钮;本地时刻预览复用九宫格接触表,在线视频只显示时刻。设置浮层只列真实能力:氛围模式全局开关、播放速度和实际清晰度;影院模式用按钮或 `T` 切换为大播放器,详情移到下方。Peach 不复制没有实际能力的字幕、睡眠定时或自动播放按钮。
F95 masked 链接与 Gofile 文件列表的凭据边界见 `f95-masked-gofile-media`;Mix 只按已解析且
diff --git a/docs/reference-snapshots/vercel-geist-note-progress-switch-analytics.md b/docs/reference-snapshots/vercel-geist-note-progress-switch-analytics.md
index a1bf94091..7244d169c 100644
--- a/docs/reference-snapshots/vercel-geist-note-progress-switch-analytics.md
+++ b/docs/reference-snapshots/vercel-geist-note-progress-switch-analytics.md
@@ -22,6 +22,9 @@
### Note
- Note 是紧邻字段、卡片或分区的持久上下文;底层状态改变前持续存在。
+- 2026-08-30 重新打开官方页取得当前桌面截图、可访问 DOM 与锁定 HTML;默认 Note 左侧是
+ 14×14、16 viewBox 的圆圈 `i`。Peach 不复制未开放许可的 Geist 私有 SVG,继续复用本地固定版
+ Lucide `info`;图片详情、只读提示与中性 Note 因而使用同一枚圆圈 `i`。
- `error` 表示用户必须修复的问题,`warning` 表示需要理解后果,`success` 表示已通过检查,普通中性说明使用默认或 `secondary`。
- 页面/系统级且带动作的问题用 Banner,瞬时确认用 Toast,销毁确认用 Modal;不要把这些表面都画成 Note。
- 一条 Note 只讲一个概念;标签 1–2 个词,正文用一句主动句说明影响。Note 不加临时关闭按钮。
diff --git a/tests/test_web_ui.py b/tests/test_web_ui.py
index 0ee2c5e5f..0a2e97e15 100644
--- a/tests/test_web_ui.py
+++ b/tests/test_web_ui.py
@@ -821,6 +821,7 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains(name)
self.assertPageContains("from './js/ui-components.js'")
self.assertPageContains("const NOTE_VARIANTS=new Set(['secondary','warning','error','success'])")
+ self.assertPageContains("const symbol=kind==='secondary'?'info':kind==='success'?'check':'alert'")
self.assertPageContains("const role=kind==='error'?' role=\"alert\"':' role=\"note\"'")
self.assertPageContains("noteHtml(error.message,{variant:'error',label:'同步失败'})")
self.assertPageContains("noteHtml(error.message,{variant:'error',label:'扫描失败'})")
@@ -828,6 +829,17 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains('class="geist-note geist-note-error fcheckreport" role="alert"')
self.assertPageContains('class="geist-banner fwarn"')
+ def test_note_and_info_surfaces_reuse_the_photo_detail_info_icon(self):
+ self.assertPageContains('<symbol id="i-info" viewBox="0 0 24 24">')
+ self.assertPageContains('<div class="runtimegate">${icon(\'info\')}<span>${esc(mirrorText)}</span>')
+ self.assertPageContains('<div class="runtimegate">${icon(\'info\')}<span>${esc(followRuntime.ledger_read_only_message')
+ self.assertPageContains("${icon('info')}<div><p><b>${exhausted.length} 个来源没有更多内容</b>")
+ self.assertPageContains('aria-label="凭据存放位置说明">${icon(\'info\')}</button>')
+ self.assertPageContains('aria-label="图片详情" title="图片详情">${icon(\'info\')}</button>')
+ self.assertPageContains('.runtimegate{display:grid;grid-template-columns:16px minmax(0,1fr) auto;align-items:center;gap:12px')
+ self.assertPageContains('.runtimegate>svg{width:16px;height:16px;flex:none;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}')
+ self.assertPageContains('.runtimegate a{grid-column:2/-1}')
+
def test_project_web_ui_skill_keeps_future_changes_on_shared_primitives(self):
root = Path(__file__).resolve().parents[1]
skill = root / ".claude" / "skills" / "peach-web-ui" / "SKILL.md"
diff --git a/web/app.css b/web/app.css
index b771cd390..5d8cd638b 100644
--- a/web/app.css
+++ b/web/app.css
@@ -207,7 +207,7 @@ button,a,input,textarea,select,summary{touch-action:manipulation}
.playlistcreate{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap}.playlistcreate label{display:grid;gap:5px;color:var(--muted);font-size:var(--fs-xs)}.playlistcreate input,.playlistmeta input{min-width:220px;border:1px solid var(--border-15);border-radius:var(--control-radius);background:var(--surface);color:var(--ink);padding:9px 11px;font:inherit}.playlistcreate button,.playlistactions button{border:1px solid var(--border-15);border-radius:var(--control-radius);background:transparent;color:var(--ink-2);padding:9px 12px;cursor:pointer}.playlistcreate button:hover,.playlistactions button:hover{border-color:var(--tungsten);color:var(--ink)}.playlistcreate [data-playlist-state]{flex-basis:100%;color:var(--drop);font-size:var(--fs-xs)}
.playlistcards{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px}.playlistcard{display:grid;grid-template-columns:112px minmax(0,1fr);gap:12px;padding:12px;border:1px solid var(--line-soft);border-radius:12px;background:var(--surface);min-width:0}.playlistcover{position:relative;aspect-ratio:16/10;border:0;border-radius:8px;background:#000;overflow:hidden;padding:0;cursor:pointer}.playlistcover:disabled{cursor:default}.playlistcover img{width:100%;height:100%;object-fit:cover}.playlistcover span{position:absolute;right:5px;bottom:5px;border-radius:5px;background:#000b;color:#fff;padding:3px 6px;font-size:var(--fs-xs)}.playlistmeta{display:grid;align-content:center;gap:6px;min-width:0}.playlistmeta input{min-width:0;width:100%;font-weight:600}.playlistmeta small{color:var(--muted)}.playlistactions{grid-column:1/-1;display:flex;gap:7px;justify-content:flex-end}.playlistactions .danger{color:var(--drop)}
.playlistdialog{width:min(520px,calc(100vw - 28px));border:1px solid var(--line);border-radius:var(--floating-radius);background:var(--surface);color:var(--ink);padding:0;box-shadow:0 2px 4px #0003,0 24px 80px #000b}.playlistdialog::backdrop{background:#000a;backdrop-filter:blur(5px)}.playlistdialoghead{display:flex;align-items:center;justify-content:space-between;padding:16px 17px;border-bottom:1px solid var(--line-soft)}.playlistdialoghead h2{margin:0;font-size:var(--fs-xl)}.playlistdialoghead button{width:34px;height:34px;border:0;border-radius:var(--control-radius);background:transparent;color:var(--ink);display:grid;place-items:center;cursor:pointer}.playlistdialoghead button:hover{background:var(--hover)}.playlistdialoghead svg{width:19px;height:19px;stroke:currentColor;fill:none}.playlistdialogbody{padding:17px}.playlistpicklist{display:grid;gap:7px;margin-top:16px;max-height:320px;overflow-y:auto;overscroll-behavior:contain}.playlistpickrow{display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid var(--border-10);border-radius:var(--control-radius);background:var(--overlay-5);color:var(--ink);padding:11px 12px;text-align:left;cursor:pointer}.playlistpickrow:hover{border-color:var(--tungsten)}.playlistpickrow small{color:var(--muted)}
-.runtimegate{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 12px;padding:10px 12px;border:1px solid color-mix(in srgb,var(--meter) 35%,var(--line));border-radius:var(--control-radius);background:color-mix(in srgb,var(--meter) 8%,var(--surface));color:var(--ink);font-size:var(--fs-sm)}.runtimegate span{flex:1 1 320px;min-width:0}.runtimegate a{flex:0 0 auto;color:var(--ink);font-weight:650;text-decoration:none}.runtimegate a:hover{text-decoration:underline}
+.runtimegate{display:grid;grid-template-columns:16px minmax(0,1fr) auto;align-items:center;gap:12px;margin:0 0 12px;padding:10px 12px;border:1px solid color-mix(in srgb,var(--meter) 35%,var(--line));border-radius:var(--control-radius);background:color-mix(in srgb,var(--meter) 8%,var(--surface));color:var(--ink);font-size:var(--fs-sm)}.runtimegate>svg{width:16px;height:16px;flex:none;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.runtimegate span{min-width:0}.runtimegate a{color:var(--ink);font-weight:650;text-decoration:none}.runtimegate a:hover{text-decoration:underline}
.review{--review-fieldset-height:440px;padding:0 0 42px}.reviewhead{display:flex;align-items:baseline;gap:12px;padding:2px 2px 0;margin-bottom:12px}.reviewhead h2{margin:0;font-size:var(--fs-xl)}.reviewtabs{display:flex;gap:6px;overflow-x:auto;margin-bottom:16px;scrollbar-width:none}.reviewtabs::-webkit-scrollbar{display:none}.reviewtabs button{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--border-15);border-radius:var(--control-radius);background:transparent;color:var(--ink-2);padding:7px 14px;cursor:pointer;font-size:var(--fs-sm);white-space:nowrap}.reviewtabs button:hover{border-color:var(--tungsten);color:var(--ink)}.reviewtabs button[aria-pressed="true"]{background:var(--tungsten-soft);border-color:var(--tungsten);color:var(--tungsten);font-weight:600}.reviewtabs .n{color:var(--muted);font-size:var(--fs-xs)}.reviewsection{margin-bottom:20px}.reviewsection h3{margin:0 0 9px;font-size:var(--fs-lg)}.reviewlist{display:grid;grid-template-columns:repeat(auto-fill,minmax(360px,1fr));gap:14px;align-items:start}
/* 判定状态用左侧色条表达:整卡描边在一列里扫过去时反而认不出来 */
.reviewitem{position:relative;display:flex;flex-direction:column;box-sizing:border-box;height:var(--review-fieldset-height);margin:0;padding:0;min-width:0;overflow:hidden;background:var(--surface);border:1px solid var(--line-soft);border-radius:12px}.reviewitem::before{content:'';position:absolute;z-index:3;left:0;top:0;bottom:0;width:3px;background:transparent}.reviewitem[data-decision="approved"]::before{background:var(--keep)}.reviewitem[data-decision="rejected"]::before{background:var(--drop)}.reviewitem[data-decision="skipped"]::before{background:var(--muted)}.reviewitem[data-decision="rejected"],.reviewitem[data-decision="skipped"]{opacity:.6}.reviewitem h4{margin:0 0 6px;font-size:var(--fs-lg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reviewitem p{margin:4px 0;color:var(--muted);font-size:var(--fs-xs);line-height:1.55;overflow-wrap:anywhere}
@@ -1504,6 +1504,7 @@ body.drawer-open .edge{opacity:0;pointer-events:none} /* 展开时窄栏让位
.managebar-menu{display:none;margin-top:8px;padding:6px;border:1px solid var(--line-soft);border-radius:11px;
background:var(--surface);grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
.managebar.is-open .managebar-menu{display:grid}
+ .runtimegate a{grid-column:2/-1}
.managebar-menu button{width:100%;min-height:42px;justify-content:flex-start;padding:9px 11px}
.grid{gap:16px 8px}
.count{align-items:center;flex-direction:row;gap:10px;padding-block:8px;
diff --git a/web/app.js b/web/app.js
index 5ae57811c..3605ba8cd 100644
--- a/web/app.js
+++ b/web/app.js
@@ -1906,7 +1906,7 @@ async function openReview(push=true){
:mirror?.error||reviewRuntime.ledger_read_only_message||'';
const value=row=>row.tags||row.japanese_name||row.path||row.suggested_query||'';
$('#stats').innerHTML=`<div class="review">
- ${locked?`<div class="runtimegate"><span>${esc(mirrorText)}</span>${writer
+ ${locked?`<div class="runtimegate">${icon('info')}<span>${esc(mirrorText)}</span>${writer
?`<a href="${esc(writer)}">前往写入端复核</a>`:''}</div>`:''}
<div class="reviewtabs">${Object.entries(REVIEW_LABELS).map(([key,label])=>`<button data-review-tab="${key}" aria-pressed="${key===reviewCategory}">${label} <span class="n mono">${reviewData.counts[key]||0}</span></button>`).join('')}</div>
<section class="reviewsection"><div class="reviewlist">${rows.length?rows.map(row=>{
@@ -2870,7 +2870,7 @@ function renderFollowManage(credentials){
const writer=followRuntime?.ledger_writer_origin
?new URL('/follow-manage',followRuntime.ledger_writer_origin).href:'';
$('#stats').innerHTML=`<div class="follow followmanage">
- ${locked?`<div class="runtimegate"><span>${esc(followRuntime.ledger_read_only_message||'本机当前只能浏览')}</span>${writer
+ ${locked?`<div class="runtimegate">${icon('info')}<span>${esc(followRuntime.ledger_read_only_message||'本机当前只能浏览')}</span>${writer
?`<a href="${esc(writer)}">前往写入端管理关注</a>`:''}</div>`:''}
<div class="fmain">
<section class="fsec">
diff --git a/web/js/ui-components.js b/web/js/ui-components.js
index 621fc3bae..aa3e4b446 100644
--- a/web/js/ui-components.js
+++ b/web/js/ui-components.js
@@ -5,7 +5,7 @@ const NOTE_VARIANTS=new Set(['secondary','warning','error','success']);
/** Inline, persistent context beside the field/card/section it describes. */
export function noteHtml(message,{variant='secondary',label='',className=''}={}){
const kind=NOTE_VARIANTS.has(variant)?variant:'secondary';
- const symbol=kind==='success'?'check':'alert';
+ const symbol=kind==='secondary'?'info':kind==='success'?'check':'alert';
const role=kind==='error'?' role="alert"':' role="note"';
return `<div class="geist-note geist-note-${kind}${className?` ${esc(className)}`:''}"${role}>
${icon(symbol)}<p>${label?`<b>${esc(label)}</b>`:''}<span>${esc(message)}</span></p></div>`;