Skip to content

armgit / peach

Public Imported from GitHub
0

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

fix(ui): 骨架不接悬停、等数据的键呈禁用态,拆分按钮两半各自悬停,RSS 说明浮层进顶层

longmeidaobee23e703f86
diff --git a/.claude/skills/peach-web-ui/SKILL.md b/.claude/skills/peach-web-ui/SKILL.md
index 679b9ed82..1a12a78fc 100644
--- a/.claude/skills/peach-web-ui/SKILL.md
+++ b/.claude/skills/peach-web-ui/SKILL.md
@@ -5,7 +5,7 @@ description: 在新增、修改或复核 Peach 页面、控件、提示、错误
# Peach Web UI 复用门槛
-最后复核:2026-09-19
+最后复核:2026-09-25
证据来源:现有 UI 契约、`docs/TESTING.md`、2026-09-19 本机会话工具记录。
## 开工顺序
@@ -61,6 +61,7 @@ description: 在新增、修改或复核 Peach 页面、控件、提示、错误
- 用户写操作只在服务端终态成功后调用共享 `actionReceipt()` 发一条过去时 Toast;可由安全逆操作完整恢复的状态提供 8 秒「撤销」,永久删除、凭据、保存到账本等不伪造撤销。仅打开面板/菜单/Dialog 不算操作完成,不发 Toast;失败除短 Toast 外仍在原位置保留原因与重试入口。
- 同一次页面进入只呈现一段等待态;深链启动与页面取数复用同一个 Skeleton,禁止 Spinner 再切换成 Loading Dots 或 Skeleton。
- Skeleton 只覆盖真正等待的内容区;静态标题、导航和能同步得到的筛选控件立即显示。骨架必须复用最终容器的宽度、列数与对齐方式:卡片网格横向铺满,居中面板仍居中,不得用一列通用占位替代不同页面结构。
+- 骨架里的占位不接指针、没有任何悬停反馈(`09-skeleton.css` 一处关掉);要等数据才能执行的键用原生 `disabled` 加 `data-skeleton-action`,呈全站共用的禁用面(`--surface` 底、`--border-15` 环、`--muted` 字、not-allowed),不用 opacity,也不伪装成可点的最终档。
- 关注来源标签先服从来源记录的类型:只有明确标为 `general` 的标签才能进入卡片、顶部筛选和在线标签页,`artist`/`character`/`copyright`/`metadata` 与未知类型不得靠词形猜成 `general`。通用词清理是第二道门槛,只处理已经确认的 `general`;详情可显示全部来源标签,并按真实类型着色。
- 危险动作的悬停态一律 `--drop` 实底加白字。只描红边、红字的话,静止态和悬停态在暗色底上几乎一样亮,按下去之前看不出这是不可逆动作;带文字的销毁按钮全站一个写法,纯图标删除键不适用。Geist 的 error Button 同样是实心红填充,只是它静止态就红。实测见 `vercel-geist-controls-measured.md`。
- 下拉框的用途用框内左侧 16px 前缀图标标明,不在同一行挂一个文字标签:Geist 的文字 Label 是块级、排在控件上方,行内并排那种写法它没有,而工具行没有上方空间。无障碍名称改由 `aria-label` 承担。
diff --git a/docs/reference-snapshots/vercel-geist-split-button.md b/docs/reference-snapshots/vercel-geist-split-button.md
index 3119ac5bf..5b39180b1 100644
--- a/docs/reference-snapshots/vercel-geist-split-button.md
+++ b/docs/reference-snapshots/vercel-geist-split-button.md
@@ -1,6 +1,6 @@
# Geist Split Button 实测记录
-- 取证日期:2026-09-07
+- 取证日期:2026-09-07;「悬停」一节 2026-09-25 复测
- URL:<https://vercel.com/geist/split-button>
- 取证方式:在浏览器里打开 Default 示例,对包裹层与两颗按钮读 `getComputedStyle` 和
`getBoundingClientRect`,再点开触发档读菜单项文字;规范正文取页面 Best Practices 一节
@@ -22,6 +22,23 @@
`left:-1px`、`width:1px`、`height:100%`,浅色主题 `#404040`、深色主题 `#cdcdcd`。
主动作 `border-r-0`、触发档 `border-l-0`,所以整体看着是一个盒子而不是两颗按钮。
+## 悬停
+
+2026-09-25 复测(agent-browser 打开同一页 Default 示例,逐颗读 `getComputedStyle`,
+悬停用真实指针移入):
+
+- 底色画在两颗按钮各自身上,包裹层 `div.flex.relative` 没有底色、边框和圆角。两颗都是
+ `relative z-[1]`、`focus:z-[2]`,边框 `1px` 取 gray-400(浅色 `rgb(235,235,235)`、深色
+ `rgb(46,46,46)`),过渡 `150ms cubic-bezier(0.4,0,0.2,1)`。
+- 悬停只改指针下那一颗:浅色主题静止两颗都是 `rgb(23,23,23)`,指针在哪半哪半变成
+ `rgb(56,56,56)`(`hsl(0,0%,22%)`),另一半不动;深色主题静止 `rgb(237,237,237)`、悬停
+ `rgb(204,204,204)`。字色两态都不变。
+- 分隔线不随悬停变色,高度实测 30px(32px 减去上下两条边框),也就是上下顶满内容盒。它在
+ 触发档里、`left:-1px` 压在主动作最后一列上;触发档排在后面,同为 `z-[1]` 时它整颗画在
+ 主动作之上,所以不管悬停哪半,线都在最上面。
+- 线色与悬停填充几乎同一档(浅色线 `#404040`、悬停 `#383838`),悬停时那半与线融成一片,
+ 静止时线清楚可见。禁用时线 `disabled:before:opacity-10`。
+
## 菜单
默认 `menuAlignment="bottom-start"`,菜单贴主动作左边缘往下开。Default 示例的菜单项:
@@ -50,6 +67,15 @@ deployment`),说明不参与和主动作的比对,第一行标签才是。
分析)的两种取得方式,权重却看着一样。现在合成一个 Split Button:左半是读取本机浏览记录,
右半的箭头开出菜单,第一项与左半同名同事,第二项是导入历史文件。
-几何按 Peach 的动作条走:高度 36px 与同一行的下拉框齐平,圆角取 `--control-radius`,底色取
-`--ground`,交界竖线上下各收 6px 用 `--border-15`。判据由 `tests/test_web_ui.py` 的
-`test_history_actions_are_one_split_button_with_the_primary_mirrored` 守住。
+数据管理页「扫描与采集」卡用同一颗。全站只有一份样式(`web/board.css` 的
+`[data-split-button]` 那几条),两半都是 BoardUI 主按钮:
+
+- 高度 36px 与同一行的下拉框齐平,外圆角由按钮组那一层裁出。
+- 底色画在两半各自身上(`--board-blue` 渐变),悬停只淡入指针下那一半自己的
+ `bg-button-primary::before` 悬停层,另一半不动,与 Geist 的分层一致。
+- 中缝是触发档的 `::after`:`left:-1px`、上下顶满、1px,颜色取悬停那一档的起始色
+ `--color-accent-400`,悬停时不变。
+- 骨架里两半是原生 `disabled`,外圈 `--border-15` 画在整组上,中缝退成同一色。
+
+两半的悬停、中缝几何与骨架禁用面由 `frontend/e2e/design.test.ts` 量 computed style 守住,
+结构由 `tests/test_web_ui.py` 的 `test_history_actions_are_one_split_button_with_the_primary_mirrored` 守住。
diff --git a/frontend/e2e/design.test.ts b/frontend/e2e/design.test.ts
index 73dd17d7d..f38028cde 100644
--- a/frontend/e2e/design.test.ts
+++ b/frontend/e2e/design.test.ts
@@ -8,7 +8,7 @@ import { after, before, describe, it } from 'node:test';
import type { Browser, Locator, Page } from 'playwright-core';
-import { configurationBody, expectBody, launch, settle, visit, VIEWPORTS, type Visit } from './harness.ts';
+import { configurationBody, expectBody, launch, layout, settle, visit, VIEWPORTS, type Visit } from './harness.ts';
const DESKTOP = VIEWPORTS.find((viewport) => !viewport.mobile)!;
const MOBILE = VIEWPORTS.find((viewport) => viewport.mobile)!;
@@ -324,6 +324,67 @@ async function controlFaces(page: Page, selectors: Record<string, string>) {
})), selectors);
}
+/** 打开一位订了新作、有一排同台艺人的人物页。演示库里没有人物实体,资料照服务端下发的形状写。 */
+async function openPerformer(browser: Browser, viewport = DESKTOP): Promise<Visit> {
+ const name = '七沢みあ';
+ const opened = await visit(browser, '/', viewport);
+ const costar = (id: number, k: string) => ({ id, k, n: 1, rep: null, has_image: false, has_avatar: false, avatar_focus: null });
+ await opened.page.route(/\/api\/entity\?/, (route) => route.fulfill({ json: {
+ id: 90_001, kind: 'performer', canonical_name: name, aliases: [], display_aliases: [],
+ user_aliases: [], asset_count: 0, tags: [],
+ related_performers: ['本田愛华', '枢木葵', '美谷朱音', '高杉麻里', '高桥圣子', '今井夏帆'].map((k, at) => costar(90_002 + at, k)),
+ links: [], metadata: {}, has_image: false, has_avatar: false, avatar_focus: null, representative_asset_id: null,
+ entry_links: [
+ { site: 'javdb', label: 'JavDB', ordinal: '', slot: 'mark', mark: 'mark-javdb', url: 'https://javdb.com/actors/NPD3' },
+ { site: 'missav', label: 'MISSAV', ordinal: '', slot: 'mark', mark: '', url: 'https://missav.ai/actresses/x' },
+ ],
+ feed: { following: true },
+ } }));
+ await opened.page.goto(new URL(`/performers/${encodeURIComponent(name)}`, opened.page.url()).href, { waitUntil: 'load' });
+ await opened.page.locator('.entryfeed').waitFor({ timeout: 15_000 });
+ await opened.page.locator('.entityfoot [data-related-performer]').first().waitFor({ timeout: 15_000 });
+ await settle(opened.page);
+ await opened.page.evaluate(() => {
+ document.documentElement.dataset.theme = 'light';
+ document.documentElement.classList.remove('dark');
+ });
+ return opened;
+}
+
+/** 禁用档的三样颜色(peach-web-ui「按钮悬停只抬填充」那条):`--surface` 底、`--border-15` 边、`--muted` 字。 */
+async function disabledTokens(page: Page) {
+ return {
+ face: await tokenColor(page, '#main', '--surface'),
+ ink: await tokenColor(page, '#main', '--muted'),
+ ring: await tokenColor(page, '#main', '--border-15'),
+ };
+}
+
+/** 骨架里等数据的操作键此刻的长相与状态,按文档顺序。 */
+async function waitingActionFaces(page: Page, selector: string) {
+ return page.locator(selector).evaluateAll((buttons) => buttons.map((button) => {
+ const style = getComputedStyle(button);
+ return {
+ name: (button.getAttribute('aria-label') || button.textContent || '').trim(),
+ disabled: (button as HTMLButtonElement).disabled, cursor: style.cursor, opacity: style.opacity,
+ face: style.backgroundColor, image: style.backgroundImage, ink: style.color, ring: style.boxShadow,
+ split: !!button.closest('[data-split-button]'),
+ };
+ }));
+}
+
+function assertDisabledFace(face: Awaited<ReturnType<typeof waitingActionFaces>>[number],
+ expected: Awaited<ReturnType<typeof disabledTokens>>): void {
+ assert.equal(face.disabled, true, `${face.name} 在骨架里没有禁用`);
+ assert.equal(face.cursor, 'not-allowed', `${face.name} 在骨架里的光标不是禁用那一种`);
+ assert.equal(face.opacity, '1', `${face.name} 的禁用态靠透明度,而不是换颜色`);
+ assert.equal(face.face, expected.face, `${face.name} 在骨架里不是禁用底色`);
+ assert.equal(face.image, 'none', `${face.name} 在骨架里还铺着渐变`);
+ assert.equal(face.ink, expected.ink, `${face.name} 在骨架里不是禁用字色`);
+ // 分体键的外圈画在整组上,两半各画一圈的话中缝会出现两道线。
+ if (!face.split) assert.ok(face.ring.includes(expected.ring), `${face.name} 在骨架里没有禁用描边:${face.ring}`);
+}
+
/** 切到关注管理页的另一栏。栏名后面可能挂着待配置的数目,按开头认。 */
async function followTab(opened: Visit, name: string): Promise<void> {
await opened.page.locator('#stats').getByRole('tab', { name: new RegExp(`^${name}`) }).click({ timeout: 5_000 });
@@ -561,16 +622,56 @@ describe('设计决定', () => {
});
assert.equal(divider.width, '1px', '拆分按钮分隔线宽度不对');
assert.notEqual(divider.color, 'rgba(0, 0, 0, 0)', '拆分按钮分隔线没有颜色');
- const base = await split.evaluate((element) => getComputedStyle(element).backgroundImage);
- for (const part of [parts.first(), parts.last()]) {
- await part.hover();
- assert.equal(await split.evaluate(
- (element) => getComputedStyle(element).backgroundImage), base,
- '拆分按钮悬停时改变了整组底色');
- assert.deepEqual(await parts.evaluateAll((buttons) => buttons.map(
- (button) => getComputedStyle(button).backgroundColor)),
- ['rgba(0, 0, 0, 0)', 'rgba(0, 0, 0, 0)'], '按钮自己仍在切换底色');
+ } finally {
+ await opened.close();
+ }
+ });
+
+ it('拆分按钮两半各自抬填充:悬停哪半只有哪半变,中缝那条线不动', { timeout: 60_000 }, async () => {
+ // Geist 实测(`vercel-geist-split-button.md`「悬停」):两半各是一颗有自己底色的按钮,
+ // 悬停只抬指针下那一颗;分隔线是触发档 `::before`,`left:-1px` 盖在主动作最后一列上,
+ // 高度顶满、颜色不随悬停变。
+ const opened = await openProcessing(browser, '/data-cleanup', { status: 'idle' });
+ try {
+ // 骨架那张卡同名同结构,等到 React 接管、两半不再带骨架标记才量。
+ const split = opened.page.locator('section[aria-label="扫描与采集"] [data-split-button]:not(:has(> [data-skeleton-action]))');
+ await split.waitFor({ state: 'visible', timeout: 15_000 });
+ await settle(opened.page);
+ const parts = split.locator(':scope > button');
+ const faces = () => parts.evaluateAll((buttons) => buttons.map((button) => {
+ const style = getComputedStyle(button), lift = getComputedStyle(button, '::before');
+ return { fill: style.backgroundImage, lift: lift.opacity, ink: style.color };
+ }));
+ const seam = () => parts.nth(1).evaluate((element) => {
+ const line = getComputedStyle(element, '::after');
+ return { color: line.backgroundColor, width: line.width, left: line.left,
+ height: line.height, full: `${element.getBoundingClientRect().height}px`,
+ clip: getComputedStyle(element).overflowX };
+ });
+ assert.equal(await split.evaluate((element) => getComputedStyle(element).backgroundImage), 'none',
+ '底色画在整组上,两半就没法各自抬填充');
+ await opened.page.mouse.move(0, 0);
+ const rest = await faces();
+ assert.match(rest[0]!.fill, /gradient/, '主动作那半没有自己的蓝色填充');
+ assert.equal(rest[1]!.fill, rest[0]!.fill, '两半静止时不是同一档填充');
+ assert.deepEqual(rest.map((face) => face.lift), ['0', '0'], '没悬停就抬了填充');
+ const line = await seam();
+ assert.equal(line.width, '1px');
+ assert.equal(line.left, '-1px', '分隔线该盖在主动作最后一列上,不占触发档的宽度');
+ assert.equal(line.height, line.full, '分隔线没有上下顶满');
+ assert.equal(line.clip, 'visible', '触发档把伸到左邻上的分隔线裁掉了,屏幕上看不见');
+ assert.notEqual(line.color, 'rgba(0, 0, 0, 0)');
+ for (const [at, other] of [[0, 1], [1, 0]] as const) {
+ await parts.nth(at).hover();
+ // 悬停层按 150ms 淡入淡出,直接读会落在半路;走到终点再比。
+ await opened.page.evaluate(() => document.getAnimations().forEach((animation) => animation.finish()));
+ const hovered = await faces();
+ assert.equal(hovered[at]!.lift, '1', `悬停第 ${at + 1} 半没有抬填充`);
+ assert.equal(hovered[other]!.lift, '0', `悬停第 ${at + 1} 半时另一半也跟着变了`);
+ assert.deepEqual(hovered.map((face) => face.ink), rest.map((face) => face.ink), '悬停改了字色');
+ assert.deepEqual(await seam(), line, '悬停时分隔线变了');
}
+ assert.deepEqual(opened.problems, []);
} finally {
await opened.close();
}
@@ -1252,8 +1353,9 @@ describe('设计决定', () => {
});
for (const viewport of [DESKTOP, MOBILE]) {
- it(`关注列表骨架的工具行与行内操作键和接管后同一副长相(${viewport.name})`, { timeout: 60_000 }, async () => {
- /* 骨架与真页面各量一遍:主按钮的面色、按钮组的选中项、排序框与方向键、行尾的移除键。
+ it(`关注列表骨架的偏好控件和接管后同一副长相,等数据的操作键是禁用态(${viewport.name})`, { timeout: 60_000 }, async () => {
+ /* 骨架与真页面各量一遍。版式、排序和方向是这台浏览器的偏好,骨架里就是最终那一档;
+ 检查全部、全部收起和行尾的移除键要等名单,骨架里是禁用态,只有尺寸与接管后一致。
窄屏上工具行收成纯图标,两边按同一条线收,尺寸也要对得上。 */
const opened = await visit(browser, '/follow-manage', viewport);
try {
@@ -1272,6 +1374,10 @@ describe('设计决定', () => {
全部收起: `${toolbar} > button:nth-of-type(3)`,
移除来源: '[data-skeleton] .follow-skeleton-source > span:last-child > button:last-child',
});
+ const expected = await disabledTokens(page);
+ const waiting = await waitingActionFaces(page, '[data-skeleton] [data-skeleton-action]');
+ assert.ok(waiting.length >= 3, '关注列表骨架里没有标出等数据的操作键');
+ for (const face of waiting) assertDisabledFace(face, expected);
release();
await page.locator('section[aria-label="kou 的关注来源"]').waitFor({ timeout: 15_000 });
await settle(page);
@@ -1284,8 +1390,13 @@ describe('设计决定', () => {
全部收起: 'button[aria-label="全部收起"]',
移除来源: '[data-source-divider] > div > span:last-child > button:last-child',
});
+ const waitsForData = new Set(['检查全部', '全部收起', '移除来源']);
for (const name of Object.keys(final)) {
assert.ok(final[name], `接管后找不到 ${name}`);
+ if (waitsForData.has(name)) {
+ assert.equal(skeleton[name]!.size, final[name]!.size, `${name} 接管时尺寸跳了`);
+ continue;
+ }
assert.deepEqual(skeleton[name], final[name], `${name} 在骨架里和接管后长得不一样`);
}
assert.equal(final['默认视图']!.pressed, 'true', '默认版式下选中的不是网格那颗');
@@ -1295,7 +1406,7 @@ describe('设计决定', () => {
});
}
- it('数据管理骨架里的扫描键是蓝色主按钮,等数据时只挡操作不换长相', { timeout: 60_000 }, async () => {
+ it('数据管理骨架里等数据的操作键是禁用态,数据到了才换回蓝色主按钮', { timeout: 60_000 }, async () => {
const opened = await visit(browser, '/data-cleanup', DESKTOP);
try {
const page = opened.page;
@@ -1306,25 +1417,98 @@ describe('设计决定', () => {
const release = await holdApi(page);
await page.reload({ waitUntil: 'load' });
await page.locator('[data-skeleton="cleanup"] .cleanupscraping [data-split-button]').waitFor({ timeout: 15_000 });
- const split = {
- 分体键: '.cleanupscraping [data-split-button]',
+ const expected = await disabledTokens(page);
+ const waiting = await waitingActionFaces(page, '[data-skeleton="cleanup"] [data-skeleton-action]');
+ assert.deepEqual(waiting.map((face) => face.name),
+ ['扫描并补全资料', '更多扫描与采集方式', '开始修复', '检查来源', '预览', '检查死链', '检查文件']);
+ for (const face of waiting) assertDisabledFace(face, expected);
+ const ring = await page.locator('[data-skeleton="cleanup"] [data-split-button]')
+ .evaluate((element) => getComputedStyle(element).boxShadow);
+ assert.ok(ring.includes(expected.ring), `骨架里的分体键外圈不是禁用那一档描边:${ring}`);
+ const sizes = await controlFaces(page, {
扫描并补全资料: '.cleanupscraping [data-split-button] > button:first-child',
更多方式: '.cleanupscraping [data-split-button] > button:last-child',
- };
- const waiting = await page.locator('[data-skeleton="cleanup"] .cleanupscraping [data-split-button] > button')
- .evaluateAll((buttons) => buttons.map((button) => [button.hasAttribute('disabled'), button.getAttribute('aria-disabled')]));
- assert.deepEqual(waiting, [[false, 'true'], [false, 'true']], '骨架里的扫描键该用 aria-disabled 挡住,不是原生禁用');
- const skeleton = await controlFaces(page, split);
+ 开始修复: '.cleanupmediarepair footer > button',
+ });
release();
await page.locator('[data-skeleton="cleanup"]').waitFor({ state: 'detached', timeout: 15_000 });
await page.locator('.cleanupscraping [data-split-button]').waitFor({ timeout: 15_000 });
- const final = await controlFaces(page, split);
- assert.deepEqual(skeleton, final, '扫描键在骨架里和接管后长得不一样');
+ await settle(page);
+ const final = await controlFaces(page, {
+ 扫描并补全资料: '.cleanupscraping [data-split-button] > button:first-child',
+ 更多方式: '.cleanupscraping [data-split-button] > button:last-child',
+ 开始修复: 'section[aria-label="媒体修复"] footer > button',
+ });
+ for (const name of Object.keys(sizes)) {
+ assert.equal(sizes[name]!.size, final[name]!.size, `${name} 接管时尺寸跳了`);
+ assert.match(final[name]!.face, /gradient/, `${name} 接管后没换回蓝色主按钮`);
+ }
+ const enabled = await page.locator('.cleanupscraping [data-split-button] > button')
+ .evaluateAll((buttons) => buttons.map((button) => (button as HTMLButtonElement).disabled));
+ assert.deepEqual(enabled, [false, false], '数据到了扫描键还是禁用的');
} finally {
await opened.close();
}
});
+ it('骨架里的占位和按键悬停不给任何反馈,也点不中', { timeout: 120_000 }, async () => {
+ const name = '七沢みあ';
+ const pages: { path: string; ready: string; targets: string[]; prepare?: (page: Page) => Promise<void> }[] = [
+ { path: `/performers/${encodeURIComponent(name)}`, ready: '[data-skeleton="entity/performer"] .entityfoot .avskeleton',
+ targets: ['[data-skeleton] .entityfoot .avskeleton'],
+ prepare: (page) => page.route(/\/api\/entity\/shapes/, (route) => route.fulfill({ json: {
+ ok: true, entities: [{ id: 90_001, kind: 'performer', names: [name], parts: ['costars'] }] } })) },
+ { path: '/data-cleanup', ready: '[data-skeleton="cleanup"] [data-skeleton-action]',
+ targets: ['[data-skeleton] .board-plain-stat', '[data-skeleton] a[href="/scraping"]',
+ '[data-skeleton] [data-skeleton-action]', '[data-skeleton] .cleanupfieldset [data-skeleton-action]'] },
+ { path: '/review', ready: '[data-skeleton="review"] .reviewtabs button',
+ targets: ['[data-skeleton] .reviewtabs button', '[data-skeleton] .skeletoncard'] },
+ { path: '/follow', ready: '.followauthors .avskeleton',
+ targets: ['.followauthors .avskeleton', '.followworks .brandskeleton', '[data-skeleton^="cards/"] > div > *'] },
+ { path: '/follow-manage', ready: '[data-skeleton="board/follow-manage"] .follow-skeleton-toolbar',
+ targets: ['[data-skeleton] .follow-skeleton-toolbar > button:nth-of-type(2)',
+ '[data-skeleton] .follow-skeleton-toolbar > button:nth-of-type(1)'] },
+ ];
+ for (const { path, ready, targets, prepare } of pages) {
+ const opened = await visit(browser, '/', DESKTOP);
+ try {
+ const page = opened.page;
+ // 后登记的路由先拿到请求:桩要排在挂住 /api/ 那条之后,不然它也被挂住。
+ await holdApi(page);
+ await prepare?.(page);
+ await page.goto(new URL(path, page.url()).href, { waitUntil: 'load' });
+ await page.locator(ready).first().waitFor({ state: 'visible', timeout: 15_000 });
+ for (const target of targets) {
+ const node = page.locator(target).first();
+ await node.waitFor({ state: 'visible', timeout: 5_000 });
+ const box = (await node.boundingBox())!;
+ const look = () => node.evaluate((element) => [element, ...element.querySelectorAll('*')].slice(0, 6).map((part) => {
+ const style = getComputedStyle(part);
+ return [style.borderColor, style.boxShadow, style.backgroundColor, style.backgroundImage,
+ style.outlineStyle, style.color, style.scale, style.transform].join(' | ');
+ }));
+ await page.mouse.move(0, 0);
+ const rest = await look();
+ const [x, y] = [box.x + box.width / 2, box.y + box.height / 2];
+ await page.mouse.move(x, y);
+ assert.deepEqual(await look(), rest, `${path} ${target} 悬停时变了样子`);
+ // 分层骨架那一排(`data-skeleton-tier`)是最终那条轨道本身,点中它等于点在页面底上;
+ // 要问的是指针有没有落在某一枚占位或整块骨架里。
+ const hit = await page.evaluate(([px, py]) => {
+ const at = document.elementFromPoint(px!, py!);
+ return { cursor: at ? getComputedStyle(at).cursor : '',
+ inside: !!at?.closest('[data-skeleton],.avskeleton,.brandskeleton,.tagskeleton,.skeletoncard'),
+ disabled: !!at?.closest('button:disabled') };
+ }, [x, y]);
+ assert.ok(['auto', 'default', 'not-allowed'].includes(hit.cursor), `${path} ${target} 悬停换了光标:${hit.cursor}`);
+ assert.ok(!hit.inside || hit.disabled, `${path} ${target} 在骨架里还能点中`);
+ }
+ } finally {
+ await opened.close();
+ }
+ }
+ });
+
it('勾中的来源在卡片和表格里都铺 BoardUI 数据表那一档选中底色', { timeout: 60_000 }, async () => {
const opened = await openFollowManage(browser);
try {
@@ -1435,6 +1619,84 @@ describe('设计决定', () => {
}
});
+ for (const viewport of [DESKTOP, MOBILE]) {
+ it(`订阅新作的说明浮层整块露在外面:不被资料卡裁掉,也不被同台艺人那条盖住(${viewport.name})`, { timeout: 60_000 }, async () => {
+ const opened = await openPerformer(browser, viewport);
+ try {
+ const page = opened.page;
+ const feed = page.locator('.entryfeed');
+ await feed.hover();
+ const tip = page.locator('#entityFeedTip');
+ await tip.waitFor({ state: 'visible', timeout: 5_000 });
+ const placement = await tip.evaluate((element) => {
+ const box = element.getBoundingClientRect();
+ const clippedBy: string[] = [];
+ // 顶层里的元素不受祖先 overflow 裁切,只有写在文档流里的浮层才要逐层量。
+ const topLayer = element.matches(':popover-open');
+ for (let node = topLayer ? null : element.parentElement; node; node = node.parentElement) {
+ const style = getComputedStyle(node);
+ if (style.overflowX === 'visible' && style.overflowY === 'visible') continue;
+ const clip = node.getBoundingClientRect();
+ if (box.left < clip.left - 0.5 || box.right > clip.right + 0.5
+ || box.top < clip.top - 0.5 || box.bottom > clip.bottom + 0.5) clippedBy.push(node.className || node.tagName);
+ }
+ // 浮层本身不接指针;临时放开再问四条边和正中最上面是谁,盖在它上面的东西就现形了。
+ // 取样点离角 16px:圆角外那一小块本来就不属于它。
+ element.style.pointerEvents = 'auto';
+ const [midX, midY] = [box.left + box.width / 2, box.top + box.height / 2];
+ const covered = [[box.left + 16, box.top + 2], [box.right - 16, box.top + 2], [box.left + 16, box.bottom - 2],
+ [box.right - 16, box.bottom - 2], [box.left + 2, midY], [box.right - 2, midY], [midX, midY]]
+ .map(([x, y]) => document.elementFromPoint(x!, y!))
+ .filter((hit) => !hit || !element.contains(hit)).map((hit) => hit?.className || 'null');
+ element.style.pointerEvents = '';
+ return { inView: box.left >= 0 && box.right <= innerWidth && box.top >= 0 && box.bottom <= innerHeight,
+ clippedBy, covered, below: box.top >= document.querySelector('.entryfeed')!.getBoundingClientRect().bottom };
+ });
+ assert.ok(placement.inView, '说明浮层越出了视口');
+ assert.deepEqual(placement.clippedBy, [], '说明浮层被外层容器裁掉了一截');
+ assert.deepEqual(placement.covered, [], '说明浮层被别的东西盖住了');
+ assert.ok(placement.below, '视口下方放得下时说明浮层应该在图标下面');
+ const page_ = await layout(page);
+ assert.ok(page_.scrollWidth <= page_.viewportWidth, '说明浮层把页面撑出了横向滚动');
+ assert.deepEqual(opened.problems, []);
+ } finally {
+ await opened.close();
+ }
+ });
+ }
+
+ it('人物页同台艺人的头像悬停和首页顶栏女优头像同一副:抬整格填充、不描圈', { timeout: 60_000 }, async () => {
+ const opened = await openPerformer(browser, DESKTOP);
+ try {
+ const page = opened.page;
+ const person = page.locator('.entityfoot [data-related-performer]').first();
+ const face = () => person.evaluate((element) => {
+ const style = getComputedStyle(element), ring = getComputedStyle(element.querySelector('.ring')!);
+ return { fill: style.backgroundColor, ink: style.color, radius: style.borderRadius, padding: style.padding,
+ width: style.width, ring: ring.boxShadow, size: ring.width };
+ });
+ await page.mouse.move(0, 0);
+ const rest = await face();
+ await person.hover();
+ const hovered = await face();
+ // 首页那一格(board.css「首页顶部两排」):76px 宽、6/4px 内边距、12px 圆角,悬停铺
+ // primary-hover、字换主文字色,48px 圆头像不另描圈。
+ const home = {
+ fill: await tokenColor(page, '#main', '--color-background-primary-hover'),
+ ink: await tokenColor(page, '#main', '--color-text-primary'),
+ };
+ assert.equal(rest.fill, 'rgba(0, 0, 0, 0)', '没悬停就垫了底');
+ assert.deepEqual({ radius: hovered.radius, padding: hovered.padding, width: hovered.width, size: hovered.size },
+ { radius: '12px', padding: '6px 4px', width: '76px', size: '48px' }, '同台艺人那一格和首页头像格不是同一副几何');
+ assert.equal(hovered.fill, home.fill, '悬停没有铺首页那一档填充');
+ assert.equal(hovered.ink.replace(/\s/g, ''), home.ink.replace(/\s/g, ''), '悬停没有换成主文字色');
+ assert.equal(hovered.ring, 'none', '悬停还在给圆头像描圈');
+ assert.deepEqual(opened.problems, []);
+ } finally {
+ await opened.close();
+ }
+ });
+
it('人物页骨架第一帧就带着这一位有的新作行与同台艺人,数据到了一次换齐、高度不变、封面不再等第二遍', { timeout: 60_000 }, async () => {
const name = '七沢みあ';
const opened = await visit(browser, '/', DESKTOP);
diff --git a/frontend/src/board-skeleton.ts b/frontend/src/board-skeleton.ts
index b1cc381e2..24a0e3494 100644
--- a/frontend/src/board-skeleton.ts
+++ b/frontend/src/board-skeleton.ts
@@ -12,7 +12,10 @@ const panel = (title: string) => `<section class="insightpanel"><header>${title}
/* 关注管理整页归 React,骨架整块画在 `.peach-react` 里,容器与按键都取 React 那侧渲染出的同一串
类名(`react/follow-manage/`、`react/components/` 与 `island-skeleton.ts`):页面那一列、读数带、
分段控件、关注列表那张填充卡、创作者卡、来源行和表格外框。只有等数据的读数画占位条。
- 骨架整块 `inert`,里面的键不用再标禁用。 */
+ 骨架整块 `inert`,焦点和点击都进不来;要等数据才能执行的键(检查、移除、全选、收起)
+ 另标原生 `disabled` 与 `data-skeleton-action`,外观是全站骨架共用的那副禁用面,
+ 视图切换、排序这类偏好控件本地就有答案,保持接管后的长相。 */
+const WAITING = 'disabled data-skeleton-action';
const text = (width: string) => `<span class="skeleton skeleton-text" style="width:${width}"></span>`;
const block = (width: number, height: number, round = false) =>
`<span class="skeleton" style="width:${width}px;height:${height}px;flex:none${round ? ';border-radius:50%' : ''}"></span>`;
@@ -29,14 +32,14 @@ const followCheck = (label = '') => `<span class="group inline-flex items-center
interface FollowToolbar { table: boolean; sort: SortKey; dir: SortDir }
const followToolbar = ({ table, sort, dir }: FollowToolbar) => {
const name = SORT_OPTIONS.find(([key]) => key === sort)![1];
- return `<div class="flex flex-wrap items-center gap-2 follow-skeleton-toolbar"><h3 class="mr-auto text-title-2-medium text-text-primary">关注列表</h3><span class="text-body-2-regular text-text-secondary">${text('132px')}</span>${islandButton({ glyph: 'refresh-cw', label: '检查全部', compact: true })}<span data-button-group role="group">${islandButton({ variant: 'ghost', glyph: 'layout-grid', attrs: `aria-pressed="${!table}"` })}${islandButton({ variant: 'ghost', glyph: 'table', attrs: `aria-pressed="${table}"` })}</span>${islandSelect(name)}${islandButton({ variant: 'secondary', glyph: dir === 'asc' ? 'arrow-up' : 'arrow-down' })}${table ? '' : islandButton({ variant: 'secondary', glyph: 'chevron-up', label: '全部收起', compact: true })}</div>`;
+ return `<div class="flex flex-wrap items-center gap-2 follow-skeleton-toolbar"><h3 class="mr-auto text-title-2-medium text-text-primary">关注列表</h3><span class="text-body-2-regular text-text-secondary">${text('132px')}</span>${islandButton({ glyph: 'refresh-cw', label: '检查全部', compact: true, attrs: WAITING })}<span data-button-group role="group">${islandButton({ variant: 'ghost', glyph: 'layout-grid', attrs: `aria-pressed="${!table}"` })}${islandButton({ variant: 'ghost', glyph: 'table', attrs: `aria-pressed="${table}"` })}</span>${islandSelect(name)}${islandButton({ variant: 'secondary', glyph: dir === 'asc' ? 'arrow-up' : 'arrow-down' })}${table ? '' : islandButton({ variant: 'secondary', glyph: 'chevron-up', label: '全部收起', compact: true, attrs: WAITING })}</div>`;
};
/** 行尾那对动作键:检查这一条的更新、移除这一条,与 React `SourceRow` 同为小号次级纯图标键。 */
-const followRowActions = () => `<span class="flex shrink-0 items-center gap-1">${islandButton({ variant: 'secondary', size: 'small', glyph: 'refresh-cw' })}${islandButton({ variant: 'secondary', size: 'small', glyph: 'trash' })}</span>`;
+const followRowActions = () => `<span class="flex shrink-0 items-center gap-1">${islandButton({ variant: 'secondary', size: 'small', glyph: 'refresh-cw', attrs: WAITING })}${islandButton({ variant: 'secondary', size: 'small', glyph: 'trash', attrs: WAITING })}</span>`;
/** 一条来源:勾选、名字、站点图标、状态徽章、上次检查、动作,与 React `SourceRow` 同一串类名。 */
const followRow = () => `<div class="flex min-h-16 flex-wrap items-center gap-3 px-2 py-3 follow-skeleton-source">${followCheck()}<span class="flex min-w-0 grow flex-col gap-0.5"><span class="text-body-medium">${text('8em')}</span></span><span class="flex shrink-0 items-center gap-1.5">${block(14, 14)}</span>${block(48, 24)}<span class="shrink-0 text-body-2-regular whitespace-nowrap text-text-secondary">${text('113px')}</span>${followRowActions()}</div>`;
/** 一位创作者一张 raised 卡:头行是头像、名字、检查、站点图标、全选、收起,底下是来源行。 */
-const followAuthor = (rows: number) => `<section class="min-w-0 bg-background-primary-default rounded-2xl shadow-card flex flex-col overflow-hidden p-2 follow-skeleton-author"><div class="flex flex-wrap items-center gap-3 px-2 py-2.5" data-follow-author-header data-open>${block(32, 32, true)}<b class="min-w-0 grow text-body-medium break-words text-text-primary">${text('92px')}</b>${islandButton({ variant: 'secondary', size: 'small', glyph: 'refresh-cw' })}<span class="flex shrink-0 items-center gap-1">${block(14, 14)}${block(14, 14)}</span>${islandButton({ variant: 'secondary', size: 'small', glyph: 'check-check', label: '全选' })}${islandButton({ variant: 'secondary', size: 'small', glyph: 'chevron-up', label: '收起' })}</div><div data-source-divider>${repeat(followRow(), rows)}</div></section>`;
+const followAuthor = (rows: number) => `<section class="min-w-0 bg-background-primary-default rounded-2xl shadow-card flex flex-col overflow-hidden p-2 follow-skeleton-author"><div class="flex flex-wrap items-center gap-3 px-2 py-2.5" data-follow-author-header data-open>${block(32, 32, true)}<b class="min-w-0 grow text-body-medium break-words text-text-primary">${text('92px')}</b>${islandButton({ variant: 'secondary', size: 'small', glyph: 'refresh-cw', attrs: WAITING })}<span class="flex shrink-0 items-center gap-1">${block(14, 14)}${block(14, 14)}</span>${islandButton({ variant: 'secondary', size: 'small', glyph: 'check-check', label: '全选', attrs: WAITING })}${islandButton({ variant: 'secondary', size: 'small', glyph: 'chevron-up', label: '收起', attrs: WAITING })}</div><div data-source-divider>${repeat(followRow(), rows)}</div></section>`;
/** 表格骨架画多少行由每页条数决定,写死一个数会在别的页大小上多留或少留一屏。
* 偏好存在旧层那份 `peach.settings.v1` 里,直接读它:骨架跑在 island 挂载之前,
* 这时候页面自己的状态还不存在。 */
diff --git a/frontend/src/management.ts b/frontend/src/management.ts
index 2d085115e..e44bab5a2 100644
--- a/frontend/src/management.ts
+++ b/frontend/src/management.ts
@@ -21,13 +21,14 @@ export const SCAN_CARD_TEXT = '扫描媒体文件夹,导入已有资料,采
export const REPAIR_CARD_TEXT = '修缺时间戳表(播放卡顿)和缺索引(打不开)的 MP4。常看的片子先修。';
const bar = '<span class="skeleton skeleton-text" aria-hidden="true"></span>';
-/* 要等数据才能执行的键用 `aria-disabled`,外观仍是它最终的那一档:原生 `disabled` 会把
- 主按钮压成灰底,数据一到又跳回蓝色,同一颗键在一次进入里换两种长相。 */
-const waiting = 'type="button" aria-disabled="true"';
+/* 要等数据才能执行的键是真的按不了:原生 `disabled` 挡住点击与聚焦,`data-skeleton-action`
+ 让各档按键在骨架里统一成同一副禁用面(`board.css`),尺寸仍是最终那一档,数据一到只换颜色。 */
+const waiting = 'type="button" disabled data-skeleton-action';
-/* 两张 React 卡的骨架包在同一层 `.peach-react` 里,按键与下拉照 Board UI 的静止态画(见
+/* 两张 React 卡的骨架包在同一层 `.peach-react` 里,按键与下拉照 Board UI 的尺寸画(见
`island-skeleton.ts`)。卡片这一层的结构照 React 那两张卡抄:外面一列 `gap-4`,标题与正文
- 同一对字级。 */
+ 同一对字级。下拉框里只是一截占位条,不是控件,留 `aria-disabled` 就够。 */
+const waitingAction = 'disabled data-skeleton-action';
const unavailable = 'aria-disabled="true"';
const island = (card: string) => `<div class="peach-react"><div class="flex flex-col gap-4">${card}</div></div>`;
const cardText = (title: string, text: string) => `<div data-geist-fieldset-content>
@@ -39,16 +40,16 @@ const cardText = (title: string, text: string) => `<div data-geist-fieldset-cont
export function scanCardSkeletonHtml(): string {
return island(`<section aria-label="扫描与采集" data-geist-fieldset data-cleanup-task data-cleanup-processing>
${cardText('扫描与采集', SCAN_CARD_TEXT)}
- <footer data-geist-fieldset-footer><a href="/scraping" class="inline-flex items-center justify-center gap-1 whitespace-nowrap font-sans rounded-sm text-body-medium text-accent-600"><span>来源和凭证</span>${islandGlyph('arrow-up', 'size-[18px] shrink-0 rotate-90')}</a><span data-button-group data-split-button data-variant="primary">${islandButton({ glyph: 'database', label: '扫描并补全资料', attrs: unavailable })}${islandButton({ glyph: 'chevron-down', attrs: `${unavailable} aria-label="更多扫描与采集方式"` })}</span></footer>
+ <footer data-geist-fieldset-footer><a href="/scraping" class="inline-flex items-center justify-center gap-1 whitespace-nowrap font-sans rounded-sm text-body-medium text-accent-600"><span>来源和凭证</span>${islandGlyph('arrow-up', 'size-[18px] shrink-0 rotate-90')}</a><span data-button-group data-split-button data-variant="primary">${islandButton({ glyph: 'database', label: '扫描并补全资料', attrs: waitingAction })}${islandButton({ glyph: 'chevron-down', attrs: `${waitingAction} aria-label="更多扫描与采集方式"` })}</span></footer>
</section>`);
}
-/** 「媒体修复」卡:页脚的媒体库下拉框先按最终尺寸画出来,库名要等数据。`bg-button-primary`
- * 遇到 `aria-disabled` 会换成禁用渐变,`data-skeleton-action` 让它停在静止那一档。 */
+/** 「媒体修复」卡:页脚的媒体库下拉框先按最终尺寸画出来,库名要等数据;「开始修复」要等选定
+ * 媒体库,骨架里是禁用态。 */
export function repairCardSkeletonHtml(): string {
return island(`<section aria-label="媒体修复" data-geist-fieldset data-cleanup-task data-cleanup-processing>
${cardText('媒体修复', REPAIR_CARD_TEXT)}
- <footer data-geist-fieldset-footer>${islandSelect(bar, { className: 'w-48', attrs: unavailable })}${islandButton({ label: '开始修复', attrs: `data-skeleton-action ${unavailable}` })}</footer>
+ <footer data-geist-fieldset-footer>${islandSelect(bar, { className: 'w-48', attrs: unavailable })}${islandButton({ label: '开始修复', attrs: waitingAction })}</footer>
</section>`);
}
diff --git a/frontend/test/management.test.ts b/frontend/test/management.test.ts
index 8ae96035a..02ddd256a 100644
--- a/frontend/test/management.test.ts
+++ b/frontend/test/management.test.ts
@@ -48,7 +48,7 @@ describe('数据管理首屏', () => {
expect(scan.querySelector('footer > a')?.getAttribute('href')).toBe('/scraping');
expect(grid.querySelector('.cleanupmediarepair p')?.textContent).toBe(REPAIR_CARD_TEXT);
});
- it('等数据才能执行的键保持最终变体,用 aria-disabled 挡住而不是原生禁用', () => {
+ it('等数据才能执行的键保持最终变体与尺寸,用原生 disabled 挡住并标成骨架操作键', () => {
const root = skeleton();
const split = root.querySelector('.cleanupscraping [data-split-button]')!;
expect(split.getAttribute('data-variant')).toBe('primary');
@@ -62,11 +62,12 @@ describe('数据管理首屏', () => {
const legacy = root.querySelectorAll('.cleanupfieldset footer > button, .resourcesyncfooter > button');
expect([...legacy].map(button => button.textContent)).toEqual(['检查来源', '预览', '检查死链', '检查文件']);
for (const button of legacy) expect(button.classList.contains('primary')).toBe(true);
- const actions = root.querySelectorAll('button:not(.board-plain-stat)');
- expect(actions.length).toBeGreaterThan(0);
+ const actions = root.querySelectorAll('button:not(.board-plain-stat, [aria-haspopup="listbox"])');
+ expect([...actions].map(button => button.textContent || button.getAttribute('aria-label')))
+ .toEqual(['扫描并补全资料', '更多扫描与采集方式', '开始修复', '检查来源', '预览', '检查死链', '检查文件']);
for (const button of actions) {
- expect(button.hasAttribute('disabled')).toBe(false);
- expect(button.getAttribute('aria-disabled')).toBe('true');
+ expect(button.hasAttribute('disabled')).toBe(true);
+ expect(button.hasAttribute('data-skeleton-action')).toBe(true);
}
});
it('链接管理与资源同步的标题、正文立即呈现,不预留同步面板', () => {
diff --git a/tests/test_source_assertion_ratchet.py b/tests/test_source_assertion_ratchet.py
index 475c968cd..078155d56 100644
--- a/tests/test_source_assertion_ratchet.py
+++ b/tests/test_source_assertion_ratchet.py
@@ -53,7 +53,7 @@ BASELINE: dict[str, int] = {
"test_web_e2e.py": 2,
"test_web_js.py": 1,
"test_web_settings.py": 8,
- "test_web_ui.py": 4509,
+ "test_web_ui.py": 4505,
"test_windows_update.py": 3,
}
diff --git a/tests/test_web_ui.py b/tests/test_web_ui.py
index 184395f31..3cfb9bdfd 100644
--- a/tests/test_web_ui.py
+++ b/tests/test_web_ui.py
@@ -1659,18 +1659,13 @@ class WebUiSourceTests(unittest.TestCase):
由 aria-label 给。数据管理页「扫描与采集」卡与口味页的同一颗都归 React
(`LibraryProcessingCard`、`HistoryActions`),那张卡的骨架照同一副 `data-split-button`
画(`frontend/src/management.ts`,行为由 `frontend/test/management.test.ts` 守)。
+ 两半各自悬停、中缝那条线的几何由 `frontend/e2e/design.test.ts` 量 computed style 守。
"""
scan = self.read_react("library-processing/library-processing-card.tsx")
self.assertIn('<span data-button-group data-split-button data-variant="primary">', scan)
self.assertIn("{ label: '扫描并补全资料', icon: RiDatabase2Line, command: {} },", scan)
taste = self.read_react("taste/taste-page.tsx")
self.assertIn('<span data-button-group data-split-button data-variant="primary">', taste)
- board = (Path(__file__).resolve().parents[1] / "web/board.css").read_text(encoding="utf-8")
- self.assertIn("[data-split-button][data-button-group]>button+button::after{content:\"\";", board)
- self.assertIn("inset-block:0;left:0;width:1px;background:#fff", board)
- self.assertIn("[data-split-button][data-button-group]>button{position:relative;z-index:1;"
- "height:36px;border:0;border-radius:0;background:none!important", board)
- self.assertNotIn("[data-split-button][data-variant=primary]:hover", board)
def test_the_progress_bar_can_be_grabbed_well_above_the_coloured_line(self):
"""彩条 6px,命中区 18px,多出来的 12px 全在条上方。
@@ -5597,9 +5592,9 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains("followWorks=one('work');")
self.assertPageContains("wireDrag($('#stats').querySelector('.followworks'));")
# 两排的形归 board.css 同一份规则,关注页那两排跟着一起写进选择器。
- self.assertIn("#tiers .av,:is(.followauthors,.followworks) .av{display:flex;"
+ self.assertIn("#tiers .av,:is(.followauthors,.followworks,.relatedpeople) .av{display:flex;"
"flex-direction:column;align-items:center;gap:6px;width:76px;", board)
- self.assertIn("#tiers .av .ring,:is(.followauthors,.followworks) .av .ring"
+ self.assertIn("#tiers .av .ring,:is(.followauthors,.followworks,.relatedpeople) .av .ring"
"{width:48px;height:48px;", board)
self.assertIn(".followauthors .av .ring .favatar"
"{width:100%;height:100%;border-radius:0;object-fit:cover}", board)
@@ -6707,7 +6702,7 @@ class WebUiSourceTests(unittest.TestCase):
def test_entity_people_and_tags_match_home_vertical_rhythm(self):
# 同台艺人那条带是资料卡的卡脚:横滚的轨道吃掉整条宽度。
self.assertPageContains(".entityfoot{display:flex;align-items:center;gap:16px;min-width:0;padding:12px 20px;")
- self.assertPageContains(".relatedpeople{display:flex;flex:1;min-width:0;gap:12px;overflow-x:auto;scrollbar-width:none")
+ self.assertPageContains(".relatedpeople{display:flex;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none")
self.assertPageContains("height:var(--filterH);margin:0 -16px;padding:9px 16px")
def test_horizontal_avatar_rails_leave_room_for_the_hover_ring(self):
@@ -7268,11 +7263,11 @@ class WebUiSourceTests(unittest.TestCase):
self.assertIn(".idface:not(:has(img)){background:color-mix(in srgb,var(--color-text-primary) 10%,var(--color-background-primary-default));", board)
# 首页顶上两排:女优是竖排人像格(48px 圆头像在上、名字在下),厂牌是 40px 的灰 Pill(28px 圆标识在左)。
# 关注页那两排是同一个控件,所以每条规则都把它们一起写进选择器。
- self.assertIn("#tiers .av,:is(.followauthors,.followworks) .av{display:flex;flex-direction:column;align-items:center;gap:6px;width:76px;max-width:none;height:auto;padding:6px 4px;border-radius:12px;text-align:center}", board)
+ self.assertIn("#tiers .av,:is(.followauthors,.followworks,.relatedpeople) .av{display:flex;flex-direction:column;align-items:center;gap:6px;width:76px;max-width:none;height:auto;padding:6px 4px;border-radius:12px;text-align:center}", board)
self.assertIn("#tiers .brandpill,:is(.followauthors,.followworks) .brandpill{display:inline-flex;align-items:center;gap:8px;width:auto;max-width:none;height:40px;padding:6px 12px 6px 6px;border-radius:12px;text-align:left}", board)
- self.assertIn("#tiers .av .ring,:is(.followauthors,.followworks) .av .ring{width:48px;height:48px;", board)
+ self.assertIn("#tiers .av .ring,:is(.followauthors,.followworks,.relatedpeople) .av .ring{width:48px;height:48px;", board)
self.assertIn("#tiers .brandpill .mk,:is(.followauthors,.followworks) .brandpill .mk{width:28px;height:28px;", board)
- self.assertIn("#tiers .av .nm,:is(.followauthors,.followworks) .av .nm{display:block;max-width:100%;font:var(--board-caption);", board)
+ self.assertIn("#tiers .av .nm,:is(.followauthors,.followworks,.relatedpeople) .av .nm{display:block;max-width:100%;font:var(--board-caption);", board)
self.assertPageContains("const list=d.items.filter(x=>x.cost!=='metered' && x.duration && !sourceOffline(x.location));")
def test_toasts_leave_like_a_boardui_notification(self):
@@ -9180,7 +9175,7 @@ class WebUiSourceTests(unittest.TestCase):
".playerstats dd", ".playerstatsmetric>span",
# 详情标题折成两行,尾部省略;溢出时旁边那枚展开键给出全文。
".stitletext",
- ".relatedperson .nm", ".searchoption span",
+ ".searchoption span",
".sgrid.mixgrid>.mixqueue .mixqueuehead span", ".sidebarorderlabel>b",
".tastesummary>small",
".gselectfield>span",
@@ -9911,7 +9906,7 @@ class WebUiSourceTests(unittest.TestCase):
self.assertIn(".dnav button:active,.pill:active,.sorts button:active,.edge button:active{"
"scale:.96;transition:scale .06s ease-out}", board)
self.assertIn("#tiers .av:active,#tiers .brandpill:active,\n"
- ":is(.followauthors,.followworks) .av:active,"
+ ":is(.followauthors,.followworks,.relatedpeople) .av:active,"
":is(.followauthors,.followworks) .brandpill:active"
"{scale:.96;transition:scale .06s ease-out}", board)
self.assertIn("cursor:grab;transition:scale calc(var(--spring-press-ms) * 1ms) "
diff --git a/web/app.js b/web/app.js
index 21c29b6f3..c28115e89 100644
--- a/web/app.js
+++ b/web/app.js
@@ -4829,7 +4829,7 @@ const hasEntityPart=(kind,name,part)=>!!name&&!!entityShapes?.get(`${kind}/${fol
const feedNewSkeletonSection=()=>`<section class="feednew">${feedNewSkeletonHtml()}</section>`;
const COSTAR_SKELETON_PEOPLE=12;
const costarSkeletonFoot=()=>`<div class="entityfoot"><div class="relatedpeople">${
- '<span class="relatedperson avskeleton"><span class="ring"></span><span class="nm">&#8203;</span></span>'
+ '<span class="av avskeleton"><span class="ring"></span><span class="nm">&#8203;</span></span>'
.repeat(COSTAR_SKELETON_PEOPLE)}</div></div>`;
/* 最近一轮取封面断在连接上、这一行又还有没封面的卡时,行上方挂一条 Note 指去配连接方式。
@@ -4904,10 +4904,33 @@ function wireEntityFeed(entityId){
if(!toggle||!entityId)return;
const onPage=()=>$('#index').contains(toggle);
const label=toggle.closest('.entryfeed'),tip=label.querySelector('.entryfeedtip');
+ /* 说明浮层开着时在顶层,按视口定位:默认贴图标下方,下面放不下才翻到上方,左右夹在视口
+ 内 8px。开着的时候页面滚动或窗口改宽就重算,关掉或页面换走后那条监听自己摘掉。 */
+ const open=()=>tip.matches(':popover-open');
+ const place=()=>{
+ const anchor=label.getBoundingClientRect(),box=tip.getBoundingClientRect();
+ tip.style.left=`${Math.max(8,Math.min(innerWidth-box.width-8,anchor.left))}px`;
+ const below=anchor.bottom+8;
+ tip.style.top=`${below+box.height<=innerHeight-8?below:Math.max(8,anchor.top-box.height-8)}px`;
+ };
+ const follow=()=>{
+ if(tip.isConnected&&open()){place();return}
+ removeEventListener('scroll',follow,true);removeEventListener('resize',follow);
+ };
// Escape 只收起这一次;指针离开或焦点移走后,下一次悬停照常出现。
- toggle.addEventListener('keydown',event=>{if(event.key==='Escape')label.dataset.tipDismissed=''});
- const restore=()=>delete label.dataset.tipDismissed;
- label.addEventListener('pointerleave',restore);toggle.addEventListener('blur',restore);
+ let dismissed=false;
+ const showTip=()=>{
+ if(dismissed||open())return;
+ tip.showPopover();place();
+ addEventListener('scroll',follow,{capture:true,passive:true});addEventListener('resize',follow,{passive:true});
+ };
+ const hideTip=()=>{if(open())tip.hidePopover()};
+ const restore=()=>{dismissed=false;hideTip()};
+ toggle.addEventListener('keydown',event=>{if(event.key==='Escape'){dismissed=true;hideTip()}});
+ label.addEventListener('pointerenter',showTip);
+ toggle.addEventListener('focus',()=>{if(toggle.matches(':focus-visible'))showTip()});
+ label.addEventListener('pointerleave',()=>{if(!toggle.matches(':focus-visible'))restore()});
+ toggle.addEventListener('blur',restore);
const write=async on=>{
setActionBusy(toggle);
try{
@@ -4918,7 +4941,7 @@ function wireEntityFeed(entityId){
}catch(error){
toggle.checked=!on;actionFailure(on?'订阅新作':'取消订阅新作',error);
return false;
- }finally{setActionBusy(toggle,false);tip.textContent=entityFeedTip(toggle.checked)}
+ }finally{setActionBusy(toggle,false);tip.textContent=entityFeedTip(toggle.checked);if(open())place()}
};
const refreshAfterCheck=async()=>{
for(let tries=0;tries<ENTITY_FEED_WAIT_TRIES&&onPage();tries+=1){
@@ -8316,15 +8339,15 @@ async function openEntity(kind,name,push=true){
}${x.ordinal?`<span class="entryordinal">${esc(x.ordinal)}</span>`:''}<span class="sr-only">${esc(x.label)}</span></a>`
).join('')+(d.feed?`<label class="entryfeed">${icon('rss')}<input type="checkbox"
class="sr-only" role="switch" aria-label="订阅新作" aria-describedby="entityFeedTip" data-entity-feed ${d.feed.following?'checked':''}><span
- class="entryfeedtip" role="tooltip" id="entityFeedTip">${entityFeedTip(d.feed.following)}</span></label>`:'');
+ class="entryfeedtip" role="tooltip" id="entityFeedTip" popover="manual">${entityFeedTip(d.feed.following)}</span></label>`:'');
const tags=(d.tags||[]).map(x=>filterChipHtml(tagLabel(x.k),{attr:'data-entity-tag',value:x.k,selected:tagPressed(filters.tag,x.k),count:x.n.toLocaleString()})).join('');
/* 事务所名下的这批人不摆在这排小圆头像里:那是「同台艺人」,一条附注;名册是这一页
的正文,占的是下面那整块。所以同一份 `related_performers` 在事务所页走另一条路。
片商页的名册是旗下 label(`d.labels`),同台艺人那排照旧留在卡底。 */
const roster=kind==='agency'?(d.related_performers||[]):kind==='studio'?(d.labels||[]):[];
entityRoster=roster;entityRosterKind=kind==='studio'?'studio':'performer';
- const related=kind==='agency'?'':(d.related_performers||[]).map(x=>`<button class="relatedperson" data-related-performer="${esc(x.k)}">
- <span class="ring"><span>${esc(x.k.slice(0,1))}</span>${entityFaceImg(
+ const related=kind==='agency'?'':(d.related_performers||[]).map(x=>`<button class="av" data-related-performer="${esc(x.k)}">
+ <span class="ring"><span class="ini">${esc(x.k.slice(0,1))}</span>${entityFaceImg(
{id:x.id,hasImage:x.has_image,rep:x.has_avatar?x.rep:null,
style:facePos(x.avatar_focus),focus:x.avatar_focus})}</span>
<span class="nm">${esc(x.k)}</span></button>`).join('');
diff --git a/web/board.css b/web/board.css
index 4b1ed0f07..fc5f255e3 100644
--- a/web/board.css
+++ b/web/board.css
@@ -1358,21 +1358,30 @@ body [data-board-tabs] button[aria-selected=true],body .managebar [data-board-ta
@media(prefers-reduced-motion:reduce){[data-board-tabs].board-tabs-ready::before{transition:none}}
.followmanage .fsource:has([data-follow-select]){background:var(--color-background-primary-default)}
.followmanage .fsource.selected:has([data-follow-select]){border-color:var(--color-border-focus-ring)}
-/* 两半之间的线独立盖在右半左缘,上下顶满;两颗 Button 自己不再画悬停层,
- 整组 hover 保持原蓝色,鼠标跨过中缝也不会一明一暗。 */
+/* Split Button 照 Geist 实测(`vercel-geist-split-button.md`「悬停」):两半各是一颗
+ 带自己填充的按钮,整组只管并排和外圆角,悬停只抬指针下那一半——抬的那一层就是
+ `bg-button-primary` 自己的 `::before` 淡入。中缝那条 1px 线是触发档的 `::after`,
+ `left:-1px` 盖在主动作最后一列上、上下顶满;它排在后面的那颗里,所以谁在悬停都压在
+ 两半上面,颜色也不跟着变。线取悬停那一档的起始色(Geist 的线与它的悬停填充同一档灰)。
+ 主动作那条要自己写底色与字色:同组更宽的通用 hover 会把底换成灰、字换成墨色。
+ BoardUI 的 Button 自带 `overflow-hidden`,会把伸出左缘那 1px 裁掉,两半都放开;外圆角
+ 由按钮组那一层裁。 */
[data-split-button][data-button-group]{position:relative;isolation:isolate}
-[data-split-button][data-button-group]>button{position:relative;z-index:1;height:36px;border:0;border-radius:0;background:none!important;box-shadow:none}
-[data-split-button][data-button-group]>button::before{display:none!important}
-[data-split-button][data-button-group]>button+button{position:relative;border-left:0}
-[data-split-button][data-button-group]>button+button::after{content:"";position:absolute;z-index:2;inset-block:0;left:0;width:1px;background:#fff;pointer-events:none}
-[data-split-button][data-variant=primary]{border:0;background:var(--board-blue);box-shadow:none}
-[data-split-button][data-variant=primary]:has(>button:active){background:var(--board-blue-active)}
-[data-split-button][data-variant=primary]>button{color:#fff}
+[data-split-button][data-button-group]>button{position:relative;z-index:1;height:36px;border:0;border-radius:0;box-shadow:none;overflow:visible}
+[data-split-button][data-button-group]>button+button{border-left:0}
+[data-split-button][data-button-group]>button+button::after{content:"";position:absolute;z-index:2;inset-block:0;left:-1px;width:1px;background:var(--split-seam);pointer-events:none}
+[data-split-button][data-variant=primary]{--split-seam:var(--color-accent-400);border:0;background:none;box-shadow:none}
+[data-split-button][data-variant=primary]>button:not(:disabled){background:var(--board-blue);color:#fff}
+[data-split-button][data-variant=primary]>button:not(:disabled,[aria-disabled=true]):active{background:var(--board-blue-active)}
[data-split-button][data-variant=primary]>button:last-child{width:36px;padding:8px}
-/* React 卡片骨架里等数据的主按钮:`bg-button-primary` 遇到 `aria-disabled` 换成禁用渐变,
- 骨架要的是接管后那一档静止面,数据一到只是解锁,不换颜色。选择器只认属性不认类名:
- 旧样式表里写 React 的工具类名会被 legacy-class-names 拒收。 */
-.peach-react [data-skeleton-action][aria-disabled]{background-image:var(--gradient-button-primary-default);color:var(--color-text-white)}
+/* 骨架里等数据的键(`data-skeleton-action`,原生 `disabled`)不管哪一档都是同一副禁用面:
+ `--surface` 底、一圈 `--border-15`、`--muted` 字,不靠 opacity。属性写两遍是为了压过
+ 同组更宽的 hover 与各档自己的 `:disabled`,这一类规则都排在它前面。
+ 拆分按钮那一圈画在整组上,两半各自不描边,中缝退成同一色的线。 */
+body [data-skeleton-action][data-skeleton-action]:disabled{background:var(--surface);border-color:transparent;box-shadow:0 0 0 1px var(--border-15);color:var(--muted);cursor:not-allowed;opacity:1}
+body [data-skeleton-action][data-skeleton-action]:disabled::before{display:none}
+body [data-split-button]>[data-skeleton-action][data-skeleton-action]:disabled{box-shadow:none}
+[data-split-button]:has(>[data-skeleton-action]:disabled){--split-seam:var(--border-15);box-shadow:0 0 0 1px var(--border-15)}
body [data-cleanup-empty][hidden]{display:none}
body .junkactions button:not(.danger){height:36px;border:1px solid var(--color-border-button-default);border-radius:10px;padding:8px 12px;background:var(--color-background-primary-default);color:var(--ink);box-shadow:var(--elevation-xs);font:var(--board-body-medium)}
body [data-follow-bulk],body [data-follow-status=seen],body [data-follow-status=ignored]{background:color-mix(in srgb,var(--color-accent-400) 16%,var(--color-background-primary-default));color:var(--color-accent-600);border-color:transparent}
@@ -1499,25 +1508,26 @@ body .followmanage .board-pagination>.geist-button{height:32px;min-height:32px;p
/* 关注页顶上那两排跟首页这两排是同一个控件,所以规则一份写全:那边是「谁出的」加
「哪个厂牌」,这边是「谁发的」加「哪部作品」,人在两页看到的该是同一种东西。它们
住在 `#stats` 里而不是 `#tiers` 里,只按 id 写的话关注页拿不到这一整套,落回 flat
- 层那份 64px 头像加一圈描边,同一个人在两页大小和选中样子都不一样。 */
+ 层那份 64px 头像加一圈描边,同一个人在两页大小和选中样子都不一样。人物页资料卡底
+ 那排同台艺人也是这一枚女优头像,同一套规则:悬停抬整格底色,不在圆上描圈。 */
#tiers .av,#tiers .brandpill,
-:is(.followauthors,.followworks) .av,:is(.followauthors,.followworks) .brandpill{flex:none;border:0;background:transparent;color:var(--color-text-secondary);font:var(--board-body-medium);white-space:nowrap;transition:transform var(--lift-motion,var(--board-motion)),scale calc(var(--spring-press-ms) * 1ms) var(--spring-press),background-color .2s ease-out,color .2s ease-out}
+:is(.followauthors,.followworks,.relatedpeople) .av,:is(.followauthors,.followworks) .brandpill{flex:none;border:0;background:transparent;color:var(--color-text-secondary);font:var(--board-body-medium);white-space:nowrap;transition:transform var(--lift-motion,var(--board-motion)),scale calc(var(--spring-press-ms) * 1ms) var(--spring-press),background-color .2s ease-out,color .2s ease-out}
#tiers .av:active,#tiers .brandpill:active,
-:is(.followauthors,.followworks) .av:active,:is(.followauthors,.followworks) .brandpill:active{scale:.96;transition:scale .06s ease-out}
-#tiers .av,:is(.followauthors,.followworks) .av{display:flex;flex-direction:column;align-items:center;gap:6px;width:76px;max-width:none;height:auto;padding:6px 4px;border-radius:12px;text-align:center}
+:is(.followauthors,.followworks,.relatedpeople) .av:active,:is(.followauthors,.followworks) .brandpill:active{scale:.96;transition:scale .06s ease-out}
+#tiers .av,:is(.followauthors,.followworks,.relatedpeople) .av{display:flex;flex-direction:column;align-items:center;gap:6px;width:76px;max-width:none;height:auto;padding:6px 4px;border-radius:12px;text-align:center}
#tiers .brandpill,:is(.followauthors,.followworks) .brandpill{display:inline-flex;align-items:center;gap:8px;width:auto;max-width:none;height:40px;padding:6px 12px 6px 6px;border-radius:12px;text-align:left}
#tiers .av:hover,#tiers .brandpill:hover,
-:is(.followauthors,.followworks) .av:hover,:is(.followauthors,.followworks) .brandpill:hover{background:var(--color-background-primary-hover);color:var(--color-text-primary);border-color:transparent}
+:is(.followauthors,.followworks,.relatedpeople) .av:hover,:is(.followauthors,.followworks) .brandpill:hover{background:var(--color-background-primary-hover);color:var(--color-text-primary);border-color:transparent}
#tiers .av[aria-pressed="true"],#tiers .brandpill[aria-pressed="true"],
-:is(.followauthors,.followworks) .av[aria-pressed="true"],:is(.followauthors,.followworks) .brandpill[aria-pressed="true"]{background:var(--color-background-tertiary-default);color:var(--color-text-primary);border-color:transparent}
+:is(.followauthors,.followworks,.relatedpeople) .av[aria-pressed="true"],:is(.followauthors,.followworks) .brandpill[aria-pressed="true"]{background:var(--color-background-tertiary-default);color:var(--color-text-primary);border-color:transparent}
#tiers .av .ring,#tiers .brandpill .mk,
-:is(.followauthors,.followworks) .av .ring,:is(.followauthors,.followworks) .brandpill .mk{position:relative;flex:none;margin:0;border-radius:50%;overflow:hidden;background:color-mix(in srgb,var(--color-text-primary) 10%,var(--color-background-primary-default));color:var(--color-text-secondary)}
-#tiers .av .ring,:is(.followauthors,.followworks) .av .ring{width:48px;height:48px;font:600 18px/24px var(--board-font)}
+:is(.followauthors,.followworks,.relatedpeople) .av .ring,:is(.followauthors,.followworks) .brandpill .mk{position:relative;flex:none;margin:0;border-radius:50%;overflow:hidden;background:color-mix(in srgb,var(--color-text-primary) 10%,var(--color-background-primary-default));color:var(--color-text-secondary)}
+#tiers .av .ring,:is(.followauthors,.followworks,.relatedpeople) .av .ring{width:48px;height:48px;font:600 18px/24px var(--board-font)}
#tiers .brandpill .mk,:is(.followauthors,.followworks) .brandpill .mk{width:28px;height:28px;font:600 12px/16px var(--board-font)}
-#tiers .av .ring .ini,:is(.followauthors,.followworks) .av .ring .ini{font:inherit;color:inherit}
+#tiers .av .ring .ini,:is(.followauthors,.followworks,.relatedpeople) .av .ring .ini{font:inherit;color:inherit}
#tiers .av:hover .ring,#tiers .av[aria-pressed="true"] .ring,
-:is(.followauthors,.followworks) .av:hover .ring,:is(.followauthors,.followworks) .av[aria-pressed="true"] .ring{box-shadow:none}
-#tiers .av .nm,:is(.followauthors,.followworks) .av .nm{display:block;max-width:100%;font:var(--board-caption);color:inherit;text-align:center;overflow:hidden;text-overflow:ellipsis}
+:is(.followauthors,.followworks,.relatedpeople) .av:hover .ring,:is(.followauthors,.followworks,.relatedpeople) .av[aria-pressed="true"] .ring{box-shadow:none}
+#tiers .av .nm,:is(.followauthors,.followworks,.relatedpeople) .av .nm{display:block;max-width:100%;font:var(--board-caption);color:inherit;text-align:center;overflow:hidden;text-overflow:ellipsis}
/* 关注页的头像是张外站图,自己带着 64px 的身量;圆头像的尺寸归上面那一格,它只负责
把那一格填满。 */
.followauthors .av .ring .favatar{width:100%;height:100%;border-radius:0;object-fit:cover}
@@ -1526,7 +1536,7 @@ body .followmanage .board-pagination>.geist-button{height:32px;min-height:32px;p
一个 28px 的圆出来常常只剩一截身子。检出了脸的图由服务端把取景写进 img 自己的
style,这里这一档只管没检出脸的那些——上四分之一是人像里头最常落的位置。 */
.followworks .brandpill .mk img{object-position:50% 25%}
-:is(.followauthors,.followworks){gap:4px;align-items:center}
+:is(.followauthors,.followworks,.relatedpeople){gap:4px;align-items:center}
.followworks{padding:0 0 10px;margin:0 0 2px;overscroll-behavior-inline:contain}
/* ── 关注列表整段进框,与「添加关注」同一只卡:头 20/24/8,选择栏与列表左右 24,脚是卡片脚 ──
diff --git a/web/css/07-entity.css b/web/css/07-entity.css
index bbf7e49ce..b07d33837 100644
--- a/web/css/07-entity.css
+++ b/web/css/07-entity.css
@@ -107,12 +107,15 @@
.entryfeed:not(:has(:checked)){animation:entryfeed-breathe 2.4s ease-in-out infinite}
.entryfeed:not(:has(:checked)):is(:hover,:has(:focus-visible)){animation:none;color:var(--feed-mark)}
/* 图标的说明走 Tooltip(Geist 实测:最宽 250px、8px 圆角、内边距 8/6px、13px 字、
- 1.3 行高),不复制箭头与淡入。悬停和键盘聚焦都出,Escape 收起。 */
-.entryfeedtip{position:absolute;z-index:var(--layer-tooltip);top:calc(100% + 8px);left:0;
- display:none;width:max-content;max-width:250px;padding:6px 8px;border-radius:var(--surface-radius);
+ 1.3 行高),不复制箭头与淡入。悬停和键盘聚焦都出,Escape 收起。
+ 它是 `popover`,开着的时候进顶层:资料卡为了裁底带直角带着 `overflow:hidden`,写在卡里的
+ 绝对定位浮层在窄屏上会被右缘切掉一截,顶层既不受祖先裁切,也不会被下方同台艺人那条
+ 压住。位置由 `wireEntityFeed` 按视口算:默认贴图标下方 8px、左右夹在视口内 8px。
+ 浏览器给 `[popover]` 的居中盒子在这里拆掉。 */
+.entryfeedtip{position:fixed;z-index:var(--layer-tooltip);inset:auto;margin:0;border:0;overflow:visible;
+ width:max-content;max-width:250px;padding:6px 8px;border-radius:var(--surface-radius);
background:var(--ink);color:var(--ground);font-size:var(--fs-sm);font-weight:400;line-height:1.3;
white-space:normal;pointer-events:none}
-.entryfeed:is(:hover,:has(:focus-visible)):not([data-tip-dismissed])>.entryfeedtip{display:block}
/* 两枚标识按字母的高度对齐,不按外框:JavDB 那枚里 `Jav` 三个字母占 viewBox 高的
71/111,高 22px 时是 14.1px;MISSAV 是排出来的字,衬线体的大写字母高约 0.71em,
`--fs-xl` 时是 14.2px。外框对齐的话 MISSAV 的字母比 `Jav` 高出两成,一眼看过去它大一号。
@@ -158,13 +161,10 @@
.mediaviewbuttons .mediaviewbutton[data-media-icon="image"] svg{fill:currentColor;stroke:none}
.mediaviewbuttons .mediaviewbutton:hover{color:var(--ink)}
.mediaviewbuttons .mediaviewbutton[aria-pressed="true"]{background:var(--picked);color:var(--ink)}
-.relatedpeople{display:flex;flex:1;min-width:0;gap:12px;overflow-x:auto;scrollbar-width:none;overscroll-behavior-inline:contain}
-.relatedpeople::-webkit-scrollbar{display:none}.relatedperson{flex:0 0 64px;border:0;background:transparent;color:inherit;
- padding:0;cursor:pointer;text-align:center}.relatedperson .ring{display:grid;place-items:center;width:48px;height:48px;
- margin:0 auto 5px;border-radius:50%;overflow:hidden;background:var(--overlay-5);color:var(--muted);position:relative}
-.relatedperson img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.relatedperson .nm{display:block;
- overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--fs-xs)}
-.relatedperson:hover .ring{box-shadow:0 0 0 1px var(--border-15)}
+/* 每一枚就是首页那枚 `.av` 女优头像,尺寸、间距与悬停都归 `board.css` 那套共享规则;
+ 这里只管横滚轨道本身。 */
+.relatedpeople{display:flex;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none;overscroll-behavior-inline:contain}
+.relatedpeople::-webkit-scrollbar{display:none}
.entitysection{min-width:0;max-width:100%}.entitysection h3{font-size:var(--fs-sm);letter-spacing:.08em;color:var(--muted);margin:0 0 12px}
.entitycollectionhead{position:sticky;top:var(--topH);z-index:60;display:flex;align-items:center;gap:10px;
min-height:var(--sortH);margin:0 -16px 12px;padding:8px 16px;min-width:0;
diff --git a/web/css/09-skeleton.css b/web/css/09-skeleton.css
index a38a20a23..45e045a5f 100644
--- a/web/css/09-skeleton.css
+++ b/web/css/09-skeleton.css
@@ -206,6 +206,13 @@ body.refreshing #tiers .av .ring.imgdone::after{opacity:1;filter:none;visibility
/* 顶部三层第一次填内容之前只有 18px 的内边距,内容到位后长到一百多,
每次冷启动都把整页往下推一截;标签条有固定高度不塌,但空着一整条。 */
.tiers[aria-busy="true"],.tagbar[aria-busy="true"]{pointer-events:none}
+/* 占位不是控件:整块骨架和每一枚占位都不接指针,套在最终形状上的 hover 描边、底色和
+ 手型光标也就一条都触发不了,点下去落到后面的页面上。占位直接借用 `.av`、`.pill` 这些
+ 最终类名画形状,所以只能在这里一处关掉,不能逐条给 hover 规则补 `:not()`。
+ 分层骨架只认每一枚占位:`data-skeleton-tier` 那一排数据到了还留在原地装真头像。
+ 等数据的键(`data-skeleton-action`)是例外,它要亮出 not-allowed 光标说明「现在按不了」。 */
+:is([data-skeleton],.avskeleton,.brandskeleton),:is([data-skeleton],.avskeleton,.brandskeleton) *,.tagskeleton,.countskeleton,.skeletoncard,.skeleton{pointer-events:none}
+[data-skeleton-action]:disabled{pointer-events:auto}
/* 换一批时标签条走 Geist 的 wrap-children 变体:真实胶囊留在 DOM 里,用 visibility
藏起来,微光画在 ::after 上并单独 visible。框就是胶囊自己的框,所以零位移;
diff --git a/web/dist/peach-ui.js b/web/dist/peach-ui.js
index 5d698e79b..9c6af6e6a 100644
--- a/web/dist/peach-ui.js
+++ b/web/dist/peach-ui.js
@@ -439,28 +439,28 @@ function ve(e, t) {
}
//#endregion
//#region src/island-skeleton.ts
-var ye = "inline-flex items-center justify-center gap-0.5 whitespace-nowrap overflow-hidden font-sans", D = {
+var ye = "inline-flex items-center justify-center gap-0.5 whitespace-nowrap overflow-hidden font-sans", be = {
medium: "h-9 rounded-2lg p-2 text-body-medium",
small: "h-8 rounded-lg px-2 py-1.5 text-body-medium"
-}, be = {
- medium: D.medium,
- small: "size-8 rounded-lg p-0 text-body-medium"
}, xe = {
+ medium: be.medium,
+ small: "size-8 rounded-lg p-0 text-body-medium"
+}, Se = {
medium: "size-5 shrink-0",
small: "size-[18px] shrink-0"
-}, Se = {
+}, Ce = {
medium: "inline-flex items-center justify-center px-1 shrink-0",
small: "inline-flex items-center justify-center px-0.5 shrink-0"
-}, Ce = {
+}, we = {
primary: "bg-button-primary text-text-white shadow-xs",
secondary: "bg-background-primary-default text-text-primary border border-border-button-default shadow-xs",
ghost: "bg-button-ghost-background text-button-ghost-foreground"
-}, O = (e, t) => `<svg class="${t}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><use href="#i-${e}"/></svg>`;
-function k({ variant: e = "primary", size: t = "medium", glyph: n, label: r, attrs: i = "", compact: a = !1 }) {
- let o = r ? D[t] : be[t], s = n ? O(n, xe[t]) : "", c = r ? `<span class="${Se[t]}"${a ? " data-compact-label" : ""}>${r}</span>` : "";
- return `<button type="button" class="${ye} ${o} ${Ce[e]}"${i ? ` ${i}` : ""}>${s}${c}</button>`;
+}, D = (e, t) => `<svg class="${t}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><use href="#i-${e}"/></svg>`;
+function O({ variant: e = "primary", size: t = "medium", glyph: n, label: r, attrs: i = "", compact: a = !1 }) {
+ let o = r ? be[t] : xe[t], s = n ? D(n, Se[t]) : "", c = r ? `<span class="${Ce[t]}"${a ? " data-compact-label" : ""}>${r}</span>` : "";
+ return `<button type="button" class="${ye} ${o} ${we[e]}"${i ? ` ${i}` : ""}>${s}${c}</button>`;
}
-var we = {
+var Te = {
md: {
box: "gap-1.5 px-2.5 py-2 text-body-medium",
value: "gap-[5px]",
@@ -472,74 +472,81 @@ var we = {
chevron: "size-3.5"
}
};
-function A(e, { size: t = "md", className: n = "", attrs: r = "" } = {}) {
- let i = we[t];
- return `<div class="group flex flex-col${n ? ` ${n}` : ""}"><button type="button" aria-haspopup="listbox"${r ? ` ${r}` : ""} class="flex w-full items-center justify-between rounded-2lg border border-border-button-default bg-background-primary-default shadow-xs text-text-primary ${i.box}"><span class="flex min-w-0 items-center truncate ${i.value}">${e}</span>${O("chevron-down", `shrink-0 text-text-secondary ${i.chevron}`)}</button></div>`;
+function k(e, { size: t = "md", className: n = "", attrs: r = "" } = {}) {
+ let i = Te[t];
+ return `<div class="group flex flex-col${n ? ` ${n}` : ""}"><button type="button" aria-haspopup="listbox"${r ? ` ${r}` : ""} class="flex w-full items-center justify-between rounded-2lg border border-border-button-default bg-background-primary-default shadow-xs text-text-primary ${i.box}"><span class="flex min-w-0 items-center truncate ${i.value}">${e}</span>${D("chevron-down", `shrink-0 text-text-secondary ${i.chevron}`)}</button></div>`;
}
//#endregion
//#region src/board-skeleton.ts
-var j = (e = "60%") => `<span class="skeleton" style="width:${e}"></span>`, M = () => `${j("80%")}${j("48%")}`, N = (e, t) => e.repeat(t), P = (e, t = "metricstrip") => `<div class="${t}">${e.map((e) => `<div class="tastesummary"><span class="board-stat-label">${e}</span><b class="board-stat-value">${j("45%")}</b><small class="board-stat-footer">${j("60%")}</small></div>`).join("")}</div>`, Te = (e, t = "skeleton-tabs") => `<div class="${t}">${e.map((e) => `<span>${e}</span>`).join("")}</div>`, Ee = (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>`, F = (e) => `<section class="insightpanel"><header>${e}</header><div class="insightpanelbody skeleton-lines">${N(M(), 3)}</div></section>`, I = (e) => `<span class="skeleton skeleton-text" style="width:${e}"></span>`, L = (e, t, n = !1) => `<span class="skeleton" style="width:${e}px;height:${t}px;flex:none${n ? ";border-radius:50%" : ""}"></span>`, De = "min-w-0 bg-background-secondary-default rounded-2xl shadow-card flex flex-col gap-3 px-6 py-5 max-sm:gap-2 max-sm:p-4", Oe = () => `<div class="inline-grid w-full grid-cols-2 gap-3 sm:gap-4 lg:grid-cols-4">${[
+var A = (e = "60%") => `<span class="skeleton" style="width:${e}"></span>`, j = () => `${A("80%")}${A("48%")}`, M = (e, t) => e.repeat(t), N = (e, t = "metricstrip") => `<div class="${t}">${e.map((e) => `<div class="tastesummary"><span class="board-stat-label">${e}</span><b class="board-stat-value">${A("45%")}</b><small class="board-stat-footer">${A("60%")}</small></div>`).join("")}</div>`, Ee = (e, t = "skeleton-tabs") => `<div class="${t}">${e.map((e) => `<span>${e}</span>`).join("")}</div>`, De = (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>`, P = (e) => `<section class="insightpanel"><header>${e}</header><div class="insightpanelbody skeleton-lines">${M(j(), 3)}</div></section>`, F = "disabled data-skeleton-action", I = (e) => `<span class="skeleton skeleton-text" style="width:${e}"></span>`, L = (e, t, n = !1) => `<span class="skeleton" style="width:${e}px;height:${t}px;flex:none${n ? ";border-radius:50%" : ""}"></span>`, Oe = "min-w-0 bg-background-secondary-default rounded-2xl shadow-card flex flex-col gap-3 px-6 py-5 max-sm:gap-2 max-sm:p-4", ke = () => `<div class="inline-grid w-full grid-cols-2 gap-3 sm:gap-4 lg:grid-cols-4">${[
"关注创作者",
"启用来源",
"检查失败",
"未看更新"
-].map((e) => `<div class="${De}"><span class="text-body-medium text-text-secondary">${e}</span><b class="text-title-1-medium tabular-nums text-text-primary">${I("3em")}</b></div>`).join("")}</div>`, ke = "flex min-h-7 flex-none items-center gap-1.5 rounded-md px-2.5 py-1 text-body-medium whitespace-nowrap text-text-secondary data-selected:bg-background-primary-default data-selected:text-text-primary data-selected:shadow-card dark:data-selected:bg-background-primary-hover", Ae = () => `<div class="inline-flex w-max max-w-full items-center gap-0.5 overflow-x-auto overscroll-x-contain rounded-2lg bg-background-tertiary-default p-1">${[
+].map((e) => `<div class="${Oe}"><span class="text-body-medium text-text-secondary">${e}</span><b class="text-title-1-medium tabular-nums text-text-primary">${I("3em")}</b></div>`).join("")}</div>`, Ae = "flex min-h-7 flex-none items-center gap-1.5 rounded-md px-2.5 py-1 text-body-medium whitespace-nowrap text-text-secondary data-selected:bg-background-primary-default data-selected:text-text-primary data-selected:shadow-card dark:data-selected:bg-background-primary-hover", je = () => `<div class="inline-flex w-max max-w-full items-center gap-0.5 overflow-x-auto overscroll-x-contain rounded-2lg bg-background-tertiary-default p-1">${[
"关注列表",
"添加关注",
"订阅源",
"来源和凭证"
-].map((e, t) => `<span class="${ke}"${t === 0 ? " data-selected=\"true\"" : ""}>${e}</span>`).join("")}</div>`, R = (e = "") => `<span class="group inline-flex items-center select-none gap-2"><span class="flex shrink-0 items-center justify-center rounded-sm size-4 border bg-background-primary-default shadow-xs border-border-checkbox-default"></span>${e ? `<span class="text-body-medium text-text-primary">${e}</span>` : ""}</span>`, je = ({ table: e, sort: t, dir: n }) => {
+].map((e, t) => `<span class="${Ae}"${t === 0 ? " data-selected=\"true\"" : ""}>${e}</span>`).join("")}</div>`, R = (e = "") => `<span class="group inline-flex items-center select-none gap-2"><span class="flex shrink-0 items-center justify-center rounded-sm size-4 border bg-background-primary-default shadow-xs border-border-checkbox-default"></span>${e ? `<span class="text-body-medium text-text-primary">${e}</span>` : ""}</span>`, Me = ({ table: e, sort: t, dir: n }) => {
let r = E.find(([e]) => e === t)[1];
- return `<div class="flex flex-wrap items-center gap-2 follow-skeleton-toolbar"><h3 class="mr-auto text-title-2-medium text-text-primary">关注列表</h3><span class="text-body-2-regular text-text-secondary">${I("132px")}</span>${k({
+ return `<div class="flex flex-wrap items-center gap-2 follow-skeleton-toolbar"><h3 class="mr-auto text-title-2-medium text-text-primary">关注列表</h3><span class="text-body-2-regular text-text-secondary">${I("132px")}</span>${O({
glyph: "refresh-cw",
label: "检查全部",
- compact: !0
- })}<span data-button-group role="group">${k({
+ compact: !0,
+ attrs: F
+ })}<span data-button-group role="group">${O({
variant: "ghost",
glyph: "layout-grid",
attrs: `aria-pressed="${!e}"`
- })}${k({
+ })}${O({
variant: "ghost",
glyph: "table",
attrs: `aria-pressed="${e}"`
- })}</span>${A(r)}${k({
+ })}</span>${k(r)}${O({
variant: "secondary",
glyph: n === "asc" ? "arrow-up" : "arrow-down"
- })}${e ? "" : k({
+ })}${e ? "" : O({
variant: "secondary",
glyph: "chevron-up",
label: "全部收起",
- compact: !0
+ compact: !0,
+ attrs: F
})}</div>`;
-}, z = () => `<span class="flex shrink-0 items-center gap-1">${k({
+}, z = () => `<span class="flex shrink-0 items-center gap-1">${O({
variant: "secondary",
size: "small",
- glyph: "refresh-cw"
-})}${k({
+ glyph: "refresh-cw",
+ attrs: F
+})}${O({
variant: "secondary",
size: "small",
- glyph: "trash"
-})}</span>`, Me = () => `<div class="flex min-h-16 flex-wrap items-center gap-3 px-2 py-3 follow-skeleton-source">${R()}<span class="flex min-w-0 grow flex-col gap-0.5"><span class="text-body-medium">${I("8em")}</span></span><span class="flex shrink-0 items-center gap-1.5">${L(14, 14)}</span>${L(48, 24)}<span class="shrink-0 text-body-2-regular whitespace-nowrap text-text-secondary">${I("113px")}</span>${z()}</div>`, B = (e) => `<section class="min-w-0 bg-background-primary-default rounded-2xl shadow-card flex flex-col overflow-hidden p-2 follow-skeleton-author"><div class="flex flex-wrap items-center gap-3 px-2 py-2.5" data-follow-author-header data-open>${L(32, 32, !0)}<b class="min-w-0 grow text-body-medium break-words text-text-primary">${I("92px")}</b>${k({
+ glyph: "trash",
+ attrs: F
+})}</span>`, Ne = () => `<div class="flex min-h-16 flex-wrap items-center gap-3 px-2 py-3 follow-skeleton-source">${R()}<span class="flex min-w-0 grow flex-col gap-0.5"><span class="text-body-medium">${I("8em")}</span></span><span class="flex shrink-0 items-center gap-1.5">${L(14, 14)}</span>${L(48, 24)}<span class="shrink-0 text-body-2-regular whitespace-nowrap text-text-secondary">${I("113px")}</span>${z()}</div>`, B = (e) => `<section class="min-w-0 bg-background-primary-default rounded-2xl shadow-card flex flex-col overflow-hidden p-2 follow-skeleton-author"><div class="flex flex-wrap items-center gap-3 px-2 py-2.5" data-follow-author-header data-open>${L(32, 32, !0)}<b class="min-w-0 grow text-body-medium break-words text-text-primary">${I("92px")}</b>${O({
variant: "secondary",
size: "small",
- glyph: "refresh-cw"
-})}<span class="flex shrink-0 items-center gap-1">${L(14, 14)}${L(14, 14)}</span>${k({
+ glyph: "refresh-cw",
+ attrs: F
+})}<span class="flex shrink-0 items-center gap-1">${L(14, 14)}${L(14, 14)}</span>${O({
variant: "secondary",
size: "small",
glyph: "check-check",
- label: "全选"
-})}${k({
+ label: "全选",
+ attrs: F
+})}${O({
variant: "secondary",
size: "small",
glyph: "chevron-up",
- label: "收起"
-})}</div><div data-source-divider>${N(Me(), e)}</div></section>`, Ne = () => {
+ label: "收起",
+ attrs: F
+})}</div><div data-source-divider>${M(Ne(), e)}</div></section>`, Pe = () => {
try {
return Number(JSON.parse(localStorage.getItem("peach.settings.v1") || "{}").followPageSize) || 20;
} catch {
return 20;
}
-}, Pe = [
+}, Fe = [
["select", ""],
["author", "创作者"],
["source", "来源"],
@@ -547,13 +554,13 @@ var j = (e = "60%") => `<span class="skeleton" style="width:${e}"></span>`, M =
["status", "状态"],
["checked", "上次检查"],
["actions", ""]
-], Fe = {
+], Ie = {
name: "author",
source: "source",
provider: "provider",
status: "status",
checked: "checked"
-}, Ie = "<svg viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\"><path d=\"M12.7071 15.2929C12.3166 15.6834 11.6834 15.6834 11.2929 15.2929L7.70711 11.7071C7.07714 11.0771 7.52331 10 8.41421 10H15.5858C16.4767 10 16.9229 11.0771 16.2929 11.7071L12.7071 15.2929Z\" fill=\"currentColor\"/></svg>", Le = (e, { sort: t, dir: n }) => `<div data-board-data-table data-follow-table class="follow-skeleton-table"><div class="w-full overflow-x-auto"><table class="bui-table bui-table-sm"><thead><tr>${Pe.map(([e, r]) => r ? `<th><span class="flex items-center gap-0.5">${r}<span data-sort-indicator${Fe[t] === e ? ` data-direction="${n === "asc" ? "ascending" : "descending"}"` : ""}>${Ie}</span></span></th>` : "<th></th>").join("")}</tr></thead><tbody>${N(`<tr>${[
+}, Le = "<svg viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\"><path d=\"M12.7071 15.2929C12.3166 15.6834 11.6834 15.6834 11.2929 15.2929L7.70711 11.7071C7.07714 11.0771 7.52331 10 8.41421 10H15.5858C16.4767 10 16.9229 11.0771 16.2929 11.7071L12.7071 15.2929Z\" fill=\"currentColor\"/></svg>", Re = (e, { sort: t, dir: n }) => `<div data-board-data-table data-follow-table class="follow-skeleton-table"><div class="w-full overflow-x-auto"><table class="bui-table bui-table-sm"><thead><tr>${Fe.map(([e, r]) => r ? `<th><span class="flex items-center gap-0.5">${r}<span data-sort-indicator${Ie[t] === e ? ` data-direction="${n === "asc" ? "ascending" : "descending"}"` : ""}>${Le}</span></span></th>` : "<th></th>").join("")}</tr></thead><tbody>${M(`<tr>${[
R(),
`<span class="flex min-w-0 items-center gap-2">${L(32, 32, !0)}${I("5em")}</span>`,
I("10em"),
@@ -561,51 +568,51 @@ var j = (e = "60%") => `<span class="skeleton" style="width:${e}"></span>`, M =
L(48, 24),
I("113px"),
z()
-].map((e) => `<td>${e}</td>`).join("")}</tr>`, e)}</tbody></table></div></div>`, Re = (e, t) => `<div class="flex flex-wrap items-center justify-between gap-3"><span class="text-body-2-regular text-text-secondary">${I("111px")}</span>${A(`每页 ${t} ${e ? "条" : "位"}`, { size: "sm" })}${L(204, 32)}</div>`, ze = (e) => {
- let t = e.followLayout === "table", n = ve(e.followSort, e.followDir), r = e.followPageSize || Ne(), i = t ? Le(r, n) : `${R("全选本页")}<div class="flex flex-col gap-3">${B(3)}${B(4)}${B(3)}</div>`;
- return `<div class="peach-react"><div class="mx-auto flex w-full max-w-board flex-col gap-8">${Oe()}<div class="flex flex-col gap-6">${Ae()}<div class="flex flex-col gap-4"><div class="min-w-0 bg-background-secondary-default rounded-2xl shadow-card flex flex-col gap-4 px-6 py-5 max-sm:px-4 follow-skeleton-surface" data-layout="${t ? "table" : "default"}">${je({
+].map((e) => `<td>${e}</td>`).join("")}</tr>`, e)}</tbody></table></div></div>`, ze = (e, t) => `<div class="flex flex-wrap items-center justify-between gap-3"><span class="text-body-2-regular text-text-secondary">${I("111px")}</span>${k(`每页 ${t} ${e ? "条" : "位"}`, { size: "sm" })}${L(204, 32)}</div>`, Be = (e) => {
+ let t = e.followLayout === "table", n = ve(e.followSort, e.followDir), r = e.followPageSize || Pe(), i = t ? Re(r, n) : `${R("全选本页")}<div class="flex flex-col gap-3">${B(3)}${B(4)}${B(3)}</div>`;
+ return `<div class="peach-react"><div class="mx-auto flex w-full max-w-board flex-col gap-8">${ke()}<div class="flex flex-col gap-6">${je()}<div class="flex flex-col gap-4"><div class="min-w-0 bg-background-secondary-default rounded-2xl shadow-card flex flex-col gap-4 px-6 py-5 max-sm:px-4 follow-skeleton-surface" data-layout="${t ? "table" : "default"}">${Me({
table: t,
...n
- })}${i}${Re(t, r)}</div></div></div></div></div>`;
+ })}${i}${ze(t, r)}</div></div></div></div></div>`;
};
-function Be() {
- 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">${j("85%")}${j("65%")}${N(M(), 4)}</div></aside></div></div>`;
+function Ve() {
+ 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">${A("85%")}${A("65%")}${M(j(), 4)}</div></aside></div></div>`;
}
-function Ve(e, t = {}) {
+function He(e, t = {}) {
let n = "";
- if (e === "/stats") n = `<div class="insightpage statsdashboard"><header class="insighttoolbar">${j("38%")}</header>${P([
+ if (e === "/stats") n = `<div class="insightpage statsdashboard"><header class="insighttoolbar">${A("38%")}</header>${N([
"馆藏视频",
"看过",
"内容标签",
"使用空间"
- ])}${F("馆藏视频")}${F("内容标签")}</div>`;
- else if (e === "/taste") n = `<div class="tastepage"><header class="tastehead">${Ee(["浏览器记录", "Peach 内部"], "insightswitch")}${j("24%")}</header><div class="tastestate"></div>${P([
+ ])}${P("馆藏视频")}${P("内容标签")}</div>`;
+ else if (e === "/taste") n = `<div class="tastepage"><header class="tastehead">${De(["浏览器记录", "Peach 内部"], "insightswitch")}${A("24%")}</header><div class="tastestate"></div>${N([
"浏览记录",
"口味维度",
"浏览候选",
"私有导出"
- ], "tastesummaries")}<section class="tastehero"><div class="insightcopy"><span>浏览器画像</span><div class="skeleton skeleton-radar"></div></div><div class="tastebars skeleton-lines">${N(M(), 4)}</div></section>${F("口味分析")}<div class="board-activity-charts">${F("浏览活动")}${F("时间分布")}</div>${F("标签")}</div>`;
- else if (e === "/follow-manage") n = ze(t);
- else if (e === "/configuration") n = `<div class="configpage">${Te([
+ ], "tastesummaries")}<section class="tastehero"><div class="insightcopy"><span>浏览器画像</span><div class="skeleton skeleton-radar"></div></div><div class="tastebars skeleton-lines">${M(j(), 4)}</div></section>${P("口味分析")}<div class="board-activity-charts">${P("浏览活动")}${P("时间分布")}</div>${P("标签")}</div>`;
+ else if (e === "/follow-manage") n = Be(t);
+ else if (e === "/configuration") n = `<div class="configpage">${Ee([
"通用",
"媒体",
"网络与访问",
"更新与维护"
- ])}<section class="configfieldset"><div class="geist-fieldset-content"><h3 class="geist-fieldset-title">开机自启</h3><div class="skeleton-lines">${N(`<div class="skeleton-setting">${j("35%")}<span class="skeleton skeleton-toggle"></span></div>`, 3)}</div></div><footer class="geist-fieldset-footer">${j("100px")}</footer></section></div>`;
+ ])}<section class="configfieldset"><div class="geist-fieldset-content"><h3 class="geist-fieldset-title">开机自启</h3><div class="skeleton-lines">${M(`<div class="skeleton-setting">${A("35%")}<span class="skeleton skeleton-toggle"></span></div>`, 3)}</div></div><footer class="geist-fieldset-footer">${A("100px")}</footer></section></div>`;
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">${j("35%")}${M()}</div></article></div></section>`).join("")}</div>`;
- else if (e === "/duplicates") n = `<div class="review"><div class="collection-summary">${j("38%")}</div><div class="fsechead dupactions"><h3>批量保留</h3>${j("40%")}</div>${N(`<section class="dupgroup"><div class="duphead">${j("45%")}</div><div class="duplist">${N(`<div class="duprow"><span class="dupcover skeleton"></span><span class="dupmarks">${j()}</span><span class="dupname">${j("90%")}</span>${j()}${j()}${j()}<span class="duppath">${j("70%")}</span></div>`, 2)}</div></section>`, 2)}</div>`;
- else if (e === "/quality-goals") n = `<div class="quality-workspace"><div class="collection-summary"><strong>待升级</strong>${j("20%")}</div><div class="qualitylist">${N(`<article class="qualityitem"><span class="qualitycover skeleton"></span><div class="qualitybody skeleton-lines">${M()}</div><footer class="qualityactions">${j("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>${j("200px")}</div></header><div class="playlistcards">${N(`<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">${M()}</div></div></article>`, 6)}</div></section>`;
+ ].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">${A("35%")}${j()}</div></article></div></section>`).join("")}</div>`;
+ else if (e === "/duplicates") n = `<div class="review"><div class="collection-summary">${A("38%")}</div><div class="fsechead dupactions"><h3>批量保留</h3>${A("40%")}</div>${M(`<section class="dupgroup"><div class="duphead">${A("45%")}</div><div class="duplist">${M(`<div class="duprow"><span class="dupcover skeleton"></span><span class="dupmarks">${A()}</span><span class="dupname">${A("90%")}</span>${A()}${A()}${A()}<span class="duppath">${A("70%")}</span></div>`, 2)}</div></section>`, 2)}</div>`;
+ else if (e === "/quality-goals") n = `<div class="quality-workspace"><div class="collection-summary"><strong>待升级</strong>${A("20%")}</div><div class="qualitylist">${M(`<article class="qualityitem"><span class="qualitycover skeleton"></span><div class="qualitybody skeleton-lines">${j()}</div><footer class="qualityactions">${A("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>${A("200px")}</div></header><div class="playlistcards">${M(`<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">${j()}</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" inert>${n}</div></div>`;
}
//#endregion
//#region src/catalog-onboarding.ts
-var He = [
+var Ue = [
"loc",
"creator",
"performer",
@@ -623,16 +630,16 @@ var He = [
"jav",
"thumb"
];
-function Ue() {
+function We() {
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 We(e, t) {
+async function Ge(e, t) {
let n = new URLSearchParams();
- for (let t of He) e[t] && n.set(t, e[t]);
+ for (let t of Ue) 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 || [],
@@ -643,7 +650,7 @@ async function We(e, t) {
return r.set("q", e), r.set("limit", "1"), (await t("/api/items?" + r)).total > 0 ? e : "";
}))).filter(Boolean);
}
-function Ge({ kind: e = "catalog", filtered: n = !1, jav: r = !1, configurable: i = !1, online: a = !1 } = {}) {
+function Ke({ kind: e = "catalog", filtered: n = !1, jav: r = !1, configurable: i = !1, online: a = !1 } = {}) {
let o = i ? "<button class=\"geist-button primary\" data-empty-settings>添加内容</button>" : "", s = "<a class=\"geist-button" + (!i || a ? " primary" : "") + "\" href=\"/follow-manage?tab=add\">添加关注</a>";
if (n || r) return t("search", r ? "还没有符合条件的 JAV 作品" : "没有符合条件的内容", r ? "已扫描但尚未补充发行资料的视频可在全部内容中查看。" : "清除筛选或搜索条件后查看全部内容。", { actions: "<a class=\"geist-button primary\" href=\"/?loc=&thumb=0\">查看全部内容</a>" });
if (e !== "catalog") {
@@ -664,7 +671,7 @@ function Ge({ kind: e = "catalog", filtered: n = !1, jav: r = !1, configurable:
}
//#endregion
//#region src/sidebar.ts
-function Ke(e) {
+function qe(e) {
return [
"/",
"/unseen",
@@ -674,33 +681,33 @@ function Ke(e) {
"/junk-files"
].includes(e) || /^\/(item|mix|parts|editions)\//.test(e) || /^\/playlists\/\d+\/\d+$/.test(e) || /^\/(performers|studios|creators|series|agencies)\/.+/.test(e);
}
-function qe(e, t) {
+function Je(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 Je(e) {
+function Ye(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/management.ts
-function Ye(e) {
+function Xe(e) {
return e.filter((e) => ["115", "pikpak"].includes(e.location) && (e.roots === void 0 || e.roots.length > 0)).map((e) => e.location);
}
-function Xe(e, t) {
+function Ze(e, t) {
return t.filter((t) => e.some((e) => e.location === t));
}
-var Ze = "扫描媒体文件夹,导入已有资料,采集缺失信息。两段也可以分开跑:新盘刚接上时先只扫描,几万个文件登记完就能用;采集被网络拖住时只重跑采集,不必再扫一遍磁盘。", Qe = "修缺时间戳表(播放卡顿)和缺索引(打不开)的 MP4。常看的片子先修。", V = "<span class=\"skeleton skeleton-text\" aria-hidden=\"true\"></span>", H = "type=\"button\" aria-disabled=\"true\"", U = "aria-disabled=\"true\"", W = (e) => `<div class="peach-react"><div class="flex flex-col gap-4">${e}</div></div>`, G = (e, t) => `<div data-geist-fieldset-content>
+var Qe = "扫描媒体文件夹,导入已有资料,采集缺失信息。两段也可以分开跑:新盘刚接上时先只扫描,几万个文件登记完就能用;采集被网络拖住时只重跑采集,不必再扫一遍磁盘。", $e = "修缺时间戳表(播放卡顿)和缺索引(打不开)的 MP4。常看的片子先修。", V = "<span class=\"skeleton skeleton-text\" aria-hidden=\"true\"></span>", H = "type=\"button\" disabled data-skeleton-action", U = "disabled data-skeleton-action", et = "aria-disabled=\"true\"", W = (e) => `<div class="peach-react"><div class="flex flex-col gap-4">${e}</div></div>`, G = (e, t) => `<div data-geist-fieldset-content>
<h3 class="text-title-2-medium text-text-primary">${e}</h3>
<p class="text-body-2-regular text-text-secondary">${t}</p></div>`;
function K() {
return W(`<section aria-label="扫描与采集" data-geist-fieldset data-cleanup-task data-cleanup-processing>
- ${G("扫描与采集", Ze)}
- <footer data-geist-fieldset-footer><a href="/scraping" class="inline-flex items-center justify-center gap-1 whitespace-nowrap font-sans rounded-sm text-body-medium text-accent-600"><span>来源和凭证</span>${O("arrow-up", "size-[18px] shrink-0 rotate-90")}</a><span data-button-group data-split-button data-variant="primary">${k({
+ ${G("扫描与采集", Qe)}
+ <footer data-geist-fieldset-footer><a href="/scraping" class="inline-flex items-center justify-center gap-1 whitespace-nowrap font-sans rounded-sm text-body-medium text-accent-600"><span>来源和凭证</span>${D("arrow-up", "size-[18px] shrink-0 rotate-90")}</a><span data-button-group data-split-button data-variant="primary">${O({
glyph: "database",
label: "扫描并补全资料",
attrs: U
- })}${k({
+ })}${O({
glyph: "chevron-down",
attrs: `${U} aria-label="更多扫描与采集方式"`
})}</span></footer>
@@ -708,17 +715,17 @@ function K() {
}
function q() {
return W(`<section aria-label="媒体修复" data-geist-fieldset data-cleanup-task data-cleanup-processing>
- ${G("媒体修复", Qe)}
- <footer data-geist-fieldset-footer>${A(V, {
+ ${G("媒体修复", $e)}
+ <footer data-geist-fieldset-footer>${k(V, {
className: "w-48",
- attrs: U
- })}${k({
+ attrs: et
+ })}${O({
label: "开始修复",
- attrs: `data-skeleton-action ${U}`
+ attrs: U
})}</footer>
</section>`);
}
-function $e() {
+function tt() {
let e = [
["人工复核", "square-check-big"],
["高清版", "sparkles"],
@@ -774,20 +781,20 @@ function $e() {
}
//#endregion
//#region src/resource-sync.ts
-var J = (e = 0) => Number(e).toLocaleString(), et = {
+var J = (e = 0) => Number(e).toLocaleString(), nt = {
local: "本地磁盘",
115: "115",
pikpak: "PikPak"
-}, tt = (t) => o(e[t] ?? "database"), Y = (e, t, n) => `<article class="board-plain-stat resourcestat">
+}, rt = (t) => o(e[t] ?? "database"), Y = (e, t, n) => `<article class="board-plain-stat resourcestat">
<span class="board-plain-stat-head">${e}</span>
<strong>${t}</strong>
<span class="cleanupmeta">${n}</span></article>`;
-function nt(e, t) {
+function it(e, t) {
let n = e.cache || {
files: 0,
bytes: 0
}, r = !!(e.missing || n.files);
- return `<div class="cleanupstats resourcestats">${(e.sources || []).map((e) => Y(`<span class="board-stat-tile resourcestat-tile">${tt(e.location)}</span>${et[e.location] || "媒体来源"}<span class="resourcestat-state ${e.online ? "online" : "offline"}">${e.online ? "可访问" : "离线,已跳过"}</span>`, e.online ? `${J(e.missing)} 项` : "—", [e.online ? `找不到文件 · 已检查 ${J(e.checked)} 项` : `馆藏中有 ${J(e.total)} 项`, e.unreadable ? `${J(e.unreadable)} 项读取失败,已跳过` : ""].filter(Boolean).join(" · "))).join("")}
+ return `<div class="cleanupstats resourcestats">${(e.sources || []).map((e) => Y(`<span class="board-stat-tile resourcestat-tile">${rt(e.location)}</span>${nt[e.location] || "媒体来源"}<span class="resourcestat-state ${e.online ? "online" : "offline"}">${e.online ? "可访问" : "离线,已跳过"}</span>`, e.online ? `${J(e.missing)} 项` : "—", [e.online ? `找不到文件 · 已检查 ${J(e.checked)} 项` : `馆藏中有 ${J(e.total)} 项`, e.unreadable ? `${J(e.unreadable)} 项读取失败,已跳过` : ""].filter(Boolean).join(" · "))).join("")}
${Y("待移入回收站", `${J(e.missing)} 项`, "")}
${Y("可清理的缓存", `${J(n.files)} 个`, n.files ? t(n.bytes) : "")}</div>
${r ? i(`将把找不到文件的 ${J(e.missing)} 项馆藏记录移入回收站,并清理 ${J(n.files)} 个闲置缓存。`, { label: "清理内容" }) : ""}
@@ -802,7 +809,7 @@ function X(e) {
"preview"
].includes(String(e)) ? "small" : "big";
}
-function rt(e) {
+function at(e) {
return {
javLayout: X(e.javLayout),
javImage: Z(e.javLayout === "preview" ? "thumbnail" : e.javImage)
@@ -811,10 +818,10 @@ function rt(e) {
function Z(e) {
return e === "thumbnail" ? "thumbnail" : "cover";
}
-function it(e, t) {
+function ot(e, t) {
return e.is_jav && e.code && e.has_cover && (Z(t) === "cover" || !e.has_thumb) ? "cover" : e.has_thumb ? "thumbnail" : "";
}
-function at(e, t) {
+function st(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 = (e, t, n) => Math.min(n, Math.max(0, Number.isFinite(Number(e)) ? Number(e) : t)), o = a(i, 0, n), s = Math.max(o, a(e?.x1, n, n)), c = a(e?.y0, 0, r), l = Math.max(c, a(e?.y1, r, r)), u = s - o, d = l - c;
@@ -834,7 +841,7 @@ function at(e, t) {
height: m(r / d)
};
}
-function ot(e, t) {
+function ct(e, t) {
e.querySelectorAll("img[data-jav-image]").forEach((e) => {
let n = e.dataset.javCover || "", r = e.dataset.javThumb || "", i = !!(n && (Z(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);
@@ -842,7 +849,7 @@ function ot(e, t) {
}
//#endregion
//#region src/islands.ts
-var st = {
+var Q = {
"avatar-picker": { react: "avatar-picker" },
"cover-crop": { react: "cover-crop" },
"follow-manage": { react: "follow-manage" },
@@ -856,20 +863,20 @@ var st = {
activity: { react: "activity" },
stats: { react: "stats" },
taste: { react: "taste" }
-}, ct = () => Object.keys(st), Q = /* @__PURE__ */ new Map();
-async function lt(e, t, n, r = {}) {
- let i = st[e];
+}, lt = () => Object.keys(Q), $ = /* @__PURE__ */ new Map();
+async function ut(e, t, n, r = {}) {
+ let i = Q[e];
if (!i) throw Error(`未注册的 island:${String(e)}`);
- $(t);
+ pt(t);
let a = { controller: new AbortController() };
- Q.set(t, a);
+ $.set(t, a);
let o = (await import("/dist/peach-react.js")).pages[i.react];
try {
await o.prefetch(n, a.controller.signal);
} catch {
if (a.controller.signal.aborted) return;
}
- if (!ut(t, a, r)) return;
+ if (!dt(t, a, r)) return;
let s = t.ownerDocument.createElement("div");
s.className = "peach-react", t.append(s);
let c = o.mount(s, n);
@@ -877,16 +884,16 @@ async function lt(e, t, n, r = {}) {
c.unmount(), s.remove();
};
}
-function ut(e, t, n) {
- return Q.get(e) === t ? n.isCurrent && !n.isCurrent() ? (Q.delete(e), !1) : (e.textContent = "", !0) : !1;
+function dt(e, t, n) {
+ return $.get(e) === t ? n.isCurrent && !n.isCurrent() ? ($.delete(e), !1) : (e.textContent = "", !0) : !1;
}
-var dt = (e) => !!e && Q.has(e);
-function $(e) {
- for (let t of [...Q.keys()]) (t === e || e.contains(t)) && ft(t);
+var ft = (e) => !!e && $.has(e);
+function pt(e) {
+ for (let t of [...$.keys()]) (t === e || e.contains(t)) && mt(t);
}
-function ft(e) {
- let t = Q.get(e);
- t && (t.controller.abort(), Q.delete(e), t.dispose?.());
+function mt(e) {
+ let t = $.get(e);
+ t && (t.controller.abort(), $.delete(e), t.dispose?.());
}
//#endregion
-export { Ve as boardPageSkeleton, f as boundedPreference, Ge as catalogEmptyHtml, We as catalogSuggestions, ue as clampPage, $e as cleanupSkeletonHtml, Ye as cloudLocations, Xe as cloudPreferenceLocations, Be as detailSkeletonHtml, Ue as emptyCatalogLayout, me as entitySkeletonHtml, fe as faceSourceScale, re as followJobProgress, g as initBoardControls, dt as islandMounted, ct as islandNames, it as javImageKind, w as jobActivityHtml, lt as mountIsland, m as mountNumberSetting, pe as nativeImageFit, Z as normalizeJavImage, X as normalizeJavLayout, rt as normalizeJavPreferences, le as pageCount, de as paginationHtml, at as panelFrame, u as preferredDirection, q as repairCardSkeletonHtml, nt as resourceScanHtml, K as scanCardSkeletonHtml, oe as selectGroup, ie as selectRange, ae as selectionSummary, Ke as sidebarHasCatalogContent, S as sidebarSectionHtml, Je as sidebarTagCounts, h as syncBoardRange, ot as syncJavImages, p as syncNumberSetting, se as syncSelectionToolbar, qe as syncSidebarSurface, te as transitionTheme, $ as unmountIsland, T as watchJob, ee as wireSidebarGroups };
+export { He as boardPageSkeleton, f as boundedPreference, Ke as catalogEmptyHtml, Ge as catalogSuggestions, ue as clampPage, tt as cleanupSkeletonHtml, Xe as cloudLocations, Ze as cloudPreferenceLocations, Ve as detailSkeletonHtml, We as emptyCatalogLayout, me as entitySkeletonHtml, fe as faceSourceScale, re as followJobProgress, g as initBoardControls, ft as islandMounted, lt as islandNames, ot as javImageKind, w as jobActivityHtml, ut as mountIsland, m as mountNumberSetting, pe as nativeImageFit, Z as normalizeJavImage, X as normalizeJavLayout, at as normalizeJavPreferences, le as pageCount, de as paginationHtml, st as panelFrame, u as preferredDirection, q as repairCardSkeletonHtml, it as resourceScanHtml, K as scanCardSkeletonHtml, oe as selectGroup, ie as selectRange, ae as selectionSummary, qe as sidebarHasCatalogContent, S as sidebarSectionHtml, Ye as sidebarTagCounts, h as syncBoardRange, ct as syncJavImages, p as syncNumberSetting, se as syncSelectionToolbar, Je as syncSidebarSurface, te as transitionTheme, pt as unmountIsland, T as watchJob, ee as wireSidebarGroups };