Skip to content

armgit / peach

Public Imported from GitHub
0

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

fix(web): 使用共享读屏组件并等待通知定位稳定

longmeidao3ff9ca96dcb5
diff --git a/frontend/e2e/library-processing-controls.test.ts b/frontend/e2e/library-processing-controls.test.ts
index 815de27a5..653d254e1 100644
--- a/frontend/e2e/library-processing-controls.test.ts
+++ b/frontend/e2e/library-processing-controls.test.ts
@@ -135,9 +135,16 @@ describe('扫描与采集控制', () => {
});
const receipt = page.locator('#toasts [data-sonner-toast]').filter({ hasText: '设置已保存' });
await receipt.waitFor();
+ await page.waitForFunction(() => {
+ const task = document.querySelector('#toasts [data-processing-dock]');
+ const notice = [...document.querySelectorAll('#toasts [data-sonner-toast]')]
+ .find(node => node.textContent?.includes('设置已保存'));
+ return task && notice && notice.getBoundingClientRect().bottom <= task.getBoundingClientRect().top - 7;
+ });
const dockBox = await dock.boundingBox(), receiptBox = await receipt.boundingBox();
assert.ok(dockBox && receiptBox && receiptBox.y + receiptBox.height <= dockBox.y - 7,
- '普通回执位于任务卡上方');
+ JSON.stringify({ message: '普通回执位于任务卡上方', dockBox, receiptBox,
+ space: await page.evaluate(() => getComputedStyle(document.documentElement).getPropertyValue('--processing-toast-space')) }));
const homeLayout = await layout(page);
assert.ok(homeLayout.scrollWidth <= homeLayout.viewportWidth, JSON.stringify(homeLayout));
assert.deepEqual(homeLayout.offenders, []);
diff --git a/frontend/src/react/library-processing/library-processing-notice.tsx b/frontend/src/react/library-processing/library-processing-notice.tsx
index daa53ec4e..9c52af21a 100644
--- a/frontend/src/react/library-processing/library-processing-notice.tsx
+++ b/frontend/src/react/library-processing/library-processing-notice.tsx
@@ -1,5 +1,6 @@
/* 常驻任务面:状态、计数与控件共用服务端快照。位置由全站通知栈管理。 */
import { useEffect, useRef, useState } from 'react';
+import { VisuallyHidden } from 'react-aria';
import { RiArrowRightLine, RiArrowDownSLine, RiArrowUpSLine, RiCheckLine, RiCheckboxBlankCircleLine, RiErrorWarningLine, RiInformationLine } from '@remixicon/react';
import { Button } from '@/components/base/buttons/button';
import { LinkButton } from '@/components/base/buttons/link-button';
@@ -83,7 +84,7 @@ export function ProcessingNoticePanel({ state, problem = '', measure = false }:
step.status === 'current' ? 'text-text-primary' : 'text-text-tertiary')}>
{step.status === 'complete' ? <RiCheckLine aria-hidden className="size-4 shrink-0" />
: <RiCheckboxBlankCircleLine aria-hidden className={cx('size-4 shrink-0', step.status === 'current' && 'text-border-focus-ring')} />}
- <span className="sr-only">{step.status === 'complete' ? '已完成:' : step.status === 'current' ? '当前:' : '待处理:'}</span>
+ <VisuallyHidden>{step.status === 'complete' ? '已完成:' : step.status === 'current' ? '当前:' : '待处理:'}</VisuallyHidden>
{step.status === 'complete' ? <s className="wrap-anywhere">{step.label}</s> : <span className="wrap-anywhere">{step.label}</span>}
</li>)}
</ol> : null}
diff --git a/web/dist/peach-app.js b/web/dist/peach-app.js
index 213970538..0f26ab39e 100644
--- a/web/dist/peach-app.js
+++ b/web/dist/peach-app.js
@@ -45064,10 +45064,7 @@ function EP({ state: e, problem: t = "", measure: n = !1 }) {
"aria-hidden": !0,
className: dk("size-4 shrink-0", e.status === "current" && "text-border-focus-ring")
}),
- /* @__PURE__ */ (0, C.jsx)("span", {
- className: "sr-only",
- children: e.status === "complete" ? "已完成:" : e.status === "current" ? "当前:" : "待处理:"
- }),
+ /* @__PURE__ */ (0, C.jsx)(Ux, { children: e.status === "complete" ? "已完成:" : e.status === "current" ? "当前:" : "待处理:" }),
e.status === "complete" ? /* @__PURE__ */ (0, C.jsx)("s", {
className: "wrap-anywhere",
children: e.label