Skip to content

armgit / peach

Public Imported from GitHub
0

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

fix(web): 完善关注分页、别名多选与响应式操作

longmeidao2add035a2ecf
diff --git a/docs/BOARD_UI.md b/docs/BOARD_UI.md
index f969f324e..4f64d0663 100644
--- a/docs/BOARD_UI.md
+++ b/docs/BOARD_UI.md
@@ -1,12 +1,26 @@
# BoardUI 适配
-## 作者别名与扫描操作
+## 空状态操作入口
+
+空状态复用 `emptyStateHtml`,操作位于说明下方、居中排列,窄屏可换行。关注列表与关注更新的空状态提供「添加关注」主按钮;馆藏、标签和实体索引中的关注入口也直达 `/follow-manage?tab=add`。关注管理区域写入地址栏,刷新与返回可恢复对应区域。馆藏有「添加内容」主按钮时,关注入口为次按钮。
+
+统计空状态提供对应入口:内容标签和标签来源前往数据管理补全资料,观看记录前往馆藏,存储来源前往配置添加媒体文件夹。统计分区操作使用次按钮。
+
+关注来源行保持勾选、名称、来源状态、检查时间和操作同一行;卡片宽度不超过 600px 时省略年份,不超过 460px 时省略时分,完整时间保留在可聚焦时间字段的说明中。创作者标题中的全选与收起保持同一行;全选使用 Lucide 1.40.0 的 `check-check` 双勾图标,卡片不超过 460px 时只显示图标,操作名称随全选状态同步。列表骨架复用正式的区域属性、工具栏、批量操作与创作者卡片,每条来源使用相同五列布局。
+
+空状态巡检覆盖馆藏与实体索引、关注更新与管理、统计、口味、播放列表、任务中心、高清目标、重复文件、复核、垃圾文件和回收站。筛选无结果保留现有筛选恢复入口;播放列表、手动别名、口味采集与复核抽帧的动作已在相邻表单或工具栏提供。任务记录、高清目标、无重复文件、无复核候选、垃圾文件与回收站为空属于正常状态,不要求用户启动任务或制造内容。来源搜索、详情推荐和图表中的局部空结果保留说明。
+
+## 创作者别名与扫描操作
创作者别名区域依次提供「手动添加别名」、待合并与已保存列表。关注设置中的「首次采集历史范围」默认最近 30 天,可选 7 天、90 天或不限时间;按发布时间排除较早内容,无日期条目仍保留。每个新来源首次采集时固定边界,重试和自动更新沿用;已有来源不追溯处理,手动历史分页先补回首页被跳过的内容,再向前翻页。列表统计包含全部已导入的未看条目。
2026-09-13 核对 [Table](https://www.boardui.com/components/table) 和 [Data Table](https://www.boardui.com/components/data-table)。实时表格使用 `role="grid"`,单元格为 14px、内边距 10px 12px;页面 CSS 部署标识为 `dpl_QqDLotDUMyvoaXmnBoPEK5tSk8mc`。官方 `https://www.boardui.com/r/table.json` 的 SHA-256 为 `fc12a8f2f4012d9e983e0b9bbb10f9fe3288d74046566d2623d60e7056c50d88`。
-作者别名复用现有 Table 样式,待合并按规范作者、平台别名、依据和操作分列,已保存别名独立成表;支持逐条合并、全部合并、手动添加和移除。全部合并先列出归属关系,失败时保留未完成项供重试。Peach 保留原生表格与既有 API,没有引入 React Aria 或 TanStack Table。
+创作者别名复用现有 Table 样式,待合并按选择、规范创作者、平台别名、依据和操作分列,已保存别名独立成表。两个名字列各占 18%,依据使用剩余宽度;每行可勾选,表头支持全选与半选,右上角提供带数量的「合并所选」和「全部合并」。支持逐条合并、手动添加和移除。批量合并先列出归属关系,失败时保留未完成项供重试。Peach 保留原生表格与既有 API,没有引入 React Aria 或 TanStack Table。
+
+2026-09-13 实测 [Table 分页](https://www.boardui.com/components/table):上一页/下一页位于两端,页码居中,按钮高 32px、圆角 8px、14px 字号,前后按钮内边距 6px 8px,分页区域间距 8px。点击下一页后当前页变为 2;官方 `/r/pagination.json` 的 SHA-256 为 `cbbb09ecb86b3f93d4c923f02d272a7086db624ab69eaf5768f036b7458435f8`。Peach 复用既有 `pagination.ts` 与 Board 样式,保留 Lucide 箭头和中文标签,手机页码独占第二排。
+
+关注列表默认视图按完整创作者组分页,表格按排序后的来源分页;每页 10、20、50、100,默认 20,数量偏好保存在本机。排序、版式与数量切换回到第一页,页码写入地址,越界页落到末页。默认视图支持全部展开/收起;选择跨页、跨视图保留,全选本页只影响本页来源。底部批量操作复用人工复核的 `selectiondock`、计数和取消选择模式,提供检查、启用、暂停、删除;批量请求使用全部已选来源。滚动表格建立局部定位边界,避免隐藏表头文本撑出手机页面。加载骨架按已选版式预留卡片或表格结构。
扫描与采集复用口味页的 Split Button 外观和共享菜单定位:默认扫描并补全资料,菜单提供同名主动作、只扫描、只采集。图标使用固定版 Lucide 的 `database`、`hard-drive`、`globe`,分别指资料、本地磁盘和外部来源,无新增依赖。
diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md
index d9500f512..86758ab30 100644
--- a/docs/HANDOFF.md
+++ b/docs/HANDOFF.md
@@ -70,7 +70,7 @@
## 参考产品证据登记
-- [作者别名表格取证](BOARD_UI.md#作者别名与扫描操作)。
+- [创作者别名表格与关注分页取证](BOARD_UI.md#创作者别名与扫描操作)。
- [Board、Link Button 与搜索动效取证](BOARD_UI.md)。
diff --git a/docs/REUSE.md b/docs/REUSE.md
index 761d8287d..982ff6d28 100644
--- a/docs/REUSE.md
+++ b/docs/REUSE.md
@@ -4,6 +4,8 @@
- 作者别名管理复用 `.ftable` 和既有别名 API;Board Table 的公开结构与固定资源见 `BOARD_UI.md`。Data Table 的排序、分页在当前别名规模下不需要,未引入其 React Aria 与 TanStack 依赖。`frontend/src/split-action.tsx` 复用口味页分体按钮外观、共享菜单定位和键盘行为,扫描三种方式使用已有 Lucide 图标,无新增依赖。
+- 关注列表分页复用 `pagination.ts` 的页码范围、边界裁剪与 Board 外观;默认视图按创作者组,表格按来源。批量操作复用人工复核与馆藏的 `selectiondock` 样式和 `selection.ts` 状态同步,跨页选择由来源 ID 集合管理。官方分页源码固定哈希见 `BOARD_UI.md`;沿用现有实现和 Lucide,未增加 React Aria、TanStack 或 Remix Icon 依赖。隔离样例验证了 25 位创作者、75 个来源的分页与跨页选择。
+
- 窄屏筛选框共用 `filterScrollState()`、现有滚动帧调度和原生 sticky;同一方向累计 8px 再切换吸顶,保留文档占位与键盘可达性,无新增依赖。
- 搜索玻璃复用 `glideEase()` 的采样弹簧;`web/js/search-morph.js` 只负责视口边界与轮廓关键帧,证据与差异见 `BOARD_UI.md`,无新增依赖。
diff --git a/frontend/src/board-skeleton.ts b/frontend/src/board-skeleton.ts
index 1bfabf34e..4054c2d28 100644
--- a/frontend/src/board-skeleton.ts
+++ b/frontend/src/board-skeleton.ts
@@ -1,3 +1,6 @@
+import { icon } from '@peach/legacy/core';
+import { checkboxHtml, selectFieldHtml } from '@peach/legacy/ui';
+
/** 等待态复用页面容器,只有异步内容使用占位。 */
const line = (width = '60%') => `<span class="skeleton" style="width:${width}"></span>`;
const lines = () => `${line('80%')}${line('48%')}`;
@@ -7,19 +10,25 @@ const tabs = (labels: string[], className = 'skeleton-tabs') => `<div class="${c
const segments = (labels: string[], className: string) => `<div class="${className} skeleton-segments" data-board-segments="true">${labels.map((label,index) => `<span${index===0?' class="skeleton-segment-selected"':''}>${label}</span>`).join('')}</div>`;
const radial = (title: string) => `<section class="board-radial-card"><header><span>${title}</span><b>${line()}</b></header><div class="board-rings skeleton-rings"><span class="skeleton skeleton-ring"></span></div><div class="skeleton-lines">${lines()}</div></section>`;
const panel = (title: string) => `<section class="insightpanel"><header>${title}</header><div class="insightpanelbody skeleton-lines">${repeat(lines(), 3)}</div></section>`;
+const followControl = (label: string) => `<button class="fbtn" type="button" disabled>${label}</button>`;
+const followToolbar = () => `<div class="fsechead" data-collapse-toolbar><h3>关注列表</h3><span class="fmeta">${line('100px')}</span><span class="fmanagesort" data-collapse-field>${icon('sort')}${selectFieldHtml([['checked','检查时间']],'checked',{label:'关注列表排序',attr:'disabled'})}</span><button class="fbtn fmanagedir" disabled>${icon('arrow-down')}</button><div class="iconswitch" data-board-segments="true"><label>${icon('layout-grid')}</label><label>${icon('table')}</label></div><button class="fbtn" disabled>${icon('refresh-cw')}<span data-collapse-label>检查全部</span></button></div>`;
+const followRow = () => `<div class="fsource frow"><span class="fchannelcheck">${line('18px')}</span><b>${line('85%')}</b><span class="fprovider">${line('54px')}</span><span class="fmeta fchecked">${line('40px')}</span><span class="fsourceactions"><span class="skeleton skeleton-icon"></span><span class="skeleton skeleton-icon"></span></span></div>`;
+const followAuthor = () => `<details class="fauthor" open><summary class="fauthorhead"><span class="favatar skeleton"></span><b>${line('90px')}</b><span class="skeleton skeleton-icon"></span><span class="fmeta">${line('40px')}</span><span class="board-author-actions"><button type="button" class="fbtn small" data-follow-author-select disabled>${icon('check-check')}<span data-author-select-label>全选</span></button><span class="skeleton skeleton-icon"></span></span></summary><div class="fauthorsources">${repeat(followRow(),3)}</div></details>`;
export function detailSkeletonHtml(): string {
return `<div data-skeleton="detail" role="status" aria-label="正在读取作品详情"><div class="sgrid" aria-hidden="true"><div class="vwrap skeleton-detail-media skeleton"></div><aside class="side"><div class="sidecontent skeleton-lines">${line('85%')}${line('65%')}${repeat(lines(), 4)}</div></aside></div></div>`;
}
-export function boardPageSkeleton(path: string): string {
+export function boardPageSkeleton(path: string, options: {followLayout?: string} = {}): string {
let body = '';
if (path === '/stats') {
body = `<div class="insightpage statsdashboard"><header class="insighttoolbar">${line('38%')}</header>${metrics(['馆藏视频', '看过', '内容标签', '使用空间'])}<section class="insightdetail"><div class="insightdetailbody"><div class="board-inventory-charts">${radial('网盘与本地')}${radial('媒体库')}</div></div></section>${panel('内容标签')}</div>`;
} else if (path === '/taste') {
body = `<div class="tastepage"><header class="tastehead">${segments(['浏览器记录', 'Peach 内部'], 'insightswitch')}${line('24%')}</header><div class="tastestate"></div>${metrics(['浏览记录', '口味维度', '浏览候选', '私有导出'], 'tastesummaries')}<section class="tastehero"><div class="insightcopy"><span>浏览器画像</span><div class="skeleton skeleton-radar"></div></div><div class="tastebars skeleton-lines">${repeat(lines(), 4)}</div></section>${panel('口味分析')}<div class="board-activity-charts">${panel('浏览活动')}${panel('时间分布')}</div>${panel('标签')}</div>`;
} else if (path === '/follow-manage') {
- body = `<div class="follow followmanage"><div class="fmanageoverview">${['关注创作者', '启用来源', '检查失败', '未看更新'].map(label => `<div><span>${label}</span><b>${line()}</b></div>`).join('')}</div>${segments(['关注列表', '添加关注', '来源和凭证'], 'follow-workspace-switch')}<div class="fmain"><section class="fsec" data-follow-panel="sources"><div class="fsechead"><h3>关注列表</h3>${line('30%')}</div><div class="board-follow-selection">${line('45%')}</div><div class="frows fsources" data-layout="default"><div class="board-follow-list">${repeat(`<article class="fauthor"><div class="fauthorhead">${line('40%')}</div><div class="skeleton-lines">${repeat(lines(), 2)}</div></article>`, 4)}</div></div></section></div></div>`;
+ const table=options.followLayout==='table';
+ const content=table?`<div class="ftableframe"><div class="ftablewrap"><table class="ftable"><thead><tr>${['选择','创作者','来源','站点','状态','上次检查','操作'].map(label=>`<th>${label}</th>`).join('')}</tr></thead><tbody>${repeat(`<tr>${['20px','90px','120px','60px','40px','100px','60px'].map(width=>`<td>${line(width)}</td>`).join('')}</tr>`,6)}</tbody></table></div></div>`:`<div class="board-follow-list">${repeat(followAuthor(),4)}</div>`;
+ body = `<div class="follow followmanage"><div class="fmanageoverview">${['关注创作者', '启用来源', '检查失败', '未看更新'].map(label => `<div><span>${label}</span><b>${line()}</b></div>`).join('')}</div>${segments(['关注列表', '添加关注', '来源和凭证'], 'follow-workspace-switch')}<div class="fmain"><section class="fsec" data-follow-workspace-panel="list">${followToolbar()}<div class="board-follow-selection"><label>${checkboxHtml('disabled')}全选本页</label>${table?'':followControl('全部收起')}</div><div class="frows fsources" data-layout="${table?'table':'default'}">${content}<div class="followpagefooter"><div class="followpageinfo">${line('120px')}${line('100px')}</div></div></div></section></div></div>`;
} else if (path === '/configuration') {
body = `<div class="configpage">${tabs(['通用', '媒体', '网络与访问', '更新与维护'])}<section class="configfieldset"><div class="geist-fieldset-content"><h3 class="geist-fieldset-title">开机自启</h3><div class="skeleton-lines">${repeat(`<div class="skeleton-setting">${line('35%')}<span class="skeleton skeleton-toggle"></span></div>`, 3)}</div></div><footer class="geist-fieldset-footer">${line('100px')}</footer></section></div>`;
} else if (path === '/activity') {
@@ -31,5 +40,5 @@ export function boardPageSkeleton(path: string): string {
} else if (path === '/playlists') {
body = `<section class="playlistpage"><header><div><h2>播放列表</h2><p>保存 Mix,按自己的顺序继续播放。</p></div><div class="playlistcreate skeleton-lines"><span>新播放列表</span>${line('200px')}</div></header><div class="playlistcards">${repeat(`<article class="card playlistcard"><div class="mixstack"><div class="pic skeleton"></div></div><div class="mixmeta"><span class="mav skeleton"></span><div class="mixcopy skeleton-lines">${lines()}</div></div></article>`, 6)}</div></section>`;
} else return '';
- return `<div class="board-page-skeleton" data-skeleton="board${path}" role="status" aria-label="正在读取页面"><div aria-hidden="true">${body}</div></div>`;
+ return `<div class="board-page-skeleton" data-skeleton="board${path}" role="status" aria-label="正在读取页面"><div aria-hidden="true" inert>${body}</div></div>`;
}
diff --git a/frontend/src/catalog-onboarding.ts b/frontend/src/catalog-onboarding.ts
index b65ffbd32..bcc556f01 100644
--- a/frontend/src/catalog-onboarding.ts
+++ b/frontend/src/catalog-onboarding.ts
@@ -34,8 +34,8 @@ export async function catalogSuggestions(state: Record<string, string>, request:
/** 空馆藏、筛选无结果与资料尚未建立分别给出可执行入口。 */
export function catalogEmptyHtml({ kind = 'catalog', filtered = false, jav = false, configurable = false, online = false } = {}): string {
- const add = configurable ? '<a class="geist-button primary" href="/configuration">添加内容</a>' : '';
- const follow = '<a class="geist-button" href="/follow-manage">添加来源</a>';
+ const add = configurable ? '<button class="geist-button primary" data-empty-settings>添加内容</button>' : '';
+ const follow = '<a class="geist-button' + (!configurable || online ? ' primary' : '') + '" href="/follow-manage?tab=add">添加关注</a>';
if (filtered || jav) return emptyStateHtml('search', jav ? '还没有符合条件的 JAV 作品' : '没有符合条件的内容',
jav ? '已扫描但尚未补充发行资料的视频可在全部内容中查看。' : '清除筛选或搜索条件后查看全部内容。',
{ actions: '<a class="geist-button primary" href="/?loc=&thumb=0">查看全部内容</a>' });
diff --git a/frontend/test/board-skeleton.test.ts b/frontend/test/board-skeleton.test.ts
index 44336f642..2b1901fec 100644
--- a/frontend/test/board-skeleton.test.ts
+++ b/frontend/test/board-skeleton.test.ts
@@ -1,14 +1,22 @@
-import { describe, expect, it } from 'vitest';
+import { describe, expect, it, vi } from 'vitest';
import { boardPageSkeleton, detailSkeletonHtml } from '../src/board-skeleton';
import { wireBoardSegments } from '../src/board-controls';
+vi.mock('@peach/legacy/core', async importOriginal => ({
+ ...await importOriginal<object>(),
+ icon: (name: string) => `<svg aria-hidden="true" data-icon="${name}"></svg>`,
+}));
+
describe('Board 页面骨架', () => {
it.each(['/stats', '/taste', '/follow-manage', '/configuration', '/activity', '/duplicates', '/quality-goals', '/playlists'])('为 %s 提供单一等待语义', path => {
const root = document.createElement('div');
root.innerHTML = boardPageSkeleton(path);
expect(root.querySelectorAll('[role="status"]')).toHaveLength(1);
expect(root.querySelector('[aria-hidden="true"]')).not.toBeNull();
- expect(root.querySelectorAll('button, input, a')).toHaveLength(0);
+ expect(root.querySelector('[aria-hidden="true"][inert]')).not.toBeNull();
+ for (const control of root.querySelectorAll('button, input, a, summary')) {
+ expect(control.closest('[inert]')).not.toBeNull();
+ }
});
it('统计预留四张指标卡,未知页面交给自身骨架', () => {
const root = document.createElement('div');
@@ -45,6 +53,14 @@ describe('Board 页面骨架', () => {
expect(root.querySelector('.board-segment-thumb')).toBeNull();
expect(root.querySelector('.skeleton-segment-selected')?.textContent).toBe('关注列表');
expect(root.querySelectorAll('.skeleton-segments > span')).toHaveLength(3);
+ expect(root.querySelector('[data-follow-workspace-panel="list"]')).not.toBeNull();
+ expect(root.querySelector('[data-follow-panel="sources"]')).toBeNull();
+ expect(root.querySelectorAll('.board-follow-list .fauthor')).toHaveLength(4);
+ expect(root.querySelectorAll('.fauthorsources .fsource.frow')).toHaveLength(12);
+ expect(root.querySelectorAll('.fsource.frow > *')).toHaveLength(60);
+ expect(root.querySelectorAll('.board-follow-selection button')).toHaveLength(1);
+ expect(root.querySelector('.followpagefooter')).not.toBeNull();
+ expect(root.querySelector('.selectiondock')).toBeNull();
});
it('口味骨架保留分段背景与状态行间距', () => {
const root = document.createElement('div');
@@ -54,4 +70,11 @@ describe('Board 页面骨架', () => {
expect(root.querySelector('.tastehead + .tastestate + .tastesummaries')).not.toBeNull();
expect(root.querySelector('.tastehead .skeleton-tabs')).toBeNull();
});
+ it('关注表格视图预留表头与来源行',()=>{
+ const root=document.createElement('div');root.innerHTML=boardPageSkeleton('/follow-manage',{followLayout:'table'});
+ expect(root.querySelector('.fsources[data-layout="table"]')).not.toBeNull();
+ expect(root.querySelectorAll('thead th')).toHaveLength(7);
+ expect(root.querySelectorAll('tbody tr')).toHaveLength(6);
+ expect(root.querySelector('.fauthor')).toBeNull();
+ });
});
diff --git a/frontend/test/catalog-onboarding.test.ts b/frontend/test/catalog-onboarding.test.ts
index d7c08730a..d5c110270 100644
--- a/frontend/test/catalog-onboarding.test.ts
+++ b/frontend/test/catalog-onboarding.test.ts
@@ -29,9 +29,11 @@ describe('馆藏与资料空状态', () => {
it('空首页提供添加内容与来源的真实入口', () => {
const html = catalogEmptyHtml({ configurable: true });
expect(html).toContain('data-geist-empty-state');
- expect(html).toContain('href="/configuration"');
- expect(html).toContain('href="/follow-manage"');
- expect(catalogEmptyHtml()).not.toContain('href="/configuration"');
+ expect(html).toContain('data-empty-settings');
+ expect(html).toContain('href="/follow-manage?tab=add"');
+ expect(catalogEmptyHtml()).not.toContain('data-empty-settings');
+ expect(catalogEmptyHtml()).toContain('class="geist-button primary" href="/follow-manage?tab=add"');
+ expect(catalogEmptyHtml({ configurable: true }).match(/class="geist-button primary"/g)).toHaveLength(1);
});
it('JAV 与筛选无结果可查看未筛选内容', () => {
expect(catalogEmptyHtml({ jav: true })).toContain('尚未补充发行资料');
diff --git a/frontend/test/follow-alias.test.ts b/frontend/test/follow-alias.test.ts
index b96d8ef96..5d9925b6f 100644
--- a/frontend/test/follow-alias.test.ts
+++ b/frontend/test/follow-alias.test.ts
@@ -1,6 +1,7 @@
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { afterEach, expect, it, vi } from 'vitest';
+import { checkboxHtml } from '@peach/legacy/ui';
const source=readFileSync(resolve(process.cwd(),'../web/app.js'),'utf8');
const manager=source.slice(source.indexOf('function followAliasManager('),source.indexOf('const CRED_STATE='));
@@ -8,7 +9,7 @@ const handlers=source.slice(source.indexOf(' const saveAuthorAlias='),source.in
const esc=(value:unknown)=>String(value).replaceAll('&','&amp;').replaceAll('<','&lt;').replaceAll('"','&quot;');
function fixture(api:ReturnType<typeof vi.fn>) {
const root=document.createElement('div');document.body.append(root);
- const html=new Function('esc','icon','followAliasAvatar','emptyState',`${manager};return followAliasManager;`)(esc,()=>'',()=>'',()=>'');
+ const html=new Function('esc','icon','followAliasAvatar','emptyState','checkboxHtml',`${manager};return followAliasManager;`)(esc,()=>'',()=>'',()=>'',checkboxHtml);
root.innerHTML=html([{canonical_name:'作者 A',aliases:[{name:'已存别名'}]}],[
{canonical:'作者 A',alias:'别名 A',evidence:'来源 A'},
{canonical:'作者 B',alias:'别名 B',evidence:'来源 B'},
@@ -20,6 +21,31 @@ function fixture(api:ReturnType<typeof vi.fn>) {
}
afterEach(()=>document.body.replaceChildren());
+it('勾选决定合并范围,表头全选支持取消与半选',async()=>{
+ const api=vi.fn().mockResolvedValue({ok:true});
+ const {root,confirmModal}=fixture(api);
+ const fields=[...root.querySelectorAll<HTMLInputElement>('[data-follow-alias-select]')];
+ const all=root.querySelector<HTMLInputElement>('[data-follow-alias-select-all]')!;
+ const merge=root.querySelector<HTMLButtonElement>('[data-follow-alias-selected]')!;
+ expect(merge.disabled).toBe(true);
+ fields[0]!.click();
+ expect(all.indeterminate).toBe(true);
+ expect(merge.textContent).toBe('合并所选(1)');
+ all.click();
+ expect(fields.every(field=>field.checked)).toBe(true);
+ all.click();
+ expect(fields.every(field=>!field.checked)).toBe(true);
+ expect(merge.disabled).toBe(true);
+ fields[1]!.click();merge.click();
+ expect(api).not.toHaveBeenCalled();
+ const confirmation=confirmModal.mock.calls[0]![0];
+ expect(confirmation.body).toContain('「别名 B」归入「作者 B」');
+ expect(confirmation.body).not.toContain('别名 A');
+ await confirmation.onConfirm();
+ expect(api.mock.calls.map(call=>JSON.parse(call[1].body).alias)).toEqual(['别名 B']);
+ expect(root.querySelector('[data-follow-alias-add]')?.getAttribute('data-alias')).toBe('别名 A');
+});
+
it('别名表格保留依据、添加和移除,全部合并等待确认',async()=>{
const api=vi.fn().mockResolvedValue({ok:true});
const {root,confirmModal,refresh,receipt}=fixture(api);
diff --git a/frontend/test/follow-pagination.test.ts b/frontend/test/follow-pagination.test.ts
new file mode 100644
index 000000000..1f58eb175
--- /dev/null
+++ b/frontend/test/follow-pagination.test.ts
@@ -0,0 +1,59 @@
+import { readFileSync } from 'node:fs';
+import { resolve } from 'node:path';
+import { afterEach, expect, it, vi } from 'vitest';
+import { pageCount, clampPage, paginationHtml } from '../src/pagination';
+import { selectionSummary, syncSelectionToolbar, selectGroup } from '../src/selection';
+
+const source=readFileSync(resolve(process.cwd(),'../web/app.js'),'utf8');
+const listing=source.slice(source.indexOf('function followSourceListHtml('),source.indexOf('function refreshFollowSourcePage('));
+const sizes=source.match(/const FOLLOW_PAGE_SIZES=\[[^\]]+\];/)![0];
+const groups=Array.from({length:25},(_,index)=>[{id:index*3+1},{id:index*3+2},{id:index*3+3}]);
+function page(layout:string,current:number,size:number){
+ const table=vi.fn(()=>'table');
+ const render=new Function('followListLayout','followPageSize','pageCount','clampPage','followSourceTable','followAuthorBlock','selectFieldHtml','paginationHtml','followManagePage',`${sizes}${listing};return {html:followSourceListHtml(arguments[9]),page:followManagePage};`);
+ return {table,...render(()=>layout,()=>size,pageCount,clampPage,table,(group:{id:number}[])=>`<article data-id="${group[0]!.id}"></article>`,()=>'',paginationHtml,current,groups)};
+}
+afterEach(()=>document.body.replaceChildren());
+
+it('默认视图保持创作者组完整,越界页落到末页',()=>{
+ const result=page('default',9,20),root=document.createElement('div');root.innerHTML=result.html;
+ expect(result.page).toBe(2);
+ expect(root.querySelectorAll('article')).toHaveLength(5);
+ expect(root.querySelector('article')?.dataset.id).toBe('61');
+ expect(root.textContent).toContain('21–25 / 25 位创作者');
+});
+
+it('表格按来源总数分页并传递范围',()=>{
+ const result=page('table',8,10);
+ expect(result.page).toBe(8);
+ expect(result.table).toHaveBeenCalledWith(groups,true,8,10);
+ expect(result.html).toContain('71–75 / 75 个来源');
+});
+
+it('表格先按来源全量排序,再截取页内行',()=>{
+ const tableSource=source.slice(source.indexOf('function followSourceTable('),source.indexOf('function followAliasManager('));
+ const render=new Function('FOLLOW_SOURCE_SORTS','followManageSort','followManageDir','FOLLOW_SORT_DEFAULT_DIR','followAuthorName','followSourceCells','followTableHeader','followAuthorAvatar','esc',`${tableSource};return followSourceTable;`)(
+ {source:(a:{id:number},b:{id:number})=>a.id-b.id},'source','asc',{source:'asc'},()=>'',(row:{id:number})=>({className:'fsource',check:'',name:String(row.id),error:'',provider:()=>'',status:'',checked:'',actions:''}),()=>'',()=>'',String,
+ );
+ const root=document.createElement('div');root.innerHTML=render([[{id:4},{id:1}],[{id:3},{id:2}]],true,2,2);
+ expect([...root.querySelectorAll('.ftname')].map(cell=>cell.textContent)).toEqual(['3','4']);
+});
+
+it('跨页选择用于批量动作,本页全选只作用于当前行,取消选择清空全部',()=>{
+ const root=document.createElement('div');document.body.append(root);
+ root.innerHTML='<label><input type="checkbox" data-follow-select-all></label><div class="fsource"><input type="checkbox" data-follow-select="2"></div><div class="followselectiondock"><span data-follow-selected-count></span><button data-follow-selection-action data-follow-check></button><button data-follow-selection-clear></button></div>';
+ const selection=new Set([1]);
+ const segment=source.slice(source.indexOf(' const selectable=[...root.querySelectorAll(\'[data-follow-select]\')]'),source.indexOf(' wireScrollers(root);',source.indexOf('function wireFollowManage(')));
+ new Function('root','followData','followSourceSelection','followRuntime','selectionSummary','syncSelectionToolbar','selectGroup',segment)(root,{sources:[{id:1},{id:2}]},selection,{},selectionSummary,syncSelectionToolbar,selectGroup);
+ const all=root.querySelector<HTMLInputElement>('[data-follow-select-all]')!;
+ const action=root.querySelector<HTMLButtonElement>('[data-follow-check]')!;
+ expect(all.checked).toBe(false);
+ expect(action.disabled).toBe(false);
+ expect(action.dataset.followSources).toBe('1');
+ all.click();expect([...selection]).toEqual([1,2]);
+ all.click();expect([...selection]).toEqual([1]);
+ root.querySelector<HTMLButtonElement>('[data-follow-selection-clear]')!.click();
+ expect(selection.size).toBe(0);
+ expect(root.querySelector<HTMLElement>('.followselectiondock')!.hidden).toBe(true);
+ expect(action.disabled).toBe(true);
+});
diff --git a/scripts/vendor_web_dependencies.mjs b/scripts/vendor_web_dependencies.mjs
index 106479b65..758d948d3 100644
--- a/scripts/vendor_web_dependencies.mjs
+++ b/scripts/vendor_web_dependencies.mjs
@@ -99,7 +99,7 @@ const lucideIcons = new Map([
["unlink", "unlink"], ["git-compare", "git-compare"],
["compass", "compass"], ["folder-sync", "folder-sync"], ["expand", "expand"],
["zoom-in", "zoom-in"], ["zoom-out", "zoom-out"],
- ["plus", "plus"], ["minus", "minus"], ["check", "check"],
+ ["plus", "plus"], ["minus", "minus"], ["check", "check"], ["check-check", "check-check"],
["rotate-ccw", "rotate-ccw"], ["rotate-cw", "rotate-cw"], ["maximize", "maximize"],
["chevron-left", "chevron-left"], ["chevron-right", "chevron-right"],
["chevron-up", "chevron-up"], ["chevron-down", "chevron-down"], ["heart", "heart"],
diff --git a/tests/test_follow_web.py b/tests/test_follow_web.py
index 83fc38a93..8eddb3f38 100644
--- a/tests/test_follow_web.py
+++ b/tests/test_follow_web.py
@@ -2442,7 +2442,7 @@ class FollowWebSourceTests(unittest.TestCase):
self.assertPageContains('class="frows fsources"')
grid = self.page[self.page.index(".fsources{"):]
self.assertIn("repeat(auto-fit,minmax(430px,1fr))", grid[:grid.index("}")])
- self.assertPageContains("groups.map(followAuthorBlock).join('')")
+ self.assertPageContains("groups.slice(start,end).map(followAuthorBlock).join('')")
self.assertNotIn(".fsources>.fauthor{display:grid", self.page,
"多栏单位是作者组,不能拆开作者下面的来源行")
self.assertPageContains('class="fsourcelink externallink" href="${esc(source.url)}"')
@@ -2865,13 +2865,15 @@ class FollowWebSourceTests(unittest.TestCase):
self.assertPageContains("wireIconSwitch(root,'data-follow-layout',setFollowListLayout)")
self.assertPageContains('<div class="frows fsources" data-layout="${followListLayout()}">${sourceList}</div>')
self.assertPageContains(
- "return followListLayout()==='table'?followSourceTable(groups,true)")
+ "const content=table?followSourceTable(groups,true,followManagePage,size)")
# 切换只换列表本身:页头那枚开关留在原地,滑块才有得滑。
self.assertPageContains("const list=document.querySelector('#stats .fsources');\n"
" if(!list){renderFollowManage(followCredentials||{});return}\n"
- " list.dataset.layout=value;\n"
- " list.innerHTML=followSourceListHtml(followAuthorGroups(followData.sources||[]));\n"
- " wireFollowManage(followCredentials?.providers||[]);")
+ " refreshFollowSourcePage();")
+ self.assertPageContains("groups.slice(start,end).map(followAuthorBlock)")
+ self.assertPageContains("const selectedIds=()=>(followData.sources||[]).filter(source=>followSourceSelection.has(source.id)).map(source=>source.id);")
+ self.assertPageContains('class="selectiondock followselectiondock" role="group" aria-label="关注来源批量操作" hidden')
+ self.assertPageContains("const FOLLOW_PAGE_SIZES=[10,20,50,100];")
self.assertPageContains("const sourceList=followSourceListHtml(groups);")
self.assertPageContains("const collapsed=collapsedFollowAuthors.has(key);")
self.assertPageContains("group.map(source=>followSourceRow(source,true))")
@@ -2902,7 +2904,12 @@ class FollowWebSourceTests(unittest.TestCase):
self.assertPageContains('aria-label="待合并创作者别名"')
self.assertPageContains('aria-label="已保存创作者别名"')
self.assertPageContains('data-follow-alias-all')
- self.assertPageContains("confirmLabel:'合并全部别名'")
+ self.assertPageContains("confirmLabel:selectedOnly?'合并所选别名':'合并全部别名'")
+ self.assertPageContains('data-follow-alias-selected disabled>合并所选(0)')
+ self.assertPageContains('data-follow-alias-select-all aria-label="全选待合并别名"')
+ self.assertPageContains("aliasSelectAll.indeterminate=count>0&&count<fields.length")
+ self.assertPageContains(".filter(button=>!selectedOnly||button.closest('tr').querySelector('[data-follow-alias-select]').checked)")
+ self.assertPageContains("pending.shift();item.button.closest('tr')?.remove();syncAliasSelection();")
self.assertPageContains("const sources=(followData?.sources||[]).filter(source=>source.author_key===`name:${group.canonical_key}`);")
def test_both_views_render_the_same_source_cells(self):
@@ -2925,7 +2932,7 @@ class FollowWebSourceTests(unittest.TestCase):
self.assertPageContains('<td class="ftactions">${cell.actions}</td></tr>')
self.assertPageContains("selectable.forEach(field=>field.closest('.fsource').classList.toggle('selected',field.checked))")
# 时间格两边同一个写法,<i> 只是包一层,不是排版意图。
- self.assertPageContains('<i class="fyear">${esc(text.slice(0,5))}</i>${esc(text.slice(5))}')
+ self.assertPageContains('<i class="fyear">${esc(text.slice(0,5))}</i>${esc(text.slice(5,10))}<span class="fclock">${esc(text.slice(10))}</span>')
self.assertPageContains(".fsource .fchecked .fyear{font-style:normal}")
self.assertPageContains('<span class="fmeta fprovider${')
self.assertPageContains('title="${esc(source.provider_label)}">')
@@ -3667,7 +3674,7 @@ class FollowWebSourceTests(unittest.TestCase):
self.assertPageContains("function followAuthorGroups(sources)")
self.assertPageContains("source.author_key")
self.assertPageContains("const groups=followAuthorGroups(sources);")
- self.assertPageContains("groups.map(followAuthorBlock)")
+ self.assertPageContains("groups.slice(start,end).map(followAuthorBlock)")
# 组标题用作者本人的名字:四条来源合成一组之后还挂着其中一条的平台后缀,
# 等于说这一组只属于 fanbox,正是这次要消掉的误读。
self.assertPageContains("function followAuthorName(group)")
diff --git a/tests/test_web_ui.py b/tests/test_web_ui.py
index 9317c8a24..cfaf33a12 100644
--- a/tests/test_web_ui.py
+++ b/tests/test_web_ui.py
@@ -1562,7 +1562,7 @@ class WebUiSourceTests(unittest.TestCase):
"""
app = (Path(__file__).resolve().parents[1] / "web/app.js").read_text(encoding="utf-8")
board = (Path(__file__).resolve().parents[1] / "web/board.css").read_text(encoding="utf-8")
- self.assertIn('aria-label="全选 ${esc(name)} 的来源">全选</button>', app)
+ self.assertIn('aria-label="全选 ${esc(name)} 的来源">${icon(\'check-check\')}<span data-author-select-label>全选</span></button>', app)
self.assertIn("count===fields.length?'取消全选':'全选'", app)
self.assertIn(".fauthorhead>.fmeta{margin-left:auto}", board)
self.assertIn(".fauthorhead>.fmeta~.fmeta,.fauthorhead>.fmeta~.board-author-actions"
@@ -5544,6 +5544,21 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains("if(reset&&d.items.length)setGridCards(html)")
self.assertPageLacks('class="trashempty"')
+ def test_empty_follow_actions_open_the_add_workspace(self):
+ self.assertPageContains('href="/follow-manage?tab=add">添加关注</a>')
+ self.assertPageContains("followManageWorkspace=['list','add','source'].includes(params.get('tab'))?params.get('tab'):'list'")
+ self.assertPageContains("params.set('tab',key)")
+ self.assertPageContains("params.set('tab',followManageWorkspace)")
+ self.assertPageContains("if(tab){tab.click();tab.focus()}")
+ self.assertPageContains("else void openFollowManage(true,'add')")
+ self.assertPageContains('.emptystate .es-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:8px}')
+
+ def test_follow_author_actions_stay_in_the_heading_row(self):
+ board = (Path(__file__).resolve().parents[1] / 'web/board.css').read_text(encoding='utf-8')
+ self.assertIn('.followmanage .board-follow-list .fauthorhead{flex-wrap:nowrap}', board)
+ self.assertIn('.followmanage .board-follow-list .board-author-actions{width:auto;flex:none}', board)
+ self.assertNotIn('.board-author-actions{width:100%', board)
+
def test_follow_fieldset_headers_share_one_control_height(self):
self.assertPageContains('.fsechead{display:flex;align-items:center;gap:12px;flex-wrap:wrap;box-sizing:border-box;min-height:56px')
@@ -8645,6 +8660,7 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains(needle)
# 关注来源那三处问的就是「有没有更新」,转圈归它们。
self.assertPageContains('aria-label="检查 ${esc(name)} 的全部来源">${icon(\'refresh-cw\')}')
+ self.assertPageContains("${icon('check-check')}<span data-author-select-label>全选</span>")
# 两个空态各说自己那件事:筛不出结果,和一次比对没有发现。
self.assertPageContains("emptyState('search-x','当前筛选下没有更新'")
self.assertPageContains("emptyState('file-stack','没有找到重复文件'")
diff --git a/web/app.js b/web/app.js
index 17f41d749..b0de1cc06 100644
--- a/web/app.js
+++ b/web/app.js
@@ -310,7 +310,7 @@ const MANAGEMENT_PLACEHOLDERS={
${pageSkeletonHtml('正在读取采集来源',{cards:true,count:4,fill:false,className:'cleanup-skeleton'})}</div>`,
};
const managementPlaceholder=path=>
- boardPageSkeleton(path)||
+ boardPageSkeleton(path,{followLayout:followListLayout()})||
(MANAGEMENT_PLACEHOLDERS[path]||(()=>pageSkeletonHtml('正在读取页面')))();
function showDetailLoading(){
const stage=$('#stage');
@@ -4045,22 +4045,22 @@ async function openStats(push=true){
${statCardBody(label,value,detail,{inventory:'database',viewing:'eye',coverage:'tags',storage:'hard-drive'}[key])}</button>`;
const tagsTable=d.top_tags.length?`<ol class="insightranking">${d.top_tags.map((t,index)=>`<li><button type="button" class="insightrankrow" data-k="${esc(t.k)}">
<span class="insightrankpos">${index+1}</span><span>${esc(tagLabel(t.k))}</span><b>${t.n.toLocaleString()}</b></button></li>`).join('')}</ol>`
- :emptyStateHtml('tags','还没有内容标签','补全资料或添加标签后,这里会显示馆藏中的内容标签。');
+ :emptyStateHtml('tags','还没有内容标签','补全资料或添加标签后,这里会显示馆藏中的内容标签。',{actions:'<a class="geist-button" href="/data-cleanup">补全资料</a>'});
const recentTable=d.recent.length?`<div class="board-watch-history">${d.recent.map(row=>{
const real=row.duration?Math.min(row.play_seconds/row.duration,1)*100:0;
const reached=(row.max_reached||0)*100;
const note=row.kind==='online'?'在线直接观看':(real<reached-25?'快进扫过':(row.o_count?`高潮 ${row.o_count}`:'正常观看'));
return `<article class="board-watch-entry"><div><h3><a href="${row.kind==='online'?'/follow/item/':'/item/'}${Number(row.id)}" data-middle-truncate>${esc(row.name)}</a></h3><p>${esc(row.creator||'')}<span>${note}</span></p></div>
<div class="board-watch-measures">${progressHtml(`真实观看 ${real.toFixed(0)}%`,real,100)}<small>真实 ${real.toFixed(0)}% · 到达 ${reached.toFixed(0)}%</small></div></article>`}).join('')}</div>`:
- `<div class="insightempty">${emptyStateHtml('history','还没有观看记录','开始播放后,这里会显示最近的真实观看证据。')}</div>`;
+ `<div class="insightempty">${emptyStateHtml('history','还没有观看记录','开始播放后,这里会显示最近的真实观看证据。',{actions:'<a class="geist-button" href="/">浏览馆藏</a>'})}</div>`;
const sourceTable=d.tag_source.length?`<div class="board-source-list">${d.tag_source.map(row=>`<article><header><h3>${esc(row.k)}</h3><b>${row.assets.toLocaleString()} <small>个视频</small></b></header>
${progressHtml(`${row.k} 覆盖视频`,row.assets,a.videos)}<small>${row.n.toLocaleString()} 条标签</small></article>`).join('')}</div>`:
- `<div class="insightempty">${emptyStateHtml('tags','还没有标签来源','刮削或手动打标之后,这里会显示每个来源覆盖了多少视频。')}</div>`;
+ `<div class="insightempty">${emptyStateHtml('tags','还没有标签来源','刮削或手动打标之后,这里会显示每个来源覆盖了多少视频。',{actions:'<a class="geist-button" href="/data-cleanup">补全资料</a>'})}</div>`;
const storageTable=(d.storage_volumes||[]).length?`<div class="board-volume-list">${(d.storage_volumes||[]).map(row=>{
const measured=row.total!=null, usedPct=measured?pct(row.used,row.total):0;
return `<article><header><h3>${esc(row.label)}</h3><b>${measured?usedPct+'%':(row.online===false?'离线':'容量未取得')}</b></header><small>${row.root?esc(row.root):'未映射'}</small>
${measured?progressHtml(`${row.label}空间使用率`,row.used,row.total)+`<div class="board-volume-values"><span>已用 <b>${gb(row.used)}</b></span><span>可用 <b>${gb(row.free)}</b></span></div>`:''}</article>`}).join('')}</div>`
- :emptyStateHtml('hard-drive','还没有存储来源','添加媒体文件夹后,这里会显示存储空间。');
+ :emptyStateHtml('hard-drive','还没有存储来源','添加媒体文件夹后,这里会显示存储空间。',{actions:'<button class="geist-button" data-empty-settings>添加媒体文件夹</button>'});
$('#stats').innerHTML=`
<div class="insightpage statsdashboard" data-stats-dashboard>
<header class="insighttoolbar"><p>账本当前快照 · ${totalVideos.toLocaleString()} 个视频 · ${gb(totalBytes)}</p></header>
@@ -5409,7 +5409,7 @@ function localTime(iso){
function localTimeHtml(iso){
const text=localTime(iso);
return /^\d{4}-/.test(text)
- ? `<i class="fyear">${esc(text.slice(0,5))}</i>${esc(text.slice(5))}`
+ ? `<i class="fyear">${esc(text.slice(0,5))}</i>${esc(text.slice(5,10))}<span class="fclock">${esc(text.slice(10))}</span>`
: esc(text);
}
@@ -6141,7 +6141,7 @@ function renderFollow(){
return followCard(group,siblings)}).join('')
:groups.length?emptyState('search-x','当前筛选下没有更新','切换媒体类型、创作者、来源或标签后再试。')
:sources.length?emptyState('rss','没有符合条件的更新','切换状态或来源筛选后再试。')
- :emptyState('rss','还没有关注任何来源','添加创作者或订阅来源后,更新会集中显示在这里。',{actions:'<button class="fbtn primary" data-follow-manage>添加关注</button>'})}</div>
+ :emptyState('rss','还没有关注任何来源','添加创作者或订阅来源后,更新会集中显示在这里。',{actions:'<a class="geist-button primary" href="/follow-manage?tab=add">添加关注</a>'})}</div>
${followData.has_more||sources.some(source=>source.can_backfill)?`<div class="followpagination">
${followData.has_more?`<span class="followpageaction"><button class="fbtn" data-follow-more>${icon('chevron-down')}加载更多</button></span>`:''}
${sources.some(source=>source.can_backfill)?`<span class="followpageaction"><button class="fbtn" data-follow-older>${icon('history')}抓更早的一页</button>
@@ -6548,7 +6548,7 @@ function followAuthorBlock(group){
group.map(source=>sourceIcon(source.provider)).join('')
}<span class="sr-only">来源:${esc(providers)}</span></span>
${bad?`<span class="fmeta warn">${bad} 个失败</span>`:''}
- <span class="board-author-actions"><button type="button" class="fbtn small" data-follow-author-select aria-pressed="false" aria-label="全选 ${esc(name)} 的来源">全选</button><button type="button" class="frowicon board-author-toggle" data-follow-author-toggle="${esc(key)}" aria-controls="follow-author-${group[0].id}" aria-expanded="${!collapsed}" aria-label="${collapsed?'展开':'收起'} ${esc(name)} 的来源">${icon('chevron-down')}</button></span>
+ <span class="board-author-actions"><button type="button" class="fbtn small" data-follow-author-select data-follow-author-name="${esc(name)}" aria-pressed="false" title="全选 ${esc(name)} 的来源" aria-label="全选 ${esc(name)} 的来源">${icon('check-check')}<span data-author-select-label>全选</span></button><button type="button" class="frowicon board-author-toggle" data-follow-author-toggle="${esc(key)}" aria-controls="follow-author-${group[0].id}" aria-expanded="${!collapsed}" aria-label="${collapsed?'展开':'收起'} ${esc(name)} 的来源">${icon('chevron-down')}</button></span>
</summary>
${sources}</details>`;
}
@@ -6575,7 +6575,7 @@ function followSourceCells(source,selectable=false){
const provider=(extra='',withText=false)=>`<span class="fmeta fprovider${
withText?'':' iconly'}" title="${esc(source.provider_label)}">${sourceIcon(source.provider)
}<span>${esc(source.provider_label)}</span>${extra}</span>`;
- const checked=`<span class="fmeta fchecked">${source.last_checked_at?localTimeHtml(source.last_checked_at):'未检查'}</span>`;
+ const checked=`<span class="fmeta fchecked" tabindex="0" title="${esc(source.last_checked_at?localTime(source.last_checked_at):'未检查')}" aria-label="上次检查:${esc(source.last_checked_at?localTime(source.last_checked_at):'未检查')}">${source.last_checked_at?localTimeHtml(source.last_checked_at):'未检查'}</span>`;
const actions=`<span class="fsourceactions">
<button class="frowicon" data-follow-check="${source.id}" title="检查更新"
${source.enabled?'':'disabled'}
@@ -6600,8 +6600,7 @@ function followSourceRow(source,selectable=false){
/* 表格视图照 boardui.com/components/data-table(取证见 docs/BOARD_UI.md):一行一条来源,
创作者列每行都写,表头两列能点,点的是工具栏里已有的那两种排序。它有而这里不要的三样:
- 页码——列表本来就是全量;表尾的密度档——视图开关自己就是;表头里的全选——全选连着
- 批量动作留在上面那条选择栏,两个全选框会互相打架。排序方向沿用工具栏那对箭头字形。
+ 表尾密度由视图开关承担,表头全选归上方的本页选择栏。排序方向沿用工具栏那对箭头字形。
五列都能点:创作者、上次检查按创作者分组比,来源、站点、状态按单条来源比,此时表格按
那一列拉平排,不再按创作者聚在一起。 */
const FOLLOW_TABLE_SORT={author:'name',source:'source',provider:'provider',status:'status',checked:'checked'};
@@ -6610,14 +6609,15 @@ function followTableHeader(key,label){
const ascending=active&&followManageDir==='asc';
return `<th scope="col" aria-sort="${active?(ascending?'ascending':'descending'):'none'}"><button type="button" class="ftsort" data-follow-table-sort="${sort}" aria-label="按${label}排序">${label}${icon(ascending?'arrow-up':'arrow-down')}</button></th>`;
}
-function followSourceTable(groups,selectable){
+function followSourceTable(groups,selectable,page=1,perPage=Infinity){
const pairs=groups.flatMap(group=>group.map(source=>[source,group]));
const bySource=FOLLOW_SOURCE_SORTS[followManageSort];
if(bySource){
const flip=followManageDir===(FOLLOW_SORT_DEFAULT_DIR[followManageSort]||'desc')?1:-1;
pairs.sort(([a],[b])=>flip*bySource(a,b));
}
- const rows=pairs.map(([source,group])=>{
+ const visible=Number.isFinite(perPage)?pairs.slice((page-1)*perPage,page*perPage):pairs;
+ const rows=visible.map(([source,group])=>{
const name=followAuthorName(group);
const cell=followSourceCells(source,selectable);
return `<tr class="${cell.className}">
@@ -6641,6 +6641,7 @@ function followSourceTable(groups,selectable){
function followAliasManager(groups,suggestions){
groups=groups||[];suggestions=suggestions||[];
const detected=suggestions.map(item=>`<tr>
+ <td class="faliascheck"><label>${checkboxHtml(`data-follow-alias-select aria-label="选择别名 ${esc(item.alias)},归入 ${esc(item.canonical)}"`)}</label></td>
<td><b>${esc(item.canonical)}</b></td><td>${esc(item.alias)}</td>
<td class="faliasevidence">${esc(item.evidence)}</td>
<td><button class="fbtn small" data-follow-alias-add
@@ -6661,8 +6662,8 @@ function followAliasManager(groups,suggestions){
<input class="geist-input" name="alias" required placeholder="平台别名" aria-label="平台别名">
<button class="fbtn" type="submit">保存别名</button>
</form>
- ${detected?`<div class="faliasheading"><h4>待合并</h4><button type="button" class="fbtn" data-follow-alias-all>全部合并(${suggestions.length})</button></div>
- <div class="ftableframe"><div class="ftablewrap"><table class="ftable faliastable" aria-label="待合并创作者别名"><thead><tr><th scope="col">规范创作者</th><th scope="col">平台别名</th><th scope="col">依据</th><th scope="col">操作</th></tr></thead><tbody>${detected}</tbody></table></div></div>`:''}
+ ${detected?`<div class="faliasheading"><h4>待合并</h4><div class="faliasactions"><button type="button" class="fbtn" data-follow-alias-selected disabled>合并所选(0)</button><button type="button" class="fbtn" data-follow-alias-all>全部合并(${suggestions.length})</button></div></div>
+ <div class="ftableframe"><div class="ftablewrap"><table class="ftable faliastable" aria-label="待合并创作者别名"><thead><tr><th scope="col" class="faliascheck"><label>${checkboxHtml('data-follow-alias-select-all aria-label="全选待合并别名"')}</label></th><th scope="col">规范创作者</th><th scope="col">平台别名</th><th scope="col">依据</th><th scope="col">操作</th></tr></thead><tbody>${detected}</tbody></table></div></div>`:''}
<div class="faliasheading"><h4>已保存别名</h4><span>${groups.length} 组</span></div>
${saved?`<div class="ftableframe"><div class="ftablewrap"><table class="ftable faliastable faliassaved" aria-label="已保存创作者别名"><thead><tr><th scope="col">规范创作者</th><th scope="col">平台别名</th></tr></thead><tbody>${saved}</tbody></table></div></div>`:emptyState('users','还没有保存创作者别名','填写规范创作者名和平台别名以添加。',{className:'compact'})}
</details>`;
@@ -6723,6 +6724,9 @@ function followCredentialRow(row){
/* 关注列表的两种视图共用同一份来源集合、创作者顺序和勾选:默认视图按创作者分卡,
表格视图一行一条来源。 */
const FOLLOW_LAYOUTS=[['default','默认视图','layout-grid'],['table','表格视图','table']];
+const FOLLOW_PAGE_SIZES=[10,20,50,100];
+let followManagePage=1;
+function followPageSize(){return allowedSetting(Number(appSettings.followPageSize),FOLLOW_PAGE_SIZES,20)}
function followListLayout(){
return allowedSetting(appSettings.followLayout,FOLLOW_LAYOUTS.map(([k])=>k),'default');
}
@@ -6731,6 +6735,7 @@ function followLayoutButtons(){
{attr:'data-follow-layout'});
}
function setFollowListLayout(value){
+ followManagePage=1;
appSettings.followLayout=value;
saveSettings();
// 两种视图的 DOM 不同,但换的只有列表本身:只重画 `.fsources`,页头那枚开关留在原地,
@@ -6738,13 +6743,24 @@ function setFollowListLayout(value){
// followSourceSelection 里,收起的创作者记在 collapsedFollowAuthors 里,重画后都还在。
const list=document.querySelector('#stats .fsources');
if(!list){renderFollowManage(followCredentials||{});return}
- list.dataset.layout=value;
- list.innerHTML=followSourceListHtml(followAuthorGroups(followData.sources||[]));
- wireFollowManage(followCredentials?.providers||[]);
+ refreshFollowSourcePage();
}
function followSourceListHtml(groups){
- return followListLayout()==='table'?followSourceTable(groups,true)
- :`<div class="board-follow-list">${groups.map(followAuthorBlock).join('')}</div>`;
+ const table=followListLayout()==='table',size=followPageSize();
+ const total=table?groups.reduce((sum,group)=>sum+group.length,0):groups.length;
+ const pages=pageCount(total,size);followManagePage=clampPage(followManagePage,pages);
+ const start=(followManagePage-1)*size,end=Math.min(start+size,total);
+ const content=table?followSourceTable(groups,true,followManagePage,size)
+ :`<div class="board-follow-list">${groups.slice(start,end).map(followAuthorBlock).join('')}</div>`;
+ return content+(total?`<div class="followpagefooter"><div class="followpageinfo"><span>${start+1}–${end} / ${total} ${table?'个来源':'位创作者'}</span><div>${selectFieldHtml(FOLLOW_PAGE_SIZES.map(value=>[String(value),`每页 ${value} ${table?'条':'位'}`]),String(size),{label:'每页显示数量',attr:'data-follow-page-size'})}</div></div>${paginationHtml(followManagePage,pages,'关注列表分页')}</div>`:'');
+}
+function refreshFollowSourcePage(){
+ const list=document.querySelector('#stats .fsources');if(!list)return;
+ list.dataset.layout=followListLayout();
+ list.innerHTML=followSourceListHtml(followAuthorGroups(followData.sources||[]));
+ const params=new URLSearchParams(location.search);params.set('page',String(followManagePage));
+ route('/follow-manage?'+params);
+ wireFollowManage(followCredentials?.providers||[],true);
}
/* 版式判据来自 docs/reference-sources.json 的 vercel-report-design:
@@ -6752,9 +6768,20 @@ function followSourceListHtml(groups){
细小灰字加随意字号。所以这里不再用嵌套卡片盒子——分组靠标题和一条发丝分隔线,
行与行之间也只用分隔线,不各自套框。控件尺寸按实测 Geist:32px 高、6px 圆角、14px。 */
let followManageWorkspace='list';
+document.addEventListener('click',event=>{
+ if(event.target.closest?.('[data-empty-settings]')){openSettings(true,'媒体');return}
+ const link=event.target.closest?.('a[href="/follow-manage?tab=add"]');
+ if(!link||event.defaultPrevented||event.button||event.metaKey||event.ctrlKey||event.shiftKey||event.altKey)return;
+ event.preventDefault();
+ const tab=location.pathname==='/follow-manage'&&document.querySelector('[data-follow-workspace="add"]');
+ if(tab){tab.click();tab.focus()}
+ else void openFollowManage(true,'add');
+});
function renderFollowManage(credentials){
const workspace=followManageWorkspace;
const sources=followData.sources||[],counts=followData.counts||{};
+ const availableIds=new Set(sources.map(source=>source.id));
+ for(const id of followSourceSelection)if(!availableIds.has(id))followSourceSelection.delete(id);
const groups=followAuthorGroups(sources);
const sourceList=followSourceListHtml(groups);
const broken=sources.filter(s=>s.last_status==='error'||s.last_status==='unauthorized');
@@ -6809,13 +6836,13 @@ function renderFollowManage(credentials){
<button class="fbtn" data-follow-check="" title="检查全部" aria-label="检查全部"${sources.length?'':' disabled'}>${
icon('refresh-cw')}<span data-collapse-label>检查全部</span></button></div>
${followCheckReport?followCheckFailNote(followCheckReport):''}
- ${sources.length?`<div class="board-follow-selection"><label>${checkboxHtml('data-follow-select-all aria-label="全选来源"')}全选</label><span data-follow-selected-count>已选 0</span><button class="fbtn" data-follow-check="" data-follow-sources="" data-follow-selection-action disabled>检查所选</button><button class="fbtn" data-follow-selection-enabled="true" data-follow-selection-action disabled>启用</button><button class="fbtn" data-follow-selection-enabled="false" data-follow-selection-action disabled>暂停</button><button class="fbtn danger" data-follow-selection-remove data-follow-selection-action disabled>删除</button></div>`:''}
+ ${sources.length?`<div class="board-follow-selection"><label>${checkboxHtml('data-follow-select-all aria-label="全选本页来源"')}全选本页</label><button class="fbtn" type="button" data-follow-collapse-all>全部收起</button></div><div class="selectiondock followselectiondock" role="group" aria-label="关注来源批量操作" hidden><span class="selectiondockcount" data-follow-selected-count role="status">已选 0</span><button class="geist-button" data-follow-check="" data-follow-sources="" data-follow-selection-action disabled>检查所选</button><button class="geist-button" data-follow-selection-enabled="true" data-follow-selection-action disabled>启用</button><button class="geist-button" data-follow-selection-enabled="false" data-follow-selection-action disabled>暂停</button><button class="geist-button danger" data-follow-selection-remove data-follow-selection-action disabled>删除</button><button class="geist-button" data-follow-selection-clear>取消选择</button></div>`:''}
${sources.length?`<div class="frows fsources" data-layout="${followListLayout()}">${sourceList}</div>
${counts.new?`<div class="fsecfoot"><p class="fnote fbulkrow"><span class="fbulkcounts">未看 ${counts.new} · 已看 ${counts.seen||0}
· 已保存 ${counts.saved||0} · 已忽略 ${counts.ignored||0}</span>
<span class="fbulk"><button class="fbtn" data-follow-bulk="seen">全部标记已看</button>
<button class="fbtn" data-follow-bulk="ignored">全部忽略</button></span></p></div>`:''}`
- :emptyState('rss','还没有关注来源','关注来源及其检查状态会显示在这里。',{className:'compact'})}
+ :emptyState('rss','还没有关注来源','关注来源及其检查状态会显示在这里。',{className:'compact',actions:'<a class="geist-button primary" href="/follow-manage?tab=add">添加关注</a>'})}
</section>
<section class="fsec" data-follow-workspace-panel="source">
<div class="fsechead"><h3>来源和凭证</h3>
@@ -6830,7 +6857,13 @@ function renderFollowManage(credentials){
</div></div>`;
wireFollowManage(creds);
const tabs=[...$('#stats').querySelectorAll('[data-follow-workspace]')],panels=[...$('#stats').querySelectorAll('[data-follow-workspace-panel]')];
- tabs.forEach(tab=>tab.onclick=()=>{const key=tab.dataset.followWorkspace;followManageWorkspace=key;tabs.forEach(t=>t.setAttribute('aria-selected',String(t===tab)));panels.forEach(panel=>panel.hidden=panel.dataset.followWorkspacePanel!==key)});
+ tabs.forEach(tab=>tab.onclick=()=>{
+ const key=tab.dataset.followWorkspace;followManageWorkspace=key;
+ const params=new URLSearchParams(location.search);params.set('tab',key);
+ route('/follow-manage?'+params);
+ tabs.forEach(t=>t.setAttribute('aria-selected',String(t===tab)));
+ panels.forEach(panel=>panel.hidden=panel.dataset.followWorkspacePanel!==key);
+ });
tabs.forEach(tab=>tab.setAttribute('aria-selected',String(tab.dataset.followWorkspace===workspace)));
panels.forEach(panel=>panel.hidden=panel.dataset.followWorkspacePanel!==workspace);
void wireFollowProgress();
@@ -6838,6 +6871,7 @@ function renderFollowManage(credentials){
'#followAdd input,#followAdd button,[data-follow-remove],[data-follow-check],'+
'[data-follow-enabled],[data-follow-selection-enabled],[data-follow-selection-remove],'+
'[data-follow-bulk],[data-follow-guess],[data-follow-alias-add],[data-follow-alias-all],'+
+ '[data-follow-alias-selected],[data-follow-alias-select],[data-follow-alias-select-all],'+
'[data-follow-alias-remove],#followAliasAdd input,#followAliasAdd button,[data-cred-form] input,'+
'[data-cred-form] button,[data-cred-clear]'
).forEach(control=>{control.disabled=true});
@@ -6847,7 +6881,9 @@ function renderFollowManage(credentials){
/* 排序落在地址栏上,返回同一页还是同一个顺序。方向等于该列默认值时不写进地址,
免得地址栏挂一个和默认完全一样的参数。 */
function routeFollowManageSort(){
- const params=new URLSearchParams();
+ followManagePage=1;
+ const params=new URLSearchParams(location.search);params.delete('sort');params.delete('dir');params.set('page','1');
+ params.set('tab',followManageWorkspace);
if(followManageSort!=='checked')params.set('sort',followManageSort);
if(followManageDir!==(FOLLOW_SORT_DEFAULT_DIR[followManageSort]||'desc'))params.set('dir',followManageDir);
const query=params.toString();
@@ -6857,11 +6893,14 @@ function routeFollowManageSort(){
// 关注列表。直接重画,页面不闪、位置不动。
renderFollowManage(followCredentials||{});
}
-async function openFollowManage(push=true){
+async function openFollowManage(push=true,workspace='list'){
+ if(push)followManagePage=1;
releaseHoverPreviews();disposeStage(false);enterManagementSurface();
- if(push){followManageSort='checked';followManageDir='desc';route('/follow-manage')}
+ if(push){followManageWorkspace=workspace;followManageSort='checked';followManageDir='desc';route('/follow-manage'+(workspace==='list'?'':'?tab='+workspace))}
else if(location.pathname==='/follow-manage'){
const params=new URLSearchParams(location.search),requested=params.get('sort');
+ followManagePage=Math.max(1,Math.floor(Number(params.get('page')))||1);
+ followManageWorkspace=['list','add','source'].includes(params.get('tab'))?params.get('tab'):'list';
followManageSort=FOLLOW_SORT_OPTIONS.some(([key])=>key===requested)?requested:'checked';
const requestedDir=params.get('dir');
followManageDir=requestedDir==='asc'||requestedDir==='desc'?requestedDir
@@ -6909,28 +6948,62 @@ function wireFollowItems(){
});
}
-function wireFollowManage(creds=[]){
- void wireResolveProgress();
- const root=$('#stats'),form=root.querySelector('#followAdd');
+function wireFollowManage(creds=[],listOnly=false){
+ if(!listOnly)void wireResolveProgress();
+ const root=$('#stats'),form=listOnly?null:root.querySelector('#followAdd');
wireCollapse(root,'details.fauthor','follow-author-collapse','[data-follow-author-toggle]');
+ const allKeys=()=>followAuthorGroups(followData.sources||[]).map(group=>String(group[0].author_key||group[0].id));
+ const collapseAll=root.querySelector('[data-follow-collapse-all]');
+ const syncCollapseAll=()=>{if(collapseAll){collapseAll.hidden=followListLayout()==='table';collapseAll.textContent=allKeys().every(key=>collapsedFollowAuthors.has(key))?'全部展开':'全部收起'}};
+ if(collapseAll)collapseAll.onclick=()=>{
+ const keys=allKeys(),collapse=!keys.every(key=>collapsedFollowAuthors.has(key));
+ keys.forEach(key=>collapse?collapsedFollowAuthors.add(key):collapsedFollowAuthors.delete(key));
+ root.querySelectorAll('[data-follow-author-toggle]').forEach(button=>{if((button.getAttribute('aria-expanded')==='true')===collapse)button.click()});
+ syncCollapseAll();
+ };
root.querySelectorAll('[data-follow-author-toggle]').forEach(button=>button.onclick=event=>{
event.stopPropagation();
const expanded=button.getAttribute('aria-expanded')==='true';
button.setAttribute('aria-label',button.getAttribute('aria-label').replace(/^(展开|收起)/,expanded?'收起':'展开'));
if(expanded)collapsedFollowAuthors.delete(button.dataset.followAuthorToggle);else collapsedFollowAuthors.add(button.dataset.followAuthorToggle);
+ syncCollapseAll();
+ });
+ root.querySelectorAll('details.fauthor').forEach(detail=>detail.addEventListener('toggle',()=>{
+ if(!detail.isConnected)return;
+ const key=detail.querySelector('[data-follow-author-toggle]').dataset.followAuthorToggle;
+ if(detail.open)collapsedFollowAuthors.delete(key);else collapsedFollowAuthors.add(key);
+ syncCollapseAll();
+ }));
+ syncCollapseAll();
+ root.querySelectorAll('.followpagefooter [data-page]').forEach(button=>button.onclick=()=>{
+ followManagePage=Number(button.dataset.page);refreshFollowSourcePage();
+ root.querySelector('.board-page[aria-current="page"]')?.focus({preventScroll:true});
+ root.querySelector('[data-follow-workspace-panel="list"]')?.scrollIntoView({block:'start'});
+ });
+ const pageSizeField=root.querySelector('[data-follow-page-size]');
+ if(pageSizeField)wireSelectField(pageSizeField).addEventListener('change',()=>{
+ const value=Number(pageSizeField.value);if(!FOLLOW_PAGE_SIZES.includes(value))return;
+ appSettings.followPageSize=value;saveSettings();followManagePage=1;refreshFollowSourcePage();
+ root.querySelector('[data-follow-page-size] button')?.focus({preventScroll:true});
});
const selectable=[...root.querySelectorAll('[data-follow-select]')];
- const selectedIds=()=>selectable.filter(field=>field.checked).map(field=>Number(field.dataset.followSelect));
+ const selectedIds=()=>(followData.sources||[]).filter(source=>followSourceSelection.has(source.id)).map(source=>source.id);
const syncSelection=()=>{
const ids=selectedIds(),count=root.querySelector('[data-follow-selected-count]');
const all=root.querySelector('[data-follow-select-all]');
- syncSelectionToolbar({count,label:`已选 ${ids.length}`,all,summary:selectionSummary(new Set(ids),selectable.map(field=>Number(field.dataset.followSelect))),
+ const summary=selectionSummary(followSourceSelection,selectable.map(field=>Number(field.dataset.followSelect)));
+ syncSelectionToolbar({count,label:`已选 ${ids.length} 个来源`,all,summary:{...summary,count:ids.length},
actions:root.querySelectorAll('[data-follow-selection-action]'),locked:!!followRuntime?.ledger_read_only});
+ const dock=root.querySelector('.followselectiondock');if(dock)dock.hidden=!ids.length;
root.querySelectorAll('[data-follow-selection-action][data-follow-check]').forEach(button=>{button.dataset.followSources=ids.join(',')});
selectable.forEach(field=>field.closest('.fsource').classList.toggle('selected',field.checked));
root.querySelectorAll('[data-follow-author-select]').forEach(button=>{
const fields=[...button.closest('.fauthor').querySelectorAll('[data-follow-select]')],count=fields.filter(field=>field.checked).length;
- button.textContent=count===fields.length?'取消全选':'全选';button.setAttribute('aria-pressed',count===fields.length?'true':count?'mixed':'false');
+ const label=count===fields.length?'取消全选':'全选';
+ button.querySelector('[data-author-select-label]').textContent=label;
+ button.title=`${label} ${button.dataset.followAuthorName} 的来源`;
+ button.setAttribute('aria-label',button.title);
+ button.setAttribute('aria-pressed',count===fields.length?'true':count?'mixed':'false');
});
};
selectable.forEach(field=>field.onchange=()=>{const id=Number(field.dataset.followSelect);if(field.checked)followSourceSelection.add(id);else followSourceSelection.delete(id);syncSelection()});
@@ -6945,6 +7018,8 @@ function wireFollowManage(creds=[]){
fields.forEach(field=>{field.checked=checked});syncSelection();
});
const selectAll=root.querySelector('[data-follow-select-all]');
+ const clearSelection=root.querySelector('[data-follow-selection-clear]');
+ if(clearSelection)clearSelection.onclick=()=>{followSourceSelection.clear();selectable.forEach(field=>{field.checked=false});syncSelection();selectAll?.focus({preventScroll:true})};
if(selectAll)selectAll.onchange=()=>{selectGroup(followSourceSelection,selectable.map(field=>Number(field.dataset.followSelect)),selectAll.checked);selectable.forEach(field=>{field.checked=selectAll.checked});syncSelection()};
root.querySelectorAll('[data-follow-selection-enabled]').forEach(button=>button.onclick=async()=>{
const ids=selectedIds(),enabled=button.dataset.followSelectionEnabled==='true';if(!ids.length)return;
@@ -6969,7 +7044,7 @@ function wireFollowManage(creds=[]){
}});
};
wireScrollers(root);
- const sortField=root.querySelector('[data-follow-sort]');
+ const sortField=listOnly?null:root.querySelector('[data-follow-sort]');
if(sortField)wireSelectField(sortField).addEventListener('change',()=>{
followManageSort=sortField.value;
followManageDir=FOLLOW_SORT_DEFAULT_DIR[followManageSort]||'desc';
@@ -6988,8 +7063,8 @@ function wireFollowManage(creds=[]){
routeFollowManageSort();
});
wireIconSwitch(root,'data-follow-layout',setFollowListLayout);
- renderFollowSrcFilter(root.querySelector('#followSrcFilter'),creds);
- const tooltipTrigger=root.querySelector('[data-fdesc-tooltip]');
+ if(!listOnly)renderFollowSrcFilter(root.querySelector('#followSrcFilter'),creds);
+ const tooltipTrigger=listOnly?null:root.querySelector('[data-fdesc-tooltip]');
const tooltip=root.querySelector('#follow-credential-tooltip');
if(tooltipTrigger&&tooltip)wireContextCard(tooltipTrigger.closest('.fdesc'),tooltipTrigger,tooltip);
/* 创作者别名和凭据行都走 Geist Collapse,两处同一份实现。凭据行的 `details.fcred`
@@ -7142,24 +7217,41 @@ function wireFollowManage(creds=[]){
}catch(error){setActionBusy(button,false);actionFailure('合并创作者别名',error)}
};
const mergeAll=root.querySelector('[data-follow-alias-all]');
- if(mergeAll)mergeAll.onclick=()=>{
- const pending=[...root.querySelectorAll('[data-follow-alias-add]')].map(button=>({
+ const mergeSelected=root.querySelector('[data-follow-alias-selected]');
+ const aliasSelectAll=root.querySelector('[data-follow-alias-select-all]');
+ const aliasFields=()=>[...root.querySelectorAll('[data-follow-alias-select]')];
+ const syncAliasSelection=()=>{
+ const fields=aliasFields(),count=fields.filter(field=>field.checked).length;
+ fields.forEach(field=>field.closest('tr').classList.toggle('selected',field.checked));
+ if(aliasSelectAll){aliasSelectAll.checked=fields.length>0&&count===fields.length;aliasSelectAll.indeterminate=count>0&&count<fields.length}
+ if(mergeSelected){mergeSelected.disabled=count===0;mergeSelected.textContent=`合并所选(${count})`}
+ if(mergeAll){mergeAll.disabled=fields.length===0;mergeAll.textContent=`全部合并(${fields.length})`}
+ };
+ aliasFields().forEach(field=>field.onchange=syncAliasSelection);
+ if(aliasSelectAll)aliasSelectAll.onchange=()=>{aliasFields().forEach(field=>{field.checked=aliasSelectAll.checked});syncAliasSelection()};
+ const mergeAliases=(trigger,selectedOnly)=>{
+ const pending=[...root.querySelectorAll('[data-follow-alias-add]')]
+ .filter(button=>!selectedOnly||button.closest('tr').querySelector('[data-follow-alias-select]').checked).map(button=>({
canonical:button.dataset.canonical,alias:button.dataset.alias,button}));
- return confirmModal({title:'合并全部创作者别名',
+ if(!pending.length)return;
+ return confirmModal({title:selectedOnly?'合并所选创作者别名':'合并全部创作者别名',
body:`将合并以下 ${pending.length} 组创作者:${pending.map(item=>`「${item.alias}」归入「${item.canonical}」`).join(';')}。`,
- confirmLabel:'合并全部别名',onConfirm:async()=>{
- setActionBusy(mergeAll);
+ confirmLabel:selectedOnly?'合并所选别名':'合并全部别名',onConfirm:async()=>{
+ setActionBusy(trigger);
try{
while(pending.length){
const item=pending[0];
await api('/api/follow/author-alias',{method:'POST',body:JSON.stringify({action:'add',canonical:item.canonical,alias:item.alias})});
- pending.shift();item.button.closest('tr')?.remove();
+ pending.shift();item.button.closest('tr')?.remove();syncAliasSelection();
}
- await openFollowManage(false);actionReceipt('已合并全部创作者别名');
+ await openFollowManage(false);actionReceipt(selectedOnly?'已合并所选创作者别名':'已合并全部创作者别名');
}catch(error){throw new Error(`还有 ${pending.length} 组未合并:${error.message}`)}
- finally{setActionBusy(mergeAll,false)}
+ finally{setActionBusy(trigger,false)}
}});
};
+ if(mergeAll)mergeAll.onclick=()=>mergeAliases(mergeAll,false);
+ if(mergeSelected)mergeSelected.onclick=()=>mergeAliases(mergeSelected,true);
+ syncAliasSelection();
root.querySelectorAll('[data-follow-alias-add]').forEach(button=>button.onclick=()=>
saveAuthorAlias(button.dataset.canonical,button.dataset.alias,button));
const aliasForm=root.querySelector('#followAliasAdd');
diff --git a/web/board.css b/web/board.css
index 38a773bf3..d95dadd0e 100644
--- a/web/board.css
+++ b/web/board.css
@@ -984,8 +984,7 @@ html.board-high-contrast .settingscard.settingscard>.board-local-nav{background:
#linkCheckResult:not(:empty),#resourceSyncResult:not(:empty){margin-block:16px 28px}
.followmanage .fauthor{container-type:inline-size}
.board-follow-list{display:grid;border-radius:16px;background:var(--ground);padding:8px 16px}.board-follow-list .fsource.frow{display:grid;grid-template-columns:22px minmax(0,1fr) auto auto auto auto;gap:12px;padding:8px;min-height:48px;border:0;border-radius:8px}.board-follow-list .fsource.frow>b{font-size:13px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:400}.board-follow-list .fsource.selected{background:var(--picked);opacity:1}.board-follow-selection{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:0 0 12px;font-size:13px}.board-follow-selection>label{display:flex;gap:8px;align-items:center}.board-follow-selection>span{margin-right:auto;color:var(--muted)}
-@media(max-width:760px){.board-follow-list{padding:8px}.board-follow-list .fsource.frow{grid-template-columns:20px minmax(0,1fr) auto;gap:4px 8px}.board-follow-list .fchannelcheck{grid-column:1;grid-row:1}.board-follow-list .fsource.frow>b{grid-column:2;grid-row:1}.board-follow-list .fprovider{grid-column:2;grid-row:2}.board-follow-list .fchecked{grid-column:2;grid-row:3}.board-follow-list .sbadge{grid-column:1;grid-row:2}.board-follow-list .fsourceactions{grid-column:3;grid-row:1/4}}
-@container(max-width:520px){.followmanage .fauthor .fsource.frow{grid-template-columns:22px minmax(0,1fr) auto;gap:6px 10px}.followmanage .fsource>.fchannelcheck{grid-column:1;grid-row:1}.followmanage .fauthor .fsource.frow>b{grid-column:2;grid-row:1;white-space:normal;overflow-wrap:anywhere}.followmanage .fsource>.fsourceactions{grid-column:3;grid-row:1/3}.followmanage .fsource>.fprovider{grid-column:2;grid-row:2}.followmanage .fsource>.fchecked{grid-column:2;grid-row:3}.followmanage .fsource>.sbadge{grid-column:1;grid-row:2}.followmanage .fsource>.frowerr{grid-column:1/-1}}
+@media(max-width:760px){.board-follow-list{padding:8px}}
@media(max-width:760px){body #manageTitle{width:100%}.board-watch-entry,.board-source-list,.tasteleads .insightpanelbody,.tasteranks,.tasteranks-tags,.tasteranks-visual,.tastesources .insightpanelbody>div{grid-template-columns:minmax(0,1fr)}.board-watch-entry{gap:8px}.tasteleads>header{padding:20px 16px 12px}.tasteleads .insightpanelbody{padding:8px 16px 20px}.followmanage .fmain>.fsec:has(.fcred)>.frows{grid-template-columns:minmax(0,1fr)}.followmanage .fauthor{padding:16px}.followmanage .fsechead{gap:8px}.followmanage .fmanagesort{margin-left:0}}
/* Board 的语义色与复合字阶;图表和业务状态独立于交互强调色。 */
@@ -1029,7 +1028,7 @@ body,.disp{font-family:var(--board-font);letter-spacing:0}body{font:var(--board-
.skeleton-radar{width:100%;height:260px;clip-path:polygon(50% 0,95% 25%,95% 75%,50% 100%,5% 75%,5% 25%)}
.board-page-skeleton .tastesummary{height:152px}
.board-page-skeleton .tastesummary>b .skeleton{height:34px}
-.board-page-skeleton .fmanageoverview b .skeleton{height:32px}
+.board-page-skeleton .fmanageoverview b .skeleton{height:34px}
.skeleton-segments>span{display:flex;align-items:center;padding:4px 10px;min-height:28px;border-radius:6px;color:var(--color-text-secondary);font:var(--board-body);white-space:nowrap}
.skeleton-segments>span.skeleton-segment-selected{color:var(--color-text-primary);font:var(--board-body-medium);background:var(--color-background-primary-default);box-shadow:0 1px 2px #0000000d}
.board-page-skeleton .configpage{display:grid;gap:40px}
@@ -1197,9 +1196,6 @@ body :is(.sbadge.ok,.board-chip.success){background:color-mix(in srgb,#84cc16 16
.followmanage .fpickactions .fbtn{height:36px;min-height:36px;padding:8px 12px}
.photolight .photonav{width:36px;height:36px;border:1px solid var(--color-border-button-default);border-radius:10px;background:var(--color-background-primary-default);color:var(--color-text-secondary);box-shadow:0 1px 2px #0000000d}.photolight .photonav:hover{background:var(--color-background-primary-hover)}.photolight .photonav svg{width:20px;height:20px}.photolight .photonav.swiper-button-disabled{opacity:.4;pointer-events:none}
.board-carousel-pagination{display:flex;align-items:center;justify-content:center;gap:8px;max-width:160px;margin-inline:auto;overflow:hidden;height:28px}.board-carousel-pagination .swiper-pagination-bullet{width:6px;height:6px;flex:none;margin:0!important;border:0;padding:0;border-radius:999px;background:#a3a3a3;opacity:1;transition:width .2s ease-out,background .2s ease-out}.board-carousel-pagination .swiper-pagination-bullet-active{width:16px;background:#fafafa}
-@media(max-width:760px){.followmanage .fsource.frow{grid-template-columns:20px minmax(0,1fr) auto}.board-follow-list .fprovider{grid-column:2;grid-row:2}.board-follow-list .fchecked{grid-column:2;grid-row:3}}
-@container(max-width:520px){.followmanage .fauthor .fsource.frow{grid-template-columns:20px minmax(0,1fr) auto}.followmanage .fauthor .fprovider{grid-column:2;grid-row:2}.followmanage .fauthor .fchecked{grid-column:2;grid-row:3}}
-@container(min-width:400px) and (max-width:520px){.followmanage .fauthor .fsource.frow{grid-template-columns:20px minmax(0,1fr) auto auto}.followmanage .fauthor .fsource.frow>b{grid-column:2/4}.followmanage .fauthor .fsource>.fprovider{grid-column:2;grid-row:2}.followmanage .fauthor .fsource>.fchecked{grid-column:3;grid-row:2;white-space:nowrap}.followmanage .fauthor .fsource>.fsourceactions{grid-column:4;grid-row:1/3}}
@media(prefers-reduced-motion:reduce){.board-tooltip,.board-carousel-pagination .swiper-pagination-bullet{transition:none}}
:root{--shadow-sm:0 1px 2px 0 rgb(0 0 0 / 0.06),0 1px 3px 0 rgb(0 0 0 / 0.10);--board-chart-0:#94e000;--board-chart-1:#3493ff;--board-chart-2:#bc74f9;--board-chart-3:#f657bd;--board-chart-4:#ffc600;--board-chart-5:#2dcbb8}
.fauthorhead{list-style:none}.fauthorhead::-webkit-details-marker{display:none}.board-author-actions{display:flex;align-items:center;gap:8px;margin-left:auto;flex:none}
@@ -1243,7 +1239,7 @@ body .gselectmenu [role=option][aria-selected=true],body .popmenu [aria-checked=
.board-activity-empty{margin:20px 0}.board-activity-empty>h3{margin:0;font:var(--board-heading)}.board-activity-empty>p{margin:8px 0 0;color:var(--muted);font:var(--board-body)}.board-heat-card header{display:grid;grid-template-columns:1fr auto;gap:8px;margin-bottom:24px}.board-heat-card h3{margin:0;font:var(--board-heading)}.board-heat-card header b{grid-row:2;font:var(--board-title);font-variant-numeric:tabular-nums}.board-heat-card header span{grid-column:2;grid-row:2;align-self:end;color:var(--muted);font:var(--board-caption)}.board-heat-scroll{overflow-x:auto;padding:3px}.board-hour-grid{display:grid;grid-template-columns:32px repeat(24,minmax(10px,1fr));gap:4px;min-width:360px}.board-heat-axis{font:var(--board-caption);color:var(--muted);align-self:center}.board-day-grid{display:grid;grid-auto-flow:column;grid-template-rows:repeat(7,1fr);grid-template-columns:repeat(13,1fr);gap:5px;padding:3px}
.board-heat-card [data-heat-value]{display:block;aspect-ratio:1;min-width:0;padding:0;border:0;border-radius:3px;background:color-mix(in srgb,#3493ff var(--heat),var(--color-background-tertiary-default));animation:board-heat-enter .4s ease-out both}.board-heat-card [data-heat-value]:is(:hover,:focus-visible){outline:2px solid var(--color-border-focus-ring);outline-offset:1px;filter:brightness(.9)}.board-heat-card footer{display:flex;justify-content:space-between;gap:8px;margin-top:16px;font:var(--board-caption);color:var(--muted)}@keyframes board-heat-enter{from{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}
@media(max-width:1000px){.board-inventory-charts,.board-activity-charts{grid-template-columns:1fr}.board-rings{height:260px}}
-@media(max-width:600px){.board-author-actions{width:100%;justify-content:flex-end}.followmanage .fauthorhead{flex-wrap:wrap}.board-radial-card,.board-heat-card{padding:16px}.board-radial-tiles>button{flex-basis:calc(50% - 8px)}}
+@media(max-width:600px){.board-radial-card,.board-heat-card{padding:16px}.board-radial-tiles>button{flex-basis:calc(50% - 8px)}}
@media(prefers-reduced-motion:reduce){.board-ring-value,.board-heat-card [data-heat-value]{animation:none;transition:none}.board-radial-tiles>button{transition:none}}
.board-state-preview{max-width:1180px;margin:0 auto;padding:28px 20px;color:var(--ink)}
/* 切换器展开时自己带一圈 2px 描边,导航列表首项又会抬起 hover 底:两者之间留 4px
@@ -1363,6 +1359,7 @@ html.board-high-contrast :is(.selectiondock,.reviewcontrols.is-stuck,.reviewgrou
.board-pagination{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;margin-top:16px}
.board-pagination>ul{display:flex;align-items:center;gap:2px;margin:0;padding:0;list-style:none}
body .review .board-pagination>.geist-button{height:32px;min-height:32px;padding:6px 8px;border-radius:8px}
+body .followmanage .board-pagination>.geist-button{height:32px;min-height:32px;padding:6px 8px;border-radius:8px}
.board-pagination>.geist-button svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.board-page,.board-page-dots{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;margin:0;padding:0;border:0;border-radius:8px;background:none;color:var(--color-text-secondary);font:var(--board-body-medium);font-variant-numeric:tabular-nums}
.board-page{cursor:pointer;transition:none}
@@ -1710,3 +1707,21 @@ body .batchbar button[hidden],body .batchbar button.danger[hidden]{display:none}
[data-fieldset-type=error]>:is(.geist-fieldset-footer,.resourceapplyrow)>p{color:var(--board-red-text)}
[data-fieldset-type=warning]>:is(.geist-fieldset-footer,.resourceapplyrow){border-top:1px solid var(--meter);background:color-mix(in srgb,var(--meter) 7%,var(--ground))}
[data-fieldset-type=warning]>:is(.geist-fieldset-footer,.resourceapplyrow)>p{color:var(--meter)}
+
+/* 关注来源始终单行,日期按创作者卡片的可用宽度逐级缩短。 */
+.followmanage .board-follow-list .fauthorhead{flex-wrap:nowrap}
+.followmanage .board-follow-list .fauthorhead>b{white-space:nowrap;text-overflow:ellipsis;min-width:0}
+.followmanage .board-follow-list .fauthorhead>.fmeta{overflow:hidden}
+.followmanage .board-follow-list .board-author-actions{width:auto;flex:none}
+.board-author-actions [data-follow-author-select]>svg{width:16px;height:16px;flex:none}
+@container(max-width:460px){.board-author-actions [data-author-select-label]{display:none}.followmanage .board-follow-list .board-author-actions [data-follow-author-select]{width:var(--control-h);height:var(--control-h);padding:0;justify-content:center}}
+.followmanage .board-follow-list .fauthor .fsource.frow{grid-template-columns:20px minmax(0,1fr) auto auto auto;gap:8px;align-items:center}
+.followmanage .board-follow-list .fsource.frow>b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
+.followmanage .board-follow-list .fprovider{flex-wrap:nowrap;white-space:nowrap}
+.followmanage .board-follow-list .fchecked{display:block;white-space:nowrap;font-variant-numeric:tabular-nums}
+.followmanage .board-follow-list .fchecked:focus-visible{outline:2px solid var(--tungsten);outline-offset:2px}
+@container(max-width:600px){.followmanage .board-follow-list .fchecked .fyear{display:none}}
+@container(max-width:460px){.followmanage .board-follow-list .fchecked .fclock{display:none}.followmanage .board-follow-list .fauthor .fsource.frow{gap:4px;padding-inline:8px}}
+.followmanage .skeleton-icon{width:32px;height:32px;display:block}
+.followmanage .fsource .skeleton{max-width:100%}
+.followmanage .favatar.skeleton{display:block}
diff --git a/web/css/19-immersive.css b/web/css/19-immersive.css
index 7c97b70a8..5aaf22fa5 100644
--- a/web/css/19-immersive.css
+++ b/web/css/19-immersive.css
@@ -80,7 +80,7 @@
.emptystate .es-copy{display:grid;justify-items:center;gap:8px}
.emptystate h3{margin:0;font-size:var(--fs-md);font-weight:600;color:var(--ink)}
.emptystate p{margin:0;max-width:340px;font-size:var(--fs-sm);line-height:1.55;color:var(--muted)}
-.emptystate .es-actions{display:flex;justify-content:center;gap:8px;margin-top:8px}
+.emptystate .es-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:8px}
.selectiondock{position:fixed;left:50%;bottom:max(22px,env(safe-area-inset-bottom));z-index:180;transform:translateX(-50%);display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:7px;width:max-content;max-width:calc(100vw - 24px);box-sizing:border-box;
padding:9px 11px;border:1px solid var(--line);border-radius:var(--floating-radius);background:var(--surface);
box-shadow:0 8px 24px #0005}.selectiondock[hidden]{display:none}
diff --git a/web/css/22-followmanage.css b/web/css/22-followmanage.css
index 02e030a91..29d746176 100644
--- a/web/css/22-followmanage.css
+++ b/web/css/22-followmanage.css
@@ -328,7 +328,18 @@ p.fnote .followtask{color:var(--ink-2)}
.faliasheading>span,.faliasevidence{color:var(--muted)}
.faliastable{width:100%;min-width:0;table-layout:fixed}
.faliastable th,.faliastable td{white-space:normal;overflow-wrap:anywhere}
-.faliastable th:last-child:nth-child(4){width:80px}
+.faliastable th:last-child:nth-child(5){width:80px}
+.faliastable:not(.faliassaved) th:nth-child(2),.faliastable:not(.faliassaved) th:nth-child(3){width:18%}
+.faliastable .faliascheck{width:40px;text-align:center}
+.faliastable tr.selected{background:var(--picked)}
+.faliasactions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
+.followpagefooter{margin-top:16px}
+.followmanage .ftablewrap{position:relative}
+.followpageinfo{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--muted)}
+.followpageinfo>div{flex:none}
+.followmanage:has(.followselectiondock:not([hidden])){padding-bottom:180px}
+.followmanage [data-follow-workspace-panel="list"]{scroll-margin-top:calc(var(--topH) + 16px)}
+@media(max-width:640px){.followpagefooter .board-pagination{flex-wrap:wrap}.followpagefooter .board-pagination>ul{order:3;justify-content:center;width:100%}.followpageinfo{font-size:var(--fs-sm)}}
.faliasidentity{display:flex;align-items:center;gap:10px;min-width:0}
.faliasidentity>.favatar{flex:none}
.faliastable .faliaschip{margin:3px 10px 3px 0;max-width:100%;overflow-wrap:anywhere}
diff --git a/web/dist/peach-ui.js b/web/dist/peach-ui.js
index a20db46b9..0cfda602d 100644
--- a/web/dist/peach-ui.js
+++ b/web/dist/peach-ui.js
@@ -4908,54 +4908,75 @@ function qi(e, t, n) {
}
//#endregion
//#region src/board-skeleton.ts
-var Q = (e = "60%") => `<span class="skeleton" style="width:${e}"></span>`, Ji = () => `${Q("80%")}${Q("48%")}`, $ = (e, t) => e.repeat(t), Yi = (e, t = "metricstrip") => `<div class="${t}">${e.map((e) => `<div class="tastesummary"><span class="board-stat-label">${e}</span><b class="board-stat-value">${Q("45%")}</b><small class="board-stat-footer">${Q("60%")}</small></div>`).join("")}</div>`, Xi = (e, t = "skeleton-tabs") => `<div class="${t}">${e.map((e) => `<span>${e}</span>`).join("")}</div>`, Zi = (e, t) => `<div class="${t} skeleton-segments" data-board-segments="true">${e.map((e, t) => `<span${t === 0 ? " class=\"skeleton-segment-selected\"" : ""}>${e}</span>`).join("")}</div>`, Qi = (e) => `<section class="board-radial-card"><header><span>${e}</span><b>${Q()}</b></header><div class="board-rings skeleton-rings"><span class="skeleton skeleton-ring"></span></div><div class="skeleton-lines">${Ji()}</div></section>`, $i = (e) => `<section class="insightpanel"><header>${e}</header><div class="insightpanelbody skeleton-lines">${$(Ji(), 3)}</div></section>`;
-function ea() {
+var Q = (e = "60%") => `<span class="skeleton" style="width:${e}"></span>`, Ji = () => `${Q("80%")}${Q("48%")}`, $ = (e, t) => e.repeat(t), Yi = (e, t = "metricstrip") => `<div class="${t}">${e.map((e) => `<div class="tastesummary"><span class="board-stat-label">${e}</span><b class="board-stat-value">${Q("45%")}</b><small class="board-stat-footer">${Q("60%")}</small></div>`).join("")}</div>`, Xi = (e, t = "skeleton-tabs") => `<div class="${t}">${e.map((e) => `<span>${e}</span>`).join("")}</div>`, Zi = (e, t) => `<div class="${t} skeleton-segments" data-board-segments="true">${e.map((e, t) => `<span${t === 0 ? " class=\"skeleton-segment-selected\"" : ""}>${e}</span>`).join("")}</div>`, Qi = (e) => `<section class="board-radial-card"><header><span>${e}</span><b>${Q()}</b></header><div class="board-rings skeleton-rings"><span class="skeleton skeleton-ring"></span></div><div class="skeleton-lines">${Ji()}</div></section>`, $i = (e) => `<section class="insightpanel"><header>${e}</header><div class="insightpanelbody skeleton-lines">${$(Ji(), 3)}</div></section>`, ea = (e) => `<button class="fbtn" type="button" disabled>${e}</button>`, ta = () => `<div class="fsechead" data-collapse-toolbar><h3>关注列表</h3><span class="fmeta">${Q("100px")}</span><span class="fmanagesort" data-collapse-field>${i("sort")}${y([["checked", "检查时间"]], "checked", {
+ label: "关注列表排序",
+ attr: "disabled"
+})}</span><button class="fbtn fmanagedir" disabled>${i("arrow-down")}</button><div class="iconswitch" data-board-segments="true"><label>${i("layout-grid")}</label><label>${i("table")}</label></div><button class="fbtn" disabled>${i("refresh-cw")}<span data-collapse-label>检查全部</span></button></div>`, na = () => `<div class="fsource frow"><span class="fchannelcheck">${Q("18px")}</span><b>${Q("85%")}</b><span class="fprovider">${Q("54px")}</span><span class="fmeta fchecked">${Q("40px")}</span><span class="fsourceactions"><span class="skeleton skeleton-icon"></span><span class="skeleton skeleton-icon"></span></span></div>`, ra = () => `<details class="fauthor" open><summary class="fauthorhead"><span class="favatar skeleton"></span><b>${Q("90px")}</b><span class="skeleton skeleton-icon"></span><span class="fmeta">${Q("40px")}</span><span class="board-author-actions"><button type="button" class="fbtn small" data-follow-author-select disabled>${i("check-check")}<span data-author-select-label>全选</span></button><span class="skeleton skeleton-icon"></span></span></summary><div class="fauthorsources">${$(na(), 3)}</div></details>`;
+function ia() {
return `<div data-skeleton="detail" role="status" aria-label="正在读取作品详情"><div class="sgrid" aria-hidden="true"><div class="vwrap skeleton-detail-media skeleton"></div><aside class="side"><div class="sidecontent skeleton-lines">${Q("85%")}${Q("65%")}${$(Ji(), 4)}</div></aside></div></div>`;
}
-function ta(e) {
- let t = "";
- if (e === "/stats") t = `<div class="insightpage statsdashboard"><header class="insighttoolbar">${Q("38%")}</header>${Yi([
+function aa(e, t = {}) {
+ let n = "";
+ if (e === "/stats") n = `<div class="insightpage statsdashboard"><header class="insighttoolbar">${Q("38%")}</header>${Yi([
"馆藏视频",
"看过",
"内容标签",
"使用空间"
])}<section class="insightdetail"><div class="insightdetailbody"><div class="board-inventory-charts">${Qi("网盘与本地")}${Qi("媒体库")}</div></div></section>${$i("内容标签")}</div>`;
- else if (e === "/taste") t = `<div class="tastepage"><header class="tastehead">${Zi(["浏览器记录", "Peach 内部"], "insightswitch")}${Q("24%")}</header><div class="tastestate"></div>${Yi([
+ else if (e === "/taste") n = `<div class="tastepage"><header class="tastehead">${Zi(["浏览器记录", "Peach 内部"], "insightswitch")}${Q("24%")}</header><div class="tastestate"></div>${Yi([
"浏览记录",
"口味维度",
"浏览候选",
"私有导出"
], "tastesummaries")}<section class="tastehero"><div class="insightcopy"><span>浏览器画像</span><div class="skeleton skeleton-radar"></div></div><div class="tastebars skeleton-lines">${$(Ji(), 4)}</div></section>${$i("口味分析")}<div class="board-activity-charts">${$i("浏览活动")}${$i("时间分布")}</div>${$i("标签")}</div>`;
- else if (e === "/follow-manage") t = `<div class="follow followmanage"><div class="fmanageoverview">${[
- "关注创作者",
- "启用来源",
- "检查失败",
- "未看更新"
- ].map((e) => `<div><span>${e}</span><b>${Q()}</b></div>`).join("")}</div>${Zi([
- "关注列表",
- "添加关注",
- "来源和凭证"
- ], "follow-workspace-switch")}<div class="fmain"><section class="fsec" data-follow-panel="sources"><div class="fsechead"><h3>关注列表</h3>${Q("30%")}</div><div class="board-follow-selection">${Q("45%")}</div><div class="frows fsources" data-layout="default"><div class="board-follow-list">${$(`<article class="fauthor"><div class="fauthorhead">${Q("40%")}</div><div class="skeleton-lines">${$(Ji(), 2)}</div></article>`, 4)}</div></div></section></div></div>`;
- else if (e === "/configuration") t = `<div class="configpage">${Xi([
+ else if (e === "/follow-manage") {
+ let e = t.followLayout === "table", r = e ? `<div class="ftableframe"><div class="ftablewrap"><table class="ftable"><thead><tr>${[
+ "选择",
+ "创作者",
+ "来源",
+ "站点",
+ "状态",
+ "上次检查",
+ "操作"
+ ].map((e) => `<th>${e}</th>`).join("")}</tr></thead><tbody>${$(`<tr>${[
+ "20px",
+ "90px",
+ "120px",
+ "60px",
+ "40px",
+ "100px",
+ "60px"
+ ].map((e) => `<td>${Q(e)}</td>`).join("")}</tr>`, 6)}</tbody></table></div></div>` : `<div class="board-follow-list">${$(ra(), 4)}</div>`;
+ n = `<div class="follow followmanage"><div class="fmanageoverview">${[
+ "关注创作者",
+ "启用来源",
+ "检查失败",
+ "未看更新"
+ ].map((e) => `<div><span>${e}</span><b>${Q()}</b></div>`).join("")}</div>${Zi([
+ "关注列表",
+ "添加关注",
+ "来源和凭证"
+ ], "follow-workspace-switch")}<div class="fmain"><section class="fsec" data-follow-workspace-panel="list">${ta()}<div class="board-follow-selection"><label>${l("disabled")}全选本页</label>${e ? "" : ea("全部收起")}</div><div class="frows fsources" data-layout="${e ? "table" : "default"}">${r}<div class="followpagefooter"><div class="followpageinfo">${Q("120px")}${Q("100px")}</div></div></div></section></div></div>`;
+ } else if (e === "/configuration") n = `<div class="configpage">${Xi([
"通用",
"媒体",
"网络与访问",
"更新与维护"
])}<section class="configfieldset"><div class="geist-fieldset-content"><h3 class="geist-fieldset-title">开机自启</h3><div class="skeleton-lines">${$(`<div class="skeleton-setting">${Q("35%")}<span class="skeleton skeleton-toggle"></span></div>`, 3)}</div></div><footer class="geist-fieldset-footer">${Q("100px")}</footer></section></div>`;
- else if (e === "/activity") t = `<div class="activitypage">${[
+ else if (e === "/activity") n = `<div class="activitypage">${[
"正在进行",
"被挡下的",
"最近完成"
].map((e) => `<section class="activitysection"><h3 class="geist-fieldset-title">${e}</h3><div class="activity-runs"><article class="cleanupfieldset activity-run"><div class="geist-fieldset-content skeleton-lines">${Q("35%")}${Ji()}</div></article></div></section>`).join("")}</div>`;
- else if (e === "/duplicates") t = `<div class="review"><div class="collection-summary">${Q("38%")}</div><div class="fsechead dupactions"><h3>批量保留</h3>${Q("40%")}</div>${$(`<section class="dupgroup"><div class="duphead">${Q("45%")}</div><div class="duplist">${$(`<div class="duprow"><span class="dupcover skeleton"></span><span class="dupmarks">${Q()}</span><span class="dupname">${Q("90%")}</span>${Q()}${Q()}${Q()}<span class="duppath">${Q("70%")}</span></div>`, 2)}</div></section>`, 2)}</div>`;
- else if (e === "/quality-goals") t = `<div class="quality-workspace"><div class="collection-summary"><strong>待升级</strong>${Q("20%")}</div><div class="qualitylist">${$(`<article class="qualityitem"><span class="qualitycover skeleton"></span><div class="qualitybody skeleton-lines">${Ji()}</div><footer class="qualityactions">${Q("80%")}</footer></article>`, 6)}</div></div>`;
- else if (e === "/playlists") t = `<section class="playlistpage"><header><div><h2>播放列表</h2><p>保存 Mix,按自己的顺序继续播放。</p></div><div class="playlistcreate skeleton-lines"><span>新播放列表</span>${Q("200px")}</div></header><div class="playlistcards">${$(`<article class="card playlistcard"><div class="mixstack"><div class="pic skeleton"></div></div><div class="mixmeta"><span class="mav skeleton"></span><div class="mixcopy skeleton-lines">${Ji()}</div></div></article>`, 6)}</div></section>`;
+ else if (e === "/duplicates") n = `<div class="review"><div class="collection-summary">${Q("38%")}</div><div class="fsechead dupactions"><h3>批量保留</h3>${Q("40%")}</div>${$(`<section class="dupgroup"><div class="duphead">${Q("45%")}</div><div class="duplist">${$(`<div class="duprow"><span class="dupcover skeleton"></span><span class="dupmarks">${Q()}</span><span class="dupname">${Q("90%")}</span>${Q()}${Q()}${Q()}<span class="duppath">${Q("70%")}</span></div>`, 2)}</div></section>`, 2)}</div>`;
+ else if (e === "/quality-goals") n = `<div class="quality-workspace"><div class="collection-summary"><strong>待升级</strong>${Q("20%")}</div><div class="qualitylist">${$(`<article class="qualityitem"><span class="qualitycover skeleton"></span><div class="qualitybody skeleton-lines">${Ji()}</div><footer class="qualityactions">${Q("80%")}</footer></article>`, 6)}</div></div>`;
+ else if (e === "/playlists") n = `<section class="playlistpage"><header><div><h2>播放列表</h2><p>保存 Mix,按自己的顺序继续播放。</p></div><div class="playlistcreate skeleton-lines"><span>新播放列表</span>${Q("200px")}</div></header><div class="playlistcards">${$(`<article class="card playlistcard"><div class="mixstack"><div class="pic skeleton"></div></div><div class="mixmeta"><span class="mav skeleton"></span><div class="mixcopy skeleton-lines">${Ji()}</div></div></article>`, 6)}</div></section>`;
else return "";
- return `<div class="board-page-skeleton" data-skeleton="board${e}" role="status" aria-label="正在读取页面"><div aria-hidden="true">${t}</div></div>`;
+ return `<div class="board-page-skeleton" data-skeleton="board${e}" role="status" aria-label="正在读取页面"><div aria-hidden="true" inert>${n}</div></div>`;
}
//#endregion
//#region src/catalog-onboarding.ts
-var na = [
+var oa = [
"loc",
"creator",
"performer",
@@ -4973,16 +4994,16 @@ var na = [
"jav",
"thumb"
];
-function ra() {
+function sa() {
let e = (e) => Array(64).fill(e).join("");
return {
tiers: "<div class=\"tier catalog-placeholder\" aria-hidden=\"true\">" + e("<span class=\"av\"><span class=\"ring\"></span><span class=\"nm\">&nbsp;</span></span>") + "</div><div class=\"tier catalog-placeholder\" aria-hidden=\"true\">" + e("<span class=\"brandpill\"><span class=\"mk\"></span><span class=\"placeholder-name\">&nbsp;</span></span>") + "</div>",
tags: "<span class=\"catalog-placeholder placeholder-tags\" aria-hidden=\"true\">" + e("<span class=\"pill\">&nbsp;</span>") + "</span>"
};
}
-async function ia(e, t) {
+async function ca(e, t) {
let n = new URLSearchParams();
- for (let t of na) e[t] && n.set(t, e[t]);
+ for (let t of oa) e[t] && n.set(t, e[t]);
let [r, i] = await Promise.all([t("/api/facets?" + n), t("/api/items?" + n + "&limit=5")]), a = [...new Set([
...r.creators || [],
...r.tagperformers || [],
@@ -4993,8 +5014,8 @@ async function ia(e, t) {
return r.set("q", e), r.set("limit", "1"), (await t("/api/items?" + r)).total > 0 ? e : "";
}))).filter(Boolean);
}
-function aa({ kind: e = "catalog", filtered: t = !1, jav: n = !1, configurable: r = !1, online: i = !1 } = {}) {
- let a = r ? "<a class=\"geist-button primary\" href=\"/configuration\">添加内容</a>" : "", o = "<a class=\"geist-button\" href=\"/follow-manage\">添加来源</a>";
+function la({ kind: e = "catalog", filtered: t = !1, jav: n = !1, configurable: r = !1, online: i = !1 } = {}) {
+ let a = r ? "<button class=\"geist-button primary\" data-empty-settings>添加内容</button>" : "", o = "<a class=\"geist-button" + (!r || i ? " primary" : "") + "\" href=\"/follow-manage?tab=add\">添加关注</a>";
if (t || n) return f("search", n ? "还没有符合条件的 JAV 作品" : "没有符合条件的内容", n ? "已扫描但尚未补充发行资料的视频可在全部内容中查看。" : "清除筛选或搜索条件后查看全部内容。", { actions: "<a class=\"geist-button primary\" href=\"/?loc=&thumb=0\">查看全部内容</a>" });
if (e !== "catalog") {
let t = (i ? {
@@ -5014,7 +5035,7 @@ function aa({ kind: e = "catalog", filtered: t = !1, jav: n = !1, configurable:
}
//#endregion
//#region src/sidebar.ts
-function oa(e) {
+function ua(e) {
return [
"/",
"/unseen",
@@ -5024,58 +5045,58 @@ function oa(e) {
"/junk-files"
].includes(e) || /^\/(item|mix|parts|editions)\//.test(e) || /^\/playlists\/\d+\/\d+$/.test(e) || /^\/(performers|studios|creators|series|agencies)\/.+/.test(e);
}
-function sa(e, t) {
+function da(e, t) {
return e.dataset.surface?.split("?")[0] === t.split("?")[0] && e.querySelector(".dnav") ? (e.dataset.surface = t, !1) : (e.dataset.surface = t, e.replaceChildren(), !0);
}
-function ca(e) {
+function fa(e) {
let t = /* @__PURE__ */ new Map();
for (let n of e) for (let e of new Set(n.tags || [])) t.set(e, (t.get(e) || 0) + 1);
return [...t].sort((e, t) => t[1] - e[1]).slice(0, 30);
}
//#endregion
//#region src/resource-sync.ts
-var la = (e = 0) => Number(e).toLocaleString(), ua = {
+var pa = (e = 0) => Number(e).toLocaleString(), ma = {
local: "本地磁盘",
115: "115",
pikpak: "PikPak"
};
-function da(e, t) {
+function ha(e, t) {
let n = e.cache || {
files: 0,
bytes: 0
}, r = !!(e.missing || n.files);
return `<div class="resourcepanel" data-geist-fieldset><div class="resourcesources">${(e.sources || []).map((e) => `<article>
- <div class="resourcesourcetitle"><b>${ua[e.location] || "媒体来源"}</b><span class="${e.online ? "online" : "offline"}">${e.online ? "可访问" : "离线,已跳过"}</span></div>
- <strong>${e.online ? `${la(e.missing)} 项` : "—"}</strong>
- <small>${e.online ? `找不到文件 · 已检查 ${la(e.checked)} 项` : `馆藏中有 ${la(e.total)} 项`}</small>
- ${e.unreadable ? `<small>${la(e.unreadable)} 项读取失败,已跳过</small>` : ""}</article>`).join("")}</div>
- <div class="resourcecache"><div><span>可清理的缓存</span><b>${la(n.files)} 个</b><small>${t(n.bytes)}</small></div>
- <div><span>待移入回收站</span><b>${la(e.missing)} 项</b></div></div>
- ${r ? g(`将把找不到文件的 ${la(e.missing)} 项馆藏记录移入回收站,并清理 ${la(n.files)} 个闲置缓存。`, { label: "清理内容" }) : ""}
+ <div class="resourcesourcetitle"><b>${ma[e.location] || "媒体来源"}</b><span class="${e.online ? "online" : "offline"}">${e.online ? "可访问" : "离线,已跳过"}</span></div>
+ <strong>${e.online ? `${pa(e.missing)} 项` : "—"}</strong>
+ <small>${e.online ? `找不到文件 · 已检查 ${pa(e.checked)} 项` : `馆藏中有 ${pa(e.total)} 项`}</small>
+ ${e.unreadable ? `<small>${pa(e.unreadable)} 项读取失败,已跳过</small>` : ""}</article>`).join("")}</div>
+ <div class="resourcecache"><div><span>可清理的缓存</span><b>${pa(n.files)} 个</b><small>${t(n.bytes)}</small></div>
+ <div><span>待移入回收站</span><b>${pa(e.missing)} 项</b></div></div>
+ ${r ? g(`将把找不到文件的 ${pa(e.missing)} 项馆藏记录移入回收站,并清理 ${pa(n.files)} 个闲置缓存。`, { label: "清理内容" }) : ""}
<div class="resourceapplyrow geist-fieldset-footer" data-geist-fieldset-footer>${r ? "<button class=\"geist-button primary\" type=\"button\" id=\"resourceApply\">清理失效记录与缓存</button>" : "<p class=\"resourcesyncok\">已检查可访问的来源,没有待清理的记录或缓存。</p>"}</div></div>`;
}
//#endregion
//#region src/jav-artwork.ts
-function fa(e) {
+function ga(e) {
return [
"small",
"sleeve",
"preview"
].includes(String(e)) ? "small" : "big";
}
-function pa(e) {
+function _a(e) {
return {
- javLayout: fa(e.javLayout),
- javImage: ma(e.javLayout === "preview" ? "thumbnail" : e.javImage)
+ javLayout: ga(e.javLayout),
+ javImage: va(e.javLayout === "preview" ? "thumbnail" : e.javImage)
};
}
-function ma(e) {
+function va(e) {
return e === "thumbnail" ? "thumbnail" : "cover";
}
-function ha(e, t) {
- return e.is_jav && e.code && e.has_cover && (ma(t) === "cover" || !e.has_thumb) ? "cover" : e.has_thumb ? "thumbnail" : "";
+function ya(e, t) {
+ return e.is_jav && e.code && e.has_cover && (va(t) === "cover" || !e.has_thumb) ? "cover" : e.has_thumb ? "thumbnail" : "";
}
-function ga(e, t) {
+function ba(e, t) {
let n = Number(e?.px?.[0]), r = Number(e?.px?.[1]), i = Number(e?.x0);
if (!(n > 0 && r > 0 && t > 0) || !Number.isFinite(i)) return null;
let a = Math.min(1, Math.max(0, i / n)), o = n / r / t, s = (1 - a) * o;
@@ -5086,15 +5107,15 @@ function ga(e, t) {
left: l(c)
};
}
-function _a(e, t) {
+function xa(e, t) {
e.querySelectorAll("img[data-jav-image]").forEach((e) => {
- let n = e.dataset.javCover || "", r = e.dataset.javThumb || "", i = !!(n && (ma(t) === "cover" || !r)), a = i ? n : r;
+ let n = e.dataset.javCover || "", r = e.dataset.javThumb || "", i = !!(n && (va(t) === "cover" || !r)), a = i ? n : r;
e.classList.toggle("cover", i), e.classList.toggle("whole", i && e.dataset.javImageLayout !== "big"), e.classList.toggle("front", i && e.dataset.javImageLayout === "big"), e.classList.remove("panel"), e.removeAttribute("style"), e.closest(".pic")?.style.removeProperty("--cover-blur"), a && e.getAttribute("src") !== a && (e.src = a);
});
}
//#endregion
//#region src/islands.ts
-var va = {
+var Sa = {
"library-processing": {
load: yt,
component: St
@@ -5115,16 +5136,16 @@ var va = {
load: ii,
component: _i
}
-}, ya = () => Object.keys(va), ba = /* @__PURE__ */ new Map();
-async function xa(e, t, n, r = {}) {
- let i = va[e];
+}, Ca = () => Object.keys(Sa), wa = /* @__PURE__ */ new Map();
+async function Ta(e, t, n, r = {}) {
+ let i = Sa[e];
if (!i) throw Error(`未注册的 island:${String(e)}`);
- Ca(t);
+ Da(t);
let a = {
controller: new AbortController(),
painted: !1
};
- ba.set(t, a);
+ wa.set(t, a);
let o;
try {
o = {
@@ -5138,9 +5159,9 @@ async function xa(e, t, n, r = {}) {
error: W(e)
};
}
- if (ba.get(t) !== a) return;
+ if (wa.get(t) !== a) return;
if (r.isCurrent && !r.isCurrent()) {
- ba.delete(t);
+ wa.delete(t);
return;
}
t.textContent = "", a.painted = !0;
@@ -5150,10 +5171,10 @@ async function xa(e, t, n, r = {}) {
};
Ne(ue(i.component, s), t);
}
-var Sa = (e) => !!e && ba.has(e);
-function Ca(e) {
- let t = ba.get(e);
- t && (t.controller.abort(), ba.delete(e), t.painted && Ne(null, e));
+var Ea = (e) => !!e && wa.has(e);
+function Da(e) {
+ let t = wa.get(e);
+ t && (t.controller.abort(), wa.delete(e), t.painted && Ne(null, e));
}
//#endregion
-export { Dt as TASTE_GUIDE_KEY, En as activityChartsHtml, ta as boardPageSkeleton, Ie as boundedPreference, aa as catalogEmptyHtml, ia as catalogSuggestions, zi as clampPage, Tt as cleanupSkeletonHtml, Ct as cloudLocations, wt as cloudPreferenceLocations, ki as createReviewSelection, bn as creatorSankeyHtml, ea as detailSkeletonHtml, Ve as distributionChart, ra as emptyCatalogLayout, qi as entitySkeletonHtml, ht as followJobProgress, Mi as groupReviewRows, Ci as identityEvidenceHtml, Nt as initBoardControls, Sa as islandMounted, ya as islandNames, ha as javImageKind, pt as jobActivityHtml, Be as jobProgressHtml, Vi as matchesFaceSource, Gi as mountAvatarPicker, jt as mountBoardStatePreview, xa as mountIsland, Re as mountNumberSetting, Hi as nativeImageFit, ma as normalizeJavImage, fa as normalizeJavLayout, pa as normalizeJavPreferences, Ri as pageCount, Bi as paginationHtml, ga as panelFrame, Pe as preferredDirection, Ue as radarChart, Cn as radialCardHtml, He as rankedChart, bi as refreshStore, da as resourceScanHtml, Si as reviewImageHtml, Di as selectGroup, Ti as selectRange, Ei as selectionSummary, oa as sidebarHasCatalogContent, kn as sidebarSectionHtml, ca as sidebarTagCounts, ze as statCardBody, yi as storeNames, Mt as syncBoardRange, _a as syncJavImages, Le as syncNumberSetting, Oi as syncSelectionToolbar, sa as syncSidebarSurface, Et as tasteHistoryGuideHtml, Mn as transitionTheme, Ki as unmountAvatarPicker, Ca as unmountIsland, Ai as updateReviewSticky, mt as watchJob, Dn as wireActivityCharts, xn as wireCreatorSankey, zt as wireExpandableRanks, Rt as wireGrowingCharts, wn as wireRadialCards, wi as wireReviewPictures, Ii as wireReviewSelection, An as wireSidebarGroups, Ot as wireTasteHistoryGuide };
+export { Dt as TASTE_GUIDE_KEY, En as activityChartsHtml, aa as boardPageSkeleton, Ie as boundedPreference, la as catalogEmptyHtml, ca as catalogSuggestions, zi as clampPage, Tt as cleanupSkeletonHtml, Ct as cloudLocations, wt as cloudPreferenceLocations, ki as createReviewSelection, bn as creatorSankeyHtml, ia as detailSkeletonHtml, Ve as distributionChart, sa as emptyCatalogLayout, qi as entitySkeletonHtml, ht as followJobProgress, Mi as groupReviewRows, Ci as identityEvidenceHtml, Nt as initBoardControls, Ea as islandMounted, Ca as islandNames, ya as javImageKind, pt as jobActivityHtml, Be as jobProgressHtml, Vi as matchesFaceSource, Gi as mountAvatarPicker, jt as mountBoardStatePreview, Ta as mountIsland, Re as mountNumberSetting, Hi as nativeImageFit, va as normalizeJavImage, ga as normalizeJavLayout, _a as normalizeJavPreferences, Ri as pageCount, Bi as paginationHtml, ba as panelFrame, Pe as preferredDirection, Ue as radarChart, Cn as radialCardHtml, He as rankedChart, bi as refreshStore, ha as resourceScanHtml, Si as reviewImageHtml, Di as selectGroup, Ti as selectRange, Ei as selectionSummary, ua as sidebarHasCatalogContent, kn as sidebarSectionHtml, fa as sidebarTagCounts, ze as statCardBody, yi as storeNames, Mt as syncBoardRange, xa as syncJavImages, Le as syncNumberSetting, Oi as syncSelectionToolbar, da as syncSidebarSurface, Et as tasteHistoryGuideHtml, Mn as transitionTheme, Ki as unmountAvatarPicker, Da as unmountIsland, Ai as updateReviewSticky, mt as watchJob, Dn as wireActivityCharts, xn as wireCreatorSankey, zt as wireExpandableRanks, Rt as wireGrowingCharts, wn as wireRadialCards, wi as wireReviewPictures, Ii as wireReviewSelection, An as wireSidebarGroups, Ot as wireTasteHistoryGuide };
diff --git a/web/index.html b/web/index.html
index 9f78ea27b..5a73d499f 100644
--- a/web/index.html
+++ b/web/index.html
@@ -136,6 +136,7 @@
<symbol id="i-plus" viewBox="0 0 24 24"><path d="M5 12h14" /><path d="M12 5v14" /></symbol>
<symbol id="i-minus" viewBox="0 0 24 24"><path d="M5 12h14" /></symbol>
<symbol id="i-check" viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5" /></symbol>
+ <symbol id="i-check-check" viewBox="0 0 24 24"><path d="M18 6 7 17l-5-5" /><path d="m22 10-7.5 7.5L13 16" /></symbol>
<symbol id="i-rotate-ccw" viewBox="0 0 24 24"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" /><path d="M3 3v5h5" /></symbol>
<symbol id="i-rotate-cw" viewBox="0 0 24 24"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8" /><path d="M21 3v5h-5" /></symbol>
<symbol id="i-maximize" viewBox="0 0 24 24"><path d="M8 3H5a2 2 0 0 0-2 2v3" /><path d="M21 8V5a2 2 0 0 0-2-2h-3" /><path d="M3 16v3a2 2 0 0 0 2 2h3" /><path d="M16 21h3a2 2 0 0 0 2-2v-3" /></symbol>
diff --git a/web/vendor/lucide-ORIGIN.md b/web/vendor/lucide-ORIGIN.md
index 4bac079ed..2523d21ff 100644
--- a/web/vendor/lucide-ORIGIN.md
+++ b/web/vendor/lucide-ORIGIN.md
@@ -3,7 +3,7 @@
- npm 包:`[email protected]`
- npm lock integrity:`sha512-ln37Ng6A709exLQH4pBxrbl6FAUk/ZBLTJnLrj02HN/Bb84eUGzlA2JjMglScI0TEab6vH2UVs0hm4vGgLzTrQ==`
- 许可证:ISC;原文见 `lucide-LICENSE.txt`
-- 消费者:`web/index.html` 内联的 116 个 symbol
+- 消费者:`web/index.html` 内联的 117 个 symbol
雪碧图里另有 6 枚自绘 symbol(shuffle、alert、pics、jav、theater-enter、theater-exit)与 16 枚 player-* 前缀的播放器图标,都没有上游可对。
RSS 与拖动点保留填充修正,避免小圆点在全局描边样式下消失。