Peach: Local-first video metadata scraper and media manager.
fix(web): 统一配置导航与订阅凭据卡片
longmeidaoc08f38226fef
diff --git a/docs/reference-snapshots/board-review-layout.md b/docs/reference-snapshots/board-review-layout.mdindex 5eaa62f6d..486adbda9 100644--- a/docs/reference-snapshots/board-review-layout.md+++ b/docs/reference-snapshots/board-review-layout.md@@ -19,13 +19,13 @@ Peach 采用正文中间内容与右侧分类的分区关系,保留自己的`gray` PillTab 的列表透明,间隔 4px;当前项使用 `background-tertiary-default` 和主文字色,未选中项用次级文字色,悬停底色为 `background-primary-hover`。条目为 10px 圆角、14px/20px 的 Medium 字体,上下内边距 5px、左右 8px。Segmented Control 使用整组轨道与滑块,官网示例是周/月/年这种短的局部选择。-Peach 的复核页和配置页采用灰色 Pills 的表面和文字层级,使用右侧竖排分类;保留 184px 列宽、24px 栏间距和复核数量。桌面条目保留 40px 命中高度,900px 以下使用正文上方可横向滚动的单行导航,条目高 36px。管理 tabs 保持横跨页面,配置页 skeleton 与正文共用分类样式。Peach 需要内容面板关联和方向键操作,因此保留 React Aria Tabs/现有 tablist 语义,不直接替换为上游普通按钮组,也不增加滑块动画。+Peach 的复核页和配置页采用灰色 Pills 的表面和文字层级。复核页使用右侧竖排分类,保留 184px 列宽、24px 栏间距和复核数量;桌面条目保留 40px 命中高度,900px 以下在正文上方单行滚动。配置页与关注管理在正文上方横排,窄屏单行滚动。管理 tabs 横跨页面,配置页 skeleton 与正文共用分类样式。Peach 需要内容面板关联和方向键操作,因此保留 React Aria Tabs/现有 tablist 语义,不直接替换为上游普通按钮组,也不增加滑块动画。纠正:Breadcrumb 参考只确定右栏布局,不能据此把复核分类改成正文锚点目录。用户要求在 Segmented Control 和 Pills Tabs 之间比较;九个带数量的复核分类与配置分区采用灰色 Pills。亮色容器透明本身不是缺样式,应保证两种主题下当前项的独立底色清晰。关注管理的「关注列表/添加关注/JAV 订阅源/来源和凭证」也采用同一套灰色 Pills,保持横排与内容面板关联,窄屏单行滚动;等待态复用同一导航表面。统计维度、采集模式、隧道模式属于局部互斥选择,继续使用分段控件。-主题阴影采用仓库内 BoardUI `theme.css` 的亮暗原值:卡片暗色接触影为 `0 1px 1px / 14%`。凭据行共处一个表面,查找结果用独立描边表面;不以同色嵌套卡的阴影区分内容层级。2026-09-29 的亮暗截图及调用范围记录在 `attic/evidence/20260929-theme-audit/`。+主题阴影采用仓库内 BoardUI `theme.css` 的亮暗原值:卡片暗色接触影为 `0 1px 1px / 14%`。凭据按「可配置凭据/不需要凭据/暂不支持」分组,各组与查找结果使用独立描边表面,两种主题都通过边框区分层级。JAV 订阅列表复用关注列表的外层卡片、顶部操作栏、底部分页和状态栏;默认每页 20 条,选择跨页保留。2026-09-29 的亮暗截图及调用范围记录在 `attic/evidence/20260929-theme-audit/`。## 玻璃材质回归证据diff --git a/frontend/e2e/configuration-skeleton.test.ts b/frontend/e2e/configuration-skeleton.test.tsindex abbe63e54..77af1e75f 100644--- a/frontend/e2e/configuration-skeleton.test.ts+++ b/frontend/e2e/configuration-skeleton.test.ts@@ -32,19 +32,14 @@ describe('配置页等待态', () => {await expectBody(page, '/configuration', configurationBody(page));await settle(page);const nav = page.getByRole('tablist', { name: '配置分区' });- assert.equal(await nav.getAttribute('aria-orientation'), viewport.mobile ? 'horizontal' : 'vertical');+ assert.equal(await nav.getAttribute('aria-orientation'), 'horizontal');const geometry = await measure(page);- if (viewport.mobile) {- assert.ok(geometry.nav.y + geometry.nav.height <= geometry.sections[0].label.y);- } else {- assert.ok(geometry.nav.x >= geometry.sections[0].card.x + geometry.sections[0].card.width);- assert.equal(geometry.nav.width, 184);- }+ assert.ok(geometry.nav.y + geometry.nav.height <= geometry.sections[0].label.y);const input = page.getByRole('textbox', { name: 'JavDB 地址', exact: true });await input.fill('example.invalid');const general = nav.getByRole('tab', { name: '通用', exact: true });await general.focus();- await page.keyboard.press(viewport.mobile ? 'ArrowRight' : 'ArrowDown');+ await page.keyboard.press('ArrowRight');assert.equal(await nav.getByRole('tab', { name: '媒体', exact: true }).getAttribute('aria-selected'), 'true');await page.keyboard.press('End');assert.equal(await nav.getByRole('tab', { name: '更新与维护' }).getAttribute('aria-selected'), 'true');@@ -55,7 +50,7 @@ describe('配置页等待态', () => {assert.deepEqual(bounds.offenders, []);await page.setViewportSize({ width: viewport.mobile ? 1280 : 390, height: 844 });await page.waitForFunction(expected => document.querySelector('.configpage>.board-local-nav')?.getAttribute('aria-orientation') === expected,- viewport.mobile ? 'vertical' : 'horizontal');+ 'horizontal');assert.equal(await general.getAttribute('aria-selected'), 'true');assert.equal(await input.inputValue(), 'example.invalid');assert.deepEqual(opened.problems, []);diff --git a/frontend/e2e/design.test.ts b/frontend/e2e/design.test.tsindex bfcc2500d..a3b5d385b 100644--- a/frontend/e2e/design.test.ts+++ b/frontend/e2e/design.test.ts@@ -4047,7 +4047,50 @@ describe('设计决定', () => {});for (const viewport of [DESKTOP, MOBILE]) {- it(`关注分类使用 Pills,凭据列表与外层共用一个表面(${viewport.name})`, { timeout: 60_000 }, async () => {+ it(`JAV 订阅卡片包含分页与贴边底栏(${viewport.name})`, { timeout: 60_000 }, async () => {+ const opened = await openFollowManage(browser, viewport);+ try {+ const page = opened.page;+ await page.route('**/api/feeds', route => route.fulfill({ json: {+ unread: 81, sources: Array.from({ length: 25 }, (_, i) => ({+ id: i + 1, kind: 'javdb-actor', kind_label: 'JAV 订阅', name: `测试订阅 ${i + 1}`,+ url: `https://example.com/actors/${i + 1}`, entity_id: null, entity_name: null,+ has_image: false, enabled: true, interval_minutes: 360, last_fetched_at: null,+ last_error: null, last_new_count: 0, seen: 0,+ })),+ } }));+ await page.reload({ waitUntil: 'load' });+ await page.getByRole('tab', { name: 'JAV 订阅源', exact: true }).click();+ const card = page.getByRole('region', { name: 'JAV 订阅列表', exact: true });+ await card.getByText('1–20 / 25 个订阅源', { exact: true }).waitFor();+ assert.equal(await card.locator('[role="row"][data-key]').count(), 20);+ await card.getByRole('button', { name: '下一页', exact: true }).click();+ await card.getByText('21–25 / 25 个订阅源', { exact: true }).waitFor();+ assert.equal(await card.locator('[role="row"][data-key]').count(), 5);+ for (const theme of ['light', 'dark']) {+ await page.evaluate(value => {+ document.documentElement.dataset.theme = value;+ document.documentElement.classList.toggle('dark', value === 'dark');+ }, theme);+ const surface = await card.evaluate(element => {+ const footer = element.querySelector('footer')!;+ const box = element.getBoundingClientRect();+ const bottom = footer.getBoundingClientRect();+ return { background: getComputedStyle(element).backgroundColor,+ footerBackground: getComputedStyle(footer).backgroundColor,+ left: bottom.left - box.left, right: box.right - bottom.right,+ bottom: box.bottom - bottom.bottom };+ });+ assert.notEqual(surface.background, 'rgba(0, 0, 0, 0)');+ assert.notEqual(surface.background, surface.footerBackground);+ for (const edge of ['left', 'right', 'bottom'] as const) assert.ok(Math.abs(surface[edge]) <= 1);+ const dimensions = await layout(page);+ assert.ok(dimensions.scrollWidth <= dimensions.viewportWidth + 1, JSON.stringify(dimensions));+ }+ assert.deepEqual(opened.problems, []);+ } finally { await opened.close(); }+ });+ it(`关注分类使用 Pills,凭据按要求分组并带描边(${viewport.name})`, { timeout: 60_000 }, async () => {const opened = await openFollowManage(browser, viewport);try {const page = opened.page;@@ -4067,13 +4110,19 @@ describe('设计决定', () => {assert.equal(face.track, 'rgba(0, 0, 0, 0)', 'Pills 容器应透明');assert.notEqual(face.selected, face.track, '当前分类应有独立底色');assert.equal(face.shadow, 'none', 'Pills 不使用浮起滑块');- const list = page.getByRole('heading', { name: '来源和凭证', exact: true }).locator('..').locator('..');- const rows = await list.evaluate((element) => {- const group = element.children[1];- const style = getComputedStyle(group);- return { shadow: style.boxShadow, radius: style.borderRadius, background: style.backgroundColor };- });- assert.deepEqual(rows, { shadow: 'none', radius: '0px', background: 'rgba(0, 0, 0, 0)' });+ for (const name of ['可配置凭据', '不需要凭据', '暂不支持']) {+ const group = page.getByRole('region', { name, exact: true });+ const rows = await group.evaluate((element) => {+ const style = getComputedStyle(element.lastElementChild!);+ return { shadow: style.boxShadow, width: style.borderTopWidth,+ border: style.borderTopColor, background: style.backgroundColor };+ });+ assert.equal(rows.shadow, 'none');+ assert.equal(rows.width, '1px');+ assert.notEqual(rows.border, rows.background);+ }+ assert.match(await page.getByRole('region', { name: '不需要凭据', exact: true }).innerText(), /Kemono/);+ assert.match(await page.getByRole('region', { name: '暂不支持', exact: true }).innerText(), /OnlyFans/);await tabs.getByRole('tab', { name: /来源和凭证/ }).focus();await page.keyboard.press('Home');await page.keyboard.press('Enter');diff --git a/frontend/src/react/follow-manage/credentials.tsx b/frontend/src/react/follow-manage/credentials.tsxindex 96710cd06..6d094a4e3 100644--- a/frontend/src/react/follow-manage/credentials.tsx+++ b/frontend/src/react/follow-manage/credentials.tsx@@ -160,13 +160,20 @@ export function Credentials(? <span className="text-body-2-regular text-text-error-primary">{`${pending.length} 个待配置`}</span>: null}</div>- {/* 旧 `[data-follow-panel=credentials]>.frows`:几个来源共处一张填充卡,行与行之间- 只有一条发丝线,不各自套框。 */}- <div className="flex flex-col overflow-hidden">- {rows.map((row) => (- <CredentialSection key={row.provider} row={row} readOnly={readOnly} toast={toast} />- ))}- </div>+ {[+ { title: '可配置凭据', rows: rows.filter((row) => row.requirement !== 'none' && row.requirement !== 'blocked') },+ { title: '不需要凭据', rows: rows.filter((row) => row.requirement === 'none') },+ { title: '暂不支持', rows: rows.filter((row) => row.requirement === 'blocked') },+ ].filter((group) => group.rows.length).map((group) => (+ <section key={group.title} aria-label={group.title} className="flex flex-col gap-2">+ <h4 className="text-body-medium text-text-secondary">{group.title}</h4>+ <div className={cardClass({ variant: 'outlined', padding: 'none', className: 'flex flex-col overflow-hidden' })}>+ {group.rows.map((row) => (+ <CredentialSection key={row.provider} row={row} readOnly={readOnly} toast={toast} />+ ))}+ </div>+ </section>+ ))}<div className="flex flex-col gap-1"><b className="text-body-medium text-text-primary">{STORAGE_TITLE}</b><span className="text-body-2-regular text-text-secondary">{STORAGE_BODY}</span>diff --git a/frontend/src/react/follow-manage/feed-sources.tsx b/frontend/src/react/follow-manage/feed-sources.tsxindex a9603cd4d..3dead51de 100644--- a/frontend/src/react/follow-manage/feed-sources.tsx+++ b/frontend/src/react/follow-manage/feed-sources.tsx@@ -10,7 +10,7 @@* 勾选和关注列表同一套:勾在行首,点一行的空白处也是选这一行,选中了底部浮出批量操作。 */import { useEffect, useMemo, useRef, useState } from 'react';import { useMutation, useQuery } from '@tanstack/react-query';-import { createColumnHelper, flexRender, getCoreRowModel, useReactTable } from '@tanstack/react-table';+import { createColumnHelper, flexRender, getCoreRowModel, getPaginationRowModel, useReactTable } from '@tanstack/react-table';import { RiDeleteBinLine, RiRefreshLine, RiRssLine } from '@remixicon/react';import { VisuallyHidden } from 'react-aria-components';import { mapLimit } from '@peach/legacy/core';@@ -19,6 +19,7 @@ import { confirmModal } from '@peach/legacy/ui';import { Chip } from '@/components/base/badges/chip';import { Button } from '@/components/base/buttons/button';import { Checkbox } from '@/components/base/checkbox/checkbox';+import { Select, SelectItem } from '@/components/base/select/select';import { Switch } from '@/components/base/switch/switch';import {Table, TableBody, TableCell, TableColumn, TableHeader, TableRow,@@ -27,6 +28,7 @@ import {import { errorMessage } from '../../api';import type { FollowManageProps } from '../bundle';import { DataTableFrame } from '../components/data-table-frame';+import { cardClass } from '../components/card';import { EmptyState } from '../components/empty-state';import { LEGACY_AVATAR_IMG } from '../components/legacy-avatar';import { Note } from '../components/note';@@ -36,8 +38,9 @@ import { ErrorText, Help } from '../settings/section';import { busyProps, useAction } from '../settings/use-action';import { localTime } from '../time';import { AddFeed } from './add-feed';+import { Pagination } from './source-list';import {- checkFeeds, FEEDS_KEY, fetchFeeds, removeFeed, setFeedEnabled, type FeedSource,+ checkFeeds, FEEDS_KEY, fetchFeeds, removeFeed, setFeedEnabled, PAGE_SIZES, pageWindow, type FeedSource,} from './follow-manage';const COLUMN_LABELS: Record<string, string> = {@@ -146,6 +149,10 @@ export function FeedSources({ readOnly, toast, avatarInner }: {const data = feeds.data;const sources = useMemo(() => data?.sources ?? [], [data]);const [selected, setSelected] = useState<ReadonlySet<number>>(new Set<number>());+ const [page, setPage] = useState(1);+ const [pageSize, setPageSize] = useState(20);+ const win = pageWindow(sources.length, pageSize, page);+ useEffect(() => { setPage((current) => Math.min(current, win.pages)) }, [win.pages]);/* 删掉的源不该还占着计数:清单换一份就把已经不在里面的 ID 丢掉。 */useEffect(() => {@@ -301,13 +308,14 @@ export function FeedSources({ readOnly, toast, avatarInner }: {data: sources,columns,getRowId: (row) => String(row.id),- state: { rowSelection },+ state: { rowSelection, pagination: { pageIndex: win.page - 1, pageSize } },enableRowSelection: true,onRowSelectionChange: (updater) => {const next = typeof updater === 'function' ? updater(rowSelection) : updater;setSelected(new Set(Object.entries(next).filter(([, on]) => on).map(([id]) => Number(id))));},getCoreRowModel: getCoreRowModel(),+ getPaginationRowModel: getPaginationRowModel(),});if (!data) {@@ -325,12 +333,14 @@ export function FeedSources({ readOnly, toast, avatarInner }: {const chosen = sources.filter((source) => selected.has(source.id));const failing = sources.filter((source) => source.last_error);- /* 分区名由页签「JAV 订阅源」给,表上面没有同名的小标题。 */return (<div className="flex flex-col gap-3"><AddFeed readOnly={readOnly} toast={toast} onAdded={() => void reload()} />- <div className="flex flex-wrap items-center justify-between gap-3">- <Help role="status">{data.unread ? `有 ${data.unread} 条新作还没看` : '新作都看过了'}</Help>+ <section aria-label="JAV 订阅列表"+ className={cardClass({ padding: 'none', className: 'flex flex-col gap-4 px-6 py-5 max-sm:px-4' })}>+ <div className="flex flex-wrap items-center gap-2">+ <h3 className="mr-auto text-title-2-medium text-text-primary">JAV 订阅源</h3>+ <span className="text-body-2-regular text-text-secondary">{`${sources.length} 个订阅源 · ${data.unread} 条未看`}</span><Button onClick={check} disabled={readOnly} {...busyProps(action.busy === 'check')}>立即拉取</Button></div>@@ -388,6 +398,22 @@ export function FeedSources({ readOnly, toast, avatarInner }: {在上面按女优名添加,或在人物页点「订阅新作」。</EmptyState>)}+ {sources.length ? (+ <div className="flex flex-wrap items-center justify-between gap-3">+ <span className="text-body-2-regular text-text-secondary">{`${win.start + 1}–${win.end} / ${win.total} 个订阅源`}</span>+ <Select aria-label="每页显示数量" size="sm" selectedKey={String(pageSize)}+ onSelectionChange={(key) => { if (key !== null) { setPageSize(Number(key)); setPage(1) } }}>+ {PAGE_SIZES.map((size) => <SelectItem key={size} id={String(size)}>{`每页 ${size} 条`}</SelectItem>)}+ </Select>+ <Pagination label="JAV 订阅分页" page={win.page} pages={win.pages} onPage={setPage} />+ </div>+ ) : null}+ <footer className="-mx-6 -mb-5 flex flex-wrap items-center gap-2 border-t border-separator-border rounded-b-2xl bg-card-footer px-6 py-4 max-sm:-mx-4 max-sm:px-4">+ <span role="status" className="mr-auto text-body-2-regular text-text-secondary">+ {`未看 ${data.unread} · 已启用 ${sources.filter((source) => source.enabled).length} / ${sources.length}`}+ </span>+ </footer>+ </section></div>);}diff --git a/frontend/src/react/follow-manage/source-list.tsx b/frontend/src/react/follow-manage/source-list.tsxindex 82e18c8f2..9a9e118ad 100644--- a/frontend/src/react/follow-manage/source-list.tsx+++ b/frontend/src/react/follow-manage/source-list.tsx@@ -115,12 +115,12 @@ export interface SourceListProps {}/** 页码。上一页/下一页在两端,页码居中,页数多时两侧折成「…」。 */-function Pagination(- { page, pages, onPage }: { page: number; pages: number; onPage(page: number): void },+export function Pagination(+ { page, pages, onPage, label = '关注列表分页' }: { page: number; pages: number; onPage(page: number): void; label?: string },) {if (pages <= 1) return null;return (- <nav aria-label="关注列表分页" className="flex flex-wrap items-center justify-center gap-2">+ <nav aria-label={label} className="flex flex-wrap items-center justify-center gap-2"><Button variant="secondary" size="small" disabled={page <= 1}onClick={() => onPage(page - 1)}>上一页</Button><ul className="flex flex-wrap items-center gap-1">diff --git a/frontend/src/react/styles.css b/frontend/src/react/styles.cssindex 194fdd5dc..f1591852b 100644--- a/frontend/src/react/styles.css+++ b/frontend/src/react/styles.css@@ -699,6 +699,8 @@* 实体卡面;选中行回到 BoardUI Data Table 的 secondary 反馈。这里的边线取 button border,* 因为 Peach 暗色 primary 与 separator 同为 neutral-800,用 separator 会完全消失。 */.peach-react [data-board-data-table] {+ /* 隐藏列标题的绝对定位由表格外框承接,滚动内容不扩大页面。 */+ position: relative;overflow: hidden;border: 1px solid var(--color-border-button-default);border-radius: var(--radius-surface);diff --git a/frontend/test/react/follow-manage.test.tsx b/frontend/test/react/follow-manage.test.tsxindex 40b3eaf7d..3defcef07 100644--- a/frontend/test/react/follow-manage.test.tsx+++ b/frontend/test/react/follow-manage.test.tsx@@ -652,7 +652,7 @@ it('地址栏指着订阅源时首屏就带着清单,开关、移除与立即expect(second.querySelector('[role="rowheader"] img')).toBeNull();expect(second.querySelector('[role="rowheader"] [aria-hidden]')?.textContent).toBe('乙');expect(host.textContent).toContain('乙 的新作 拉取失败');- expect(host.textContent).toContain('有 3 条新作还没看');+ expect(host.textContent).toContain('2 个订阅源 · 3 条未看');expect(host.textContent).not.toContain('正在读订阅源');expect(feedReads(fetcher)).toBe(1);await click(host.querySelector('[aria-label="启用 乙 的新作"]'));@@ -774,12 +774,54 @@ it('订阅源页签不收地址,只读的这台查找、开关、移除与拉expect(host.querySelector<HTMLInputElement>('input[aria-label="启用 甲 的新作"]')?.disabled).toBe(true);});-it('没有订阅源时那张卡里是空态,分区名由页签给、卡上没有同名标题', async () => {+it('JAV 订阅分页保留跨页选择,页容量切换回到首页', async () => {+ const feeds = { unread: 81, sources: Array.from({ length: 25 }, (_, i) => ({+ ...FEEDS.sources[0], id: i + 1, name: `来源 ${i + 1}`, entity_name: `来源 ${i + 1}`,+ })) };+ const { host } = await open({ feeds }, { tab: 'feeds' });+ const rows = () => host.querySelectorAll('[role="row"][data-key]');+ expect(rows()).toHaveLength(20);+ expect(host.textContent).toContain('1–20 / 25 个订阅源');+ await click(checkboxNamed(host, '选择 来源 1'));+ await click(buttonNamed('下一页', host));+ expect(rows()).toHaveLength(5);+ expect(host.textContent).toContain('21–25 / 25 个订阅源');+ expect(host.textContent).toContain('已选 1 条订阅源');+ await click(checkboxNamed(host, '选择 来源 21'));+ await click(buttonNamed('上一页', host));+ expect(checkboxNamed(host, '选择 来源 1')?.checked).toBe(true);+ expect(host.textContent).toContain('已选 2 条订阅源');+ await click(buttonNamed('下一页', host));+ await choose(host.querySelector('button[aria-label="每页显示数量"]'), '每页 10 条');+ expect(rows()).toHaveLength(10);+ expect(host.textContent).toContain('1–10 / 25 个订阅源');+ expect(host.querySelector('footer')?.textContent).toContain('未看 81 · 已启用 25 / 25');+});++it('移除末页的最后一个订阅源会显示有效页', async () => {+ stubConfirm(true);+ const feeds = { unread: 0, sources: Array.from({ length: 21 }, (_, i) => ({+ ...FEEDS.sources[0], id: i + 1, name: `来源 ${i + 1}`, entity_name: `来源 ${i + 1}`,+ })) };+ const plan: Plan = { feeds, feedWrite: ({ id }) => {+ plan.feeds = { ...feeds, sources: feeds.sources.filter(source => source.id !== id) };+ return ok({ ok: true });+ } };+ const { host } = await open(plan, { tab: 'feeds' });+ await click(buttonNamed('下一页', host));+ await click(buttonLabelled(host, '移除 来源 21'));+ await settle();+ expect(host.querySelectorAll('[role="row"][data-key]')).toHaveLength(20);+ expect(host.textContent).toContain('1–20 / 20 个订阅源');+});++it('订阅列表卡片包含标题、空态和状态栏', async () => {const { host } = await open({}, { tab: 'feeds' });const panel = host.querySelector('[role="tabpanel"]')!;- expect([...panel.querySelectorAll('h3')].map((h) => h.textContent)).toEqual(['添加 JAV 订阅', '还没有订阅源']);+ expect([...panel.querySelectorAll('h3')].map((h) => h.textContent)).toEqual(['添加 JAV 订阅', 'JAV 订阅源', '还没有订阅源']);expect(panel.textContent).toContain('在上面按女优名添加,或在人物页点「订阅新作」。');- expect(panel.querySelector('section[aria-label="订阅源"]')).toBeNull();+ expect(panel.querySelector('section[aria-label="JAV 订阅列表"]')).not.toBeNull();+ expect(panel.querySelector('footer')?.textContent).toContain('未看 0 · 已启用 0 / 0');expect(buttonNamed('立即拉取', host)).not.toBeNull();});@@ -1257,6 +1299,10 @@ it('每个站说清自己的处境:需要、已配置、接不进来、不需expect(['Fanbox', 'Patreon', 'OnlyFans', 'Kemono'].map((label) => chipText(credentialRow(host, label)))).toEqual([['需要'], ['已配置'], ['接不进来'], ['不需要']]);expect(host.textContent).toContain('1 个待配置');+ const groupNames = ['可配置凭据', '不需要凭据', '暂不支持'];+ expect(groupNames.map(name => [...host.querySelectorAll(`section[aria-label="${name}"] b`)]+ .map(node => node.textContent))).toEqual([['Fanbox', 'Patreon'], ['Kemono'], ['OnlyFans']]);+ expect(host.querySelector('section[aria-label="不需要凭据"] input')).toBeNull();});it('缺什么、为什么要、去哪儿取都写在那一行上,非配不可的一进来就展开', async () => {diff --git a/web/app.js b/web/app.jsindex c858db06b..3853f31dd 100644--- a/web/app.js+++ b/web/app.js@@ -8063,16 +8063,12 @@ function syncLocalNavGlide(nav,active,animate){未取得;小标题用本站自己那一档:13px、`--muted`)。整块仍是一个 tablist:拆成两个的话方向键只在自己那一段里走,从「安全」按下去到不了「通用」,而这两段在用户眼里就是一列。小标题因此写成 presentation,不占 tab 的位置。 */-const configurationNarrow=matchMedia('(max-width:900px)');-configurationNarrow.addEventListener('change',()=>{- document.querySelectorAll('.configpage>.board-local-nav').forEach(nav=>nav.setAttribute('aria-orientation',configurationNarrow.matches?'horizontal':'vertical'));-});function localTabs(root,sections,host=root){const items=sections.flatMap(section=>section.items);if(!items.length||host.querySelector(':scope > .board-local-nav'))return null;const prefix=`board-tabs-${++tabSequence}`;const nav=document.createElement('div');nav.className='board-local-nav';nav.setAttribute('role','tablist');nav.setAttribute('aria-label',host===root?'配置分区':'设置分区');- if(host===root){nav.dataset.sectionNav='';nav.dataset.sectionItems='';nav.setAttribute('aria-orientation',configurationNarrow.matches?'horizontal':'vertical')}+ if(host===root){nav.dataset.sectionNav='';nav.dataset.sectionItems='';nav.setAttribute('aria-orientation','horizontal')}const buttons=[];let active=0;const choose=index=>{const moved=active!==index;diff --git a/web/board.css b/web/board.cssindex b5a0bdfb7..62a72bb9f 100644--- a/web/board.css+++ b/web/board.css@@ -455,10 +455,10 @@ body :is(#manageTitle,#manageCrumb,#manageLede){max-width:var(--board-content);w.board-local-nav button{flex:none;background:none;border:0;border-bottom:2px solid transparent;border-radius:0;padding:10px 12px;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;color:var(--ink-2);cursor:pointer;white-space:nowrap}.board-local-nav button[aria-selected="true"]{border-bottom-color:var(--tungsten);color:var(--tungsten);font-weight:500}.board-local-nav button:focus-visible{outline:2px solid var(--tungsten);outline-offset:-3px}-/* 管理页次级导航:分类在正文右侧,窄屏放回内容上方。 */-.configpage:has(>.board-local-nav){grid-template-columns:minmax(0,1fr) 184px;gap:24px;align-items:start}-.configpage>.board-local-nav{grid-column:2;grid-row:1;position:sticky;top:var(--topH);display:flex;flex-direction:column;align-items:stretch;gap:0;margin:0;padding:0;border:0;border-radius:0}-.configpage:has(>.board-local-nav)>:not(.board-local-nav):not(.configgroup){grid-column:1;grid-row:1;min-width:0}+/* 配置分类在正文上方横排,与关注管理共用 Pills。 */+.configpage:has(>.board-local-nav){grid-template-columns:minmax(0,1fr);gap:24px;align-items:start}+.configpage>.board-local-nav{grid-column:1;grid-row:1;position:static;display:flex;flex-direction:row;align-items:stretch;margin:0;padding:0;border:0;border-radius:0}+.configpage:has(>.board-local-nav)>:not(.board-local-nav):not(.configgroup){grid-column:1;grid-row:2;min-width:0}/* BoardUI gray PillTab:透明容器与独立选中底色,取证见 board-review-layout.md。 */body #stats [data-section-nav]{background:none;border-radius:0;padding:0;box-shadow:none}body #stats [data-section-nav] h2{margin:0 0 12px;padding:0;font:var(--board-body-medium);color:var(--color-text-primary)}