Peach: Local-first video metadata scraper and media manager.
fix(onboarding): 提供可验证的安装教程窗口
longmeidaoedc496d54c72
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 443a4ba28..4cfaafe42 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -21,6 +21,10 @@ Removed / Fixed / Security。## [未发布]+### 修复++- **界面**:完成首次设置后,第一次进入首页会在右下角显示安装教程;馆藏、采集凭证、浏览器历史、关注来源、关注凭证和首次复核按真实状态自动打勾。+## [0.34.1] - 2026-09-20### 修复diff --git a/docs/BOARD_UI.md b/docs/BOARD_UI.mdindex 139f525f6..a7437e7dc 100644--- a/docs/BOARD_UI.md+++ b/docs/BOARD_UI.md@@ -340,6 +340,17 @@ Board Switch medium:42×24px 轨道、18px 滑块,关闭时密码输入区辅助说明统一为 12/18、弱文字色。「浏览器历史记录」是「完成设置后」的二级标题,用14/20、500,不与一级分类争夺层级。+## 安装后首页教程++首次设置表单只负责收集配置。提交成功后,普通入口带 `?onboarding=1` 进入首页;选择历史+导入时先去口味页,但同一浏览器会保留待办标记,回首页再显示。首页教程采用 BoardUI+NotificationViewport 的右下角固定位置、400px 宽度、16px 卡片圆角、边框与下拉阴影;内部采用+Announcement 的图标标题动作结构和 RareUI Task List 的 24px 圆形状态位、完成划线淡出与完成项+后移。专用状态接口汇总馆藏、采集来源凭证、浏览器历史、关注来源、对应关注凭证和复核队列,+不允许手动勾选。浮窗可折叠为只保留标题、完成进度和展开键,完成全部任务时自动展开;+任务悬停时隐藏上下分隔线,右侧箭头使用次级文字色。固定 revision、SHA 与差异见+[安装后首页教程取证](reference-snapshots/rareui-boardui-post-setup-tutorial.md)。+纠正(2026-09-12):这一段此处一度记过「上游 primary 没有悬停态」,同日取到规则原文后作废。当时那三条证据全落在同一个盲点上——悬停那一层挂在伪元素上。① 读 `className` 看不到:悬停不是 Tailwind 的 `hover:` 类,写在样式表里;② 真鼠标悬停读 computed 也看不到:读的是元素diff --git a/docs/HANDOFF.md b/docs/HANDOFF.mdindex 0e7e72b68..761ef4a75 100644--- a/docs/HANDOFF.md+++ b/docs/HANDOFF.md@@ -72,7 +72,6 @@- BoardUI:[创作者别名表格与关注分页](BOARD_UI.md#创作者别名与扫描操作)、[Board、Link Button 与搜索动效](BOARD_UI.md)、[复核布局](reference-snapshots/board-review-layout.md);React 源码 `frontend/src/react/boardui/ORIGIN.md`。- [Geist 控件](reference-snapshots/vercel-geist-controls-measured.md);[复核操作](reference-snapshots/vercel-review-actions.md);[README 维护](README_MAINTENANCE.md);设置:`reference-snapshots/geist-settings.md`。-版本与差异见 `docs/reference-sources.json`、`docs/reference-snapshots/`,流程见`.claude/skills/peach-reference-evidence/SKILL.md`。本节只索引快照,不复制测量值;给不出可重抓字节的实测不登记,理由写进快照正文——`tests/test_reference_updates.py` 会拒绝既没登记也没说明的快照。diff --git a/docs/OPERATIONS.md b/docs/OPERATIONS.mdindex e679dad6d..e59681acb 100644--- a/docs/OPERATIONS.md+++ b/docs/OPERATIONS.md@@ -68,6 +68,9 @@ Peach 这一侧的行为:首启页与配置页按本机系统检测 CloudDrive默认 8900> --no-mdns --no-ledger-sync`,然后把浏览器打开到 `http://127.0.0.1:<端口>/`。这条服务没有 TLS、口令强制置空(安全边界就是那个绑定地址),首页是首次运行表单,提交端点是 `POST /setup`:应用已配置回 404、非回环调用方回 403、设置文件已存在回 409。+ 成功页的普通入口带 `/?onboarding=1`,第一次进入正常首页时在右下角浮窗显示安装教程;选择浏览器历史+ 导入则先去 `/taste?onboarding=1`。待办标记只存在当前浏览器,教程通过专用状态接口读取馆藏、+ 采集凭证、浏览器历史、关注、关注凭证和复核的实际状态,全部满足后才可完成。- 切换由 `tray.SetupGate` 做,Windows 托盘与 macOS 菜单栏共用。它挂在健康轮询里(Windows 10 秒、macOS 5 秒),每轮新鲜 `settings_file.load_config()`:不再需要设置就停掉引导服务,按新数据根构建正常规格并启动,托盘进程本身不重启。独立测试包按设置在高位端口提供 HTTP:本机模式绑定diff --git a/docs/reference-snapshots/rareui-boardui-post-setup-tutorial.md b/docs/reference-snapshots/rareui-boardui-post-setup-tutorial.mdnew file mode 100644index 000000000..6083b9412--- /dev/null+++ b/docs/reference-snapshots/rareui-boardui-post-setup-tutorial.md@@ -0,0 +1,28 @@+# 安装后首页教程取证++最后复核:2026-09-20。++本文件是三份源码的人工组合取证,不是单一上游原文镜像,因此不登记进+`docs/reference-sources.json`;每份源码的固定 revision 与 SHA-256 在下表分别记录。++## 来源++| 参考 | 固定版本与源码 | SHA-256 | 采用行为 |+| --- | --- | --- | --- |+| [RareUI Task List](https://www.rareui.com/components/tasklist) | `swamimalode07/rare-ui@368b93244b875a760e48ca4ecec7774b95f94263`,`components/ui/task-list.tsx` | `9038a6110902f0d944740f91e19e0bfc2cbee8a9397ba7f1f780f72ec6802657` | 24px 圆形状态位、完成文字划线并淡出、完成项移到清单末尾、减少动态效果时立即换态 |+| [BoardUI Announcement](https://www.boardui.com/components/announcement) | `BoardUI/boardui@3e76e282614b147a34b9b2a510e31b97d58a3909`,`components/base/announcement/announcement.tsx` | `ec0015c2c341cfdb281a9a319970ec7e5364de1934cb1a43f814250b2cdcdaa7` | 图标、标题、说明和整行次级动作组成紧凑提示卡;使用边框与主表面,不加阴影 |+| [BoardUI Notification](https://www.boardui.com/components/notification) | `BoardUI/boardui@3e76e282614b147a34b9b2a510e31b97d58a3909`,`components/base/notification/notification.tsx` | `10dc6985e2ab4e287266f756912bdeaf7610bf8b8a6941c8ea14ffd6b6c201fa` | `NotificationViewport` 默认固定在右下角;移动端距边 12px、桌面 24px,宽度为 `min(400px, 100vw - 24px)`,卡片用 16px 圆角、边框和下拉阴影 |++## Peach 采用方式++- 教程不放在首次设置表单;`POST /setup` 成功后用 `?onboarding=1` 标记一次安装后流程,第一次进入首页才显示。+- 任务不是可手动勾选的待办。首页读取馆藏、采集来源凭证、浏览器历史、关注来源、对应关注凭证和复核队列的实际状态,达到条件后自动打勾并移到清单末尾。+- 下一步按钮始终指向第一项未完成任务;全部完成后才允许结束教程。+- 教程挂在 `main` 之外的右下角固定浮窗,不参与首页正文排版;离开首页即隐藏。历史导入可先进入 `/taste?onboarding=1`,待用户回到首页时继续教程。+- 浮窗按内容增长并受视口高度限制,任务区单独滚动;可折叠为标题与完成进度,全部完成时自动展开。任务悬停时上下分隔线同时隐去,右箭头保持次级文字色。++## 明确差异++- RareUI 示例允许直接切换任务;Peach 禁止手动改状态,避免“点过页面”被误报成已完成。+- BoardUI Notification 是短消息;Peach 保留它的固定 viewport 与卡片外观,在卡片内增加可滚动任务清单,并且不自动消失。+- 未复刻站点视觉资产、字体或颜色,继续使用 Peach 的 BoardUI token、按钮与图标体系。diff --git a/src/peach/routes_pages.py b/src/peach/routes_pages.pyindex c6683ad27..66258b27e 100644--- a/src/peach/routes_pages.py+++ b/src/peach/routes_pages.py@@ -588,7 +588,7 @@ def setup_page(def setup_done_page(applied, *, windows: bool, scan_requested: bool, history_guide: bool = False) -> str:"""成功页:扫描是否已排队、进入 Peach 的入口,运行信息默认折叠。口令不显示在页面上。"""config = applied.config- destination = escape(_normal_url(config) + ('taste?onboarding=1' if history_guide else ''), quote=True)+ destination = escape(_normal_url(config) + ('taste?onboarding=1' if history_guide else '?onboarding=1'), quote=True)destination_label = '导入浏览器历史记录' if history_guide else '进入 Peach'scan = ("首次扫描已排队,将在后台整理媒体库。你可以继续使用 Peach。" if scan_requestedelse "你可以稍后在配置页开始扫描媒体库。")@@ -774,6 +774,22 @@ async def setup_submit(request: Request):return response+def _setup_media_source_errors(dirs: Sequence[str], kinds: object,+ problems: Sequence[str], validate) -> list[str]:+ """首启的本地来源必须真的可读;CloudDrive 来源仍可离线保存。"""+ errors = list(problems) if problems else [""] * len(dirs)+ source_kinds = list(kinds) if isinstance(kinds, (list, tuple)) else []+ for index, path in enumerate(dirs):+ kind = source_kinds[index] if index < len(source_kinds) else "local"+ if errors[index] or kind != "local":+ continue+ try:+ validate(path)+ except ValueError as exc:+ errors[index] = str(exc)+ return errors if any(errors) else []++def _read_answers(config, submitted: Mapping[str, object], *, windows: bool,) -> tuple[object, dict[str, object]]:@@ -793,6 +809,7 @@ def _read_answers(sources = [{"location": kinds[i] if i < len(kinds) else "local", "path": path,"root": roots[i] if i < len(roots) else ""} for i, path in enumerate(dirs)]_, _, problems = media_configuration.validate(sources, windows=windows)+ problems = _setup_media_source_errors(dirs, kinds, problems, question.validate)if problems:errors["media_dir"] = problemsvalues.update(media_dirs=tuple(Path(path) for path in dirs), media_sources=sources)diff --git a/src/peach/web_router.py b/src/peach/web_router.pyindex e865129ce..ef748fb52 100644--- a/src/peach/web_router.py+++ b/src/peach/web_router.py@@ -223,6 +223,18 @@ def _get_review(contract, args):return payload+def _get_post_setup_tutorial(contract, _args):+ """一次给安装教程六项真实状态,避免遗留首页重新接管 React 口味页的契约。"""+ return {+ "library": q_items(contract, {"limit": "1", "thumb": "0"}),+ "scraping": q_scraping(contract, {}),+ "taste": _get_taste(contract, {"window": "all"}),+ "follow": q_follow(contract, {"limit": "1"}),+ "credentials": q_follow_credentials(contract, {}),+ "review": _get_review(contract, {"counts": "1"}),+ }++def _post_empty_trash(contract, _body):return w_empty_trash(contract)@@ -270,6 +282,7 @@ GET_HANDLERS = {"/api/search-history": _get_search_history,"/api/taste": _get_taste,"/api/review": _get_review,+ "/api/post-setup-tutorial": _get_post_setup_tutorial,}POST_HANDLERS = {diff --git a/tests/test_configuration_sources.py b/tests/test_configuration_sources.pyindex 896c29bca..c65405c39 100644--- a/tests/test_configuration_sources.py+++ b/tests/test_configuration_sources.py@@ -103,6 +103,7 @@ class MediaConfigurationTests(unittest.TestCase):self.assertIn('<details><summary><span>运行信息</span>', html)self.assertNotIn('<details open', html)self.assertIn('<a class="setup-enter" href=', html)+ self.assertIn(f'href="http://127.0.0.1:{config.server.port}/?onboarding=1"', html)with patch('peach.distribution.standalone', return_value=True):packaged = setup_done_page(SimpleNamespace(config=config, tree=tree), windows=True,scan_requested=False, history_guide=True)diff --git a/tests/test_onboarding.py b/tests/test_onboarding.pyindex e457f5262..8a7664b76 100644--- a/tests/test_onboarding.py+++ b/tests/test_onboarding.py@@ -532,6 +532,15 @@ class SetupPageTests(_Case):self.assertFalse(missing.exists(), "校验不替人建目录")self.assertFalse(self.data_root.exists(), "校验失败不落任何文件")+ def test_a_declared_local_source_must_exist_before_setup_is_saved(self):+ missing = self.root / "missing-local-source"+ response = self._post("/setup", self._form(+ media_dir=str(missing), media_location="local", media_root=""))+ self.assertEqual(response.status_code, 400)+ self.assertIn("目录不存在", response.text)+ self.assertFalse(missing.exists(), "校验不替用户创建媒体库")+ self.assertFalse(self.data_root.exists(), "校验失败不写设置")+def test_two_directories_are_declared_together_and_shown_in_the_scan_label(self):second = self.root / "more"second.mkdir()@@ -610,6 +619,7 @@ class SetupPageTests(_Case):body = response.textself.assertIn("设置完成", body)self.assertIn("首次扫描已排队", body)+ self.assertIn('/?onboarding=1', body)self.assertNotIn("peach token", body)self.assertNotIn("账本", body)# 完成页尾部是与配置页共用的运行信息,默认折叠:版本、位置和 FFmpeg 展开可查。diff --git a/tests/test_rm_web.py b/tests/test_rm_web.pyindex 681a4cebb..2866f2bb7 100644--- a/tests/test_rm_web.py+++ b/tests/test_rm_web.py@@ -896,6 +896,7 @@ class WebDataTests(unittest.TestCase):"/api/stats", "/api/tops", "/api/ads", "/api/related", "/api/facets","/api/suggest","/api/search-history", "/api/review", "/api/playlists", "/api/playlist",+ "/api/post-setup-tutorial","/api/follow", "/api/follow/credentials", "/api/follow/schedule","/api/follow/check", "/api/follow/resolve", "/api/follow/suggest","/api/taste/refresh",diff --git a/tests/test_web_ui.py b/tests/test_web_ui.pyindex 6a89cabae..f8a9d400d 100644--- a/tests/test_web_ui.py+++ b/tests/test_web_ui.py@@ -134,6 +134,37 @@ class StylesheetPartitionTests(unittest.TestCase):class WebUiSourceTests(unittest.TestCase):+ def test_post_setup_tutorial_lives_on_home_and_checks_real_state(self):+ root = Path(__file__).resolve().parents[1]+ html = (root / "web/index.html").read_text(encoding="utf-8")+ app = (root / "web/app.js").read_text(encoding="utf-8")+ board = (root / "web/board.css").read_text(encoding="utf-8")+ self.assertIn('id="postSetupTutorial"', html)+ self.assertIn("const POST_SETUP_TUTORIAL_KEY='peach.post-setup-tutorial.v1'", app)+ self.assertIn("const POST_SETUP_TUTORIAL_COLLAPSED_KEY='peach.post-setup-tutorial-collapsed.v1'", app)+ self.assertIn("api('/api/post-setup-tutorial')", app)+ for label in ('设置采集来源与凭证', '导入浏览器历史记录', '补齐关注来源凭证'):+ self.assertIn(label, app)+ self.assertIn("source=>source.accepts_cookie", app)+ self.assertIn("source=>source.cookie_saved", app)+ self.assertIn("taste.summary?.history_sources", app)+ self.assertIn("location.pathname!=='/'", app)+ self.assertIn("tasks.every(task=>task.done)", app)+ self.assertIn("data-tutorial-collapse", app)+ self.assertIn("setPostSetupTutorialCollapsed(collapsed)", app)+ self.assertIn(".post-setup-notification", board)+ self.assertIn(".post-setup-task[data-state=checked]", board)+ self.assertIn(".post-setup-task:hover+.post-setup-task{border-top-color:transparent}", board)+ self.assertIn(".post-setup-task:hover{border-top-color:transparent;background:var(--hover)}", board)+ self.assertIn("position:fixed;right:12px;bottom:12px;z-index:100", board)+ self.assertIn("width:min(400px,calc(100vw - 24px))", board)+ self.assertIn("pointer-events:none", board)+ self.assertIn(".post-setup-notification{pointer-events:auto", board)+ self.assertIn(".post-setup-notification[data-collapsed=true]>.post-setup-task-list", board)+ self.assertIn("color:var(--color-text-secondary);fill:none;stroke:currentColor", board)+ self.assertGreater(html.index('id="postSetupTutorial"'), html.index('</main>'))+ self.assertIn("@media(max-width:720px)", board)+def test_index_and_entity_visibility_targets_exist_in_the_page(self):html = (Path(__file__).resolve().parents[1] / "web/index.html").read_text(encoding="utf-8")for start, end in (("async function openIndex(", " const title="),diff --git a/web/app.js b/web/app.jsindex b072e6a7c..d5957fc21 100644--- a/web/app.js+++ b/web/app.js@@ -1249,6 +1249,124 @@ function openHome(scroll=false){buildEdge();buildBars();load(true);if(scroll)window.scrollTo({top:0,behavior:'smooth'});}+const POST_SETUP_TUTORIAL_KEY='peach.post-setup-tutorial.v1';+const POST_SETUP_TUTORIAL_COLLAPSED_KEY='peach.post-setup-tutorial-collapsed.v1';+let postSetupTutorialRequest=0;+const postSetupTutorialMarker=()=>{+ try{return localStorage.getItem(POST_SETUP_TUTORIAL_KEY)||''}catch(_error){return ''}+};+const setPostSetupTutorialMarker=value=>{+ try{localStorage.setItem(POST_SETUP_TUTORIAL_KEY,value)}catch(_error){}+};+const postSetupTutorialCollapsed=()=>{+ try{return localStorage.getItem(POST_SETUP_TUTORIAL_COLLAPSED_KEY)==='1'}catch(_error){return false}+};+const setPostSetupTutorialCollapsed=value=>{+ try{localStorage.setItem(POST_SETUP_TUTORIAL_COLLAPSED_KEY,value?'1':'0')}catch(_error){}+};+/* `onboarding=1` 来自设置完成页。历史导入可以先去口味页,但标记会一直留到用户+ 第一次回首页;清单只读真实接口,不用“访问过页面”冒充完成。 */+if(new URLSearchParams(location.search).get('onboarding')==='1'){+ setPostSetupTutorialMarker('pending');+ if(location.pathname==='/'){+ const clean=new URL(location.href);clean.searchParams.delete('onboarding');+ history.replaceState(history.state,'',clean.pathname+clean.search+clean.hash);+ }+}+const postSetupTutorialTasks=async()=>{+ const {library,scraping,taste,follow,credentials,review}=await api('/api/post-setup-tutorial');+ const scrapingCredentialSources=(scraping.sources||[]).filter(source=>source.accepts_cookie);+ const savedScrapingCredentials=scrapingCredentialSources.filter(source=>source.cookie_saved);+ const sources=(follow.sources||[]).filter(source=>source.enabled!==false);+ const providers=new Map((credentials.providers||[]).map(row=>[row.provider,row]));+ const required=[...new Set(sources.map(source=>source.provider))]+ .map(provider=>providers.get(provider)).filter(row=>row?.requirement==='required');+ const libraryReady=Number(library.total||0)>0;+ const followReady=sources.length>0;+ const credentialsReady=followReady&&required.every(row=>row.present&&!row.missing?.length);+ const pendingReview=Object.entries(review.counts||{})+ .filter(([key])=>!REVIEW_SUMMARY_SKIPS.has(key))+ .reduce((sum,[,value])=>sum+(Number(value)||0),0);+ return [+ {key:'library',label:'完成首次扫描',description:libraryReady+ ?`已经导入 ${Number(library.total).toLocaleString()} 项馆藏。`:'等待扫描导入第一项馆藏。',+ href:'/configuration',done:libraryReady,icon:'scan-search'},+ {key:'scraping',label:'设置采集来源与凭证',description:savedScrapingCredentials.length+ ?`已为 ${savedScrapingCredentials.length.toLocaleString()} 个采集来源保存凭证。`+ :'检查来源连接方式,并为需要登录的来源保存凭证。',+ href:'/scraping',done:savedScrapingCredentials.length>0,icon:'settings'},+ {key:'history',label:'导入浏览器历史记录',description:Number(taste.summary?.history_sources||0)>0+ ?`已导入 ${Number(taste.summary.history_sources).toLocaleString()} 份浏览器历史。`+ :'从这台电脑的浏览器导入口味分析记录。',+ href:'/taste?onboarding=1',done:Number(taste.summary?.history_sources||0)>0,icon:'history'},+ {key:'follow',label:'添加一个关注来源',description:followReady+ ?`已启用 ${sources.length.toLocaleString()} 个来源。`:'添加想持续追踪的创作者或来源。',+ href:'/follow-manage?tab=add',done:followReady,icon:'rss'},+ {key:'credentials',label:'补齐关注来源凭证',description:!followReady+ ?'添加关注后,会按来源检查必要凭证。':required.length+ ?(credentialsReady?'已配置当前来源需要的凭证。':`${required.length.toLocaleString()} 个来源需要凭证。`)+ :'当前关注来源不需要凭证。',+ href:'/follow-manage?tab=source',done:credentialsReady,icon:'key-round'},+ {key:'review',label:'处理首次复核',description:!libraryReady+ ?'扫描完成后,会在这里列出需要你判断的资料。':pendingReview+ ?`还有 ${pendingReview.toLocaleString()} 条需要复核。`:'首次复核队列已清空。',+ href:'/review',done:libraryReady&&pendingReview===0,icon:'square-check-big'},+ ];+};+const postSetupTutorialHtml=tasks=>{+ const ordered=[...tasks].sort((left,right)=>Number(left.done)-Number(right.done));+ const complete=tasks.every(task=>task.done),next=tasks.find(task=>!task.done);+ const completeCount=tasks.filter(task=>task.done).length;+ const collapsed=postSetupTutorialCollapsed()&&!complete;+ const rows=ordered.map(task=>`<li class="post-setup-task" data-state="${task.done?'checked':'unchecked'}">+ <a href="${task.href}" data-tutorial-task="${task.key}">+ <span class="post-setup-check" aria-hidden="true">${task.done?icon('check'):icon(task.icon)}</span>+ <span><b>${task.label}</b><small>${task.description}</small></span>+ ${icon('chevron-right')}</a></li>`).join('');+ return `<article class="post-setup-notification" data-collapsed="${collapsed}">+ <header class="post-setup-notification-head">+ <span class="post-setup-notification-icon" aria-hidden="true">${icon(complete?'check-check':'sparkles')}</span>+ <div><h2>${complete?'Peach 已准备好':'完成 Peach 的安装教程'}</h2>+ <p>${complete?'这些步骤都已经通过实际状态检查。':`已完成 ${completeCount}/${tasks.length} 项,完成后会自动打勾。`}</p></div>+ <button class="post-setup-collapse" type="button" data-tutorial-collapse aria-controls="postSetupTaskList" aria-expanded="${!collapsed}"+ aria-label="${collapsed?'展开安装教程':'折叠安装教程'}">${icon(collapsed?'chevron-down':'chevron-up')}</button>+ </header>+ <ol class="post-setup-task-list" id="postSetupTaskList">${rows}</ol>+ <footer><button class="geist-button" type="button" data-tutorial-action="${complete?'finish':'next'}">+ ${complete?'完成教程':`继续:${next.label}`}</button></footer>+ </article>`;+};+async function syncPostSetupTutorial(){+ const root=$('#postSetupTutorial');if(!root)return;+ if(location.pathname!=='/'||postSetupTutorialMarker()!=='pending'){+ root.hidden=true;root.innerHTML='';return+ }+ const request=++postSetupTutorialRequest;root.hidden=false;root.setAttribute('aria-busy','true');+ root.innerHTML=`<article class="post-setup-notification post-setup-loading">${icon('sparkles')}<p>正在检查安装进度…</p></article>`;+ try{+ const tasks=await postSetupTutorialTasks();+ if(request!==postSetupTutorialRequest||location.pathname!=='/')return;+ root.innerHTML=postSetupTutorialHtml(tasks);root.removeAttribute('aria-busy');+ const complete=tasks.every(task=>task.done),next=tasks.find(task=>!task.done);+ const collapse=root.querySelector('[data-tutorial-collapse]');+ collapse.onclick=()=>{+ const card=root.querySelector('.post-setup-notification');+ const collapsed=card.dataset.collapsed!=='true';+ card.dataset.collapsed=String(collapsed);setPostSetupTutorialCollapsed(collapsed);+ collapse.setAttribute('aria-expanded',String(!collapsed));+ collapse.setAttribute('aria-label',collapsed?'展开安装教程':'折叠安装教程');+ collapse.innerHTML=icon(collapsed?'chevron-down':'chevron-up');+ };+ root.querySelector('[data-tutorial-action]').onclick=()=>{+ if(complete){setPostSetupTutorialMarker('complete');root.hidden=true;root.innerHTML='';return}+ location.href=next.href;+ };+ }catch(_error){+ if(request!==postSetupTutorialRequest)return;+ root.innerHTML=`<article class="post-setup-notification post-setup-error">${icon('alert')}<div><h2>暂时无法检查安装进度</h2><p>Peach 会在你下次回到首页时重新检查。</p></div></article>`;+ root.removeAttribute('aria-busy');+ }+}const ENTITY_FILTER_KEYS=['loc','creator','tag','state','dur_min','dur_max','orient','sort','dir'];const emptyEntityFilters=()=>Object.fromEntries(ENTITY_FILTER_KEYS.map(key=>[key,key==='sort'?'new':key==='dir'?'desc':'']));@@ -4363,6 +4481,7 @@ function enterManagementSurface(){// the management page after it resolves.loadRequestSeq++;listLoading=false;$('#combo').innerHTML='';hideDiscoveryBars();+ const tutorial=$('#postSetupTutorial');if(tutorial){tutorial.hidden=true;tutorial.innerHTML=''}document.body.classList.remove('entity-open','index-open');}async function openStats(push=true){@@ -4390,6 +4509,7 @@ function showHomeSurfaces(){$('#stats').hidden=true;$('#index').hidden=true;$('#tiers').style.display='';$('#tagbar').style.display='';buildManageBar();paintListTitle(); // 放在最后:管理区要盖掉上面刚恢复的首页横条+ void syncPostSetupTutorial();}function closeStats(push=true){if(push)route('/');showHomeSurfaces();load(true)}@@ -9699,6 +9819,7 @@ function openCatalog(path){state:ROUTE_STATES[path]||params.get('state')||'',...resolveSort(params.get('sort'),params.get('dir')),seed:params.get('seed')||(enteringHome?rollSeed():state.seed||rollSeed()),q:params.get('q')||'',jav:params.get('jav')||''};$('#q').value=state.q;rememberSearchValue();buildEdge();buildBars();load(true);+ void syncPostSetupTutorial();}/* 回收站。它和目录页共用同一张网格,只是筛选被钉死成 `trash`。 */function openTrash(push){diff --git a/web/board.css b/web/board.cssindex 374cdaae4..c06f2a8ba 100644--- a/web/board.css+++ b/web/board.css@@ -1581,6 +1581,46 @@ body .followmanage .board-pagination>.geist-button{height:32px;min-height:32px;p@keyframes board-check-draw{from{stroke-dashoffset:23px}to{stroke-dashoffset:0}}.pcheck input:checked+span svg{animation:board-check-draw .2s cubic-bezier(.65,0,.35,1) forwards}@media(prefers-reduced-motion:reduce){.pcheck input:checked+span svg{animation:none;stroke-dashoffset:0}}++/* 安装后第一次回首页:BoardUI NotificationViewport 把教程固定在右下角,内部任务沿用+ RareUI Task List 的真实状态、完成项后移与打勾,不占首页正文的布局空间。 */+#postSetupTutorial{position:fixed;right:12px;bottom:12px;z-index:100;display:block;width:min(400px,calc(100vw - 24px));max-height:calc(100dvh - 24px);pointer-events:none}+#postSetupTutorial[hidden]{display:none}+.post-setup-notification{pointer-events:auto;display:flex;flex-direction:column;max-height:inherit;overflow:hidden;border:1px solid var(--color-border-button-default);border-radius:16px;background:var(--color-background-primary-default);box-shadow:0 1px 1px #0000000d,0 4px 4px #0000001a;animation:post-setup-notification-in .15s ease-out}+.post-setup-notification-head{display:grid;grid-template-columns:40px minmax(0,1fr) 32px;align-items:start;gap:12px;padding:16px}+.post-setup-notification-icon{display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:var(--color-notification-information-background);color:var(--color-notification-information-foreground)}+.post-setup-notification-icon>svg,.post-setup-error>svg,.post-setup-loading>svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:2}+.post-setup-notification h2{margin:0;color:var(--color-text-primary);font:var(--board-body-medium)}+.post-setup-notification p{margin:4px 0 0;color:var(--color-text-secondary);font:var(--board-body-2-regular)}+.post-setup-collapse{display:grid;place-items:center;width:32px;height:32px;margin:-4px -4px 0 0;padding:0;border:0;border-radius:8px;background:transparent;color:var(--color-text-secondary)}+.post-setup-collapse:hover{background:var(--color-background-primary-hover);color:var(--color-text-primary)}+.post-setup-collapse>svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2}+.post-setup-notification[data-collapsed=true]>.post-setup-task-list,.post-setup-notification[data-collapsed=true]>footer{display:none}+.post-setup-task-list{display:grid;gap:0;min-height:0;margin:0;padding:4px;border-block:1px solid var(--color-separator-border);overflow-y:auto;list-style:none}+.post-setup-task{border-radius:8px;transition:background-color .15s ease}+.post-setup-task+.post-setup-task{border-top:1px solid var(--line-soft)}+.post-setup-task:hover{border-top-color:transparent;background:var(--hover)}+.post-setup-task:hover+.post-setup-task{border-top-color:transparent}+.post-setup-task>a{display:grid;grid-template-columns:24px minmax(0,1fr) 16px;align-items:center;gap:12px;min-height:62px;padding:10px 12px;border-radius:8px;color:var(--ink);text-decoration:none;transition:color .15s ease}+.post-setup-task>a>svg{width:16px;height:16px;color:var(--color-text-secondary);fill:none;stroke:currentColor;stroke-width:2}+.post-setup-task:hover>a>svg{color:var(--color-text-primary)}+.post-setup-check{display:grid;place-items:center;width:24px;height:24px;border:1px solid var(--line);border-radius:50%;color:var(--muted)}+.post-setup-check svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2}+.post-setup-task b,.post-setup-task small{display:block}+.post-setup-task b{font:var(--board-body-medium)}+.post-setup-task small{margin-top:2px;color:var(--muted);font:var(--board-body-2-regular)}+.post-setup-task[data-state=checked] .post-setup-check{border-color:var(--color-accent-500);background:var(--color-accent-500);color:#fff}+.post-setup-task[data-state=checked] b{text-decoration:line-through;color:var(--muted)}+.post-setup-task[data-state=checked]{opacity:.72}+.post-setup-notification>footer{padding:12px}+.post-setup-notification>footer>.geist-button{width:100%}+.post-setup-loading{display:flex;flex-direction:row;align-items:center;gap:10px;min-height:54px;padding:16px}+.post-setup-loading p{margin:0}+.post-setup-error{display:grid;grid-template-columns:20px minmax(0,1fr);gap:8px;padding:16px}+@keyframes post-setup-notification-in{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}+@media(min-width:640px){#postSetupTutorial{right:24px;bottom:24px;max-height:calc(100dvh - 48px)}}+@media(max-width:720px){.post-setup-task>a{min-height:58px;padding-inline:10px}}+@media(prefers-reduced-motion:reduce){.post-setup-notification{animation:none}.post-setup-task,.post-setup-task>a{transition:none}}/* ── Board 第三批:主按钮尺寸、配置页白底、通知与提醒、批量条、关注行图标、侧栏切换器 ── *//* 主按钮与旁边的 Board 按钮同一副盒子:36px、10px 圆角、Body Medium。 */body :is(.geist-button,.fbtn,.resourceaction,.tagselection button,.geist-fieldset-footer>a,.geist-fieldset-footer>button).primary{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:4px;height:36px;min-height:36px;padding:8px 12px;border-radius:10px;font:var(--board-body-medium);white-space:nowrap}diff --git a/web/index.html b/web/index.htmlindex 21a84dc10..c9fd95817 100644--- a/web/index.html+++ b/web/index.html@@ -233,6 +233,8 @@<div class="loadmore mono" id="loadSentinel" hidden></div></main>+<section id="postSetupTutorial" aria-label="Peach 安装教程" aria-live="polite" hidden></section>+<div class="scrim" id="scrim"></div><!-- 光晕就是侧栏玻璃面上那两团慢慢漂的光换成用户自己配的三枚,所以它长在 .drawer 里面、跟着抽屉的圆角一起被裁,正文身后一点都没有。单独占一层是因为失效范围:光晕参数是