Skip to content

armgit / peach

Public Imported from GitHub
0

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

fix(web): 将复核卡滚动条放入右侧留白

longmeidao6f2c262ab6ef
diff --git a/frontend/e2e/design.test.ts b/frontend/e2e/design.test.ts
index b0367bb95..bfcc2500d 100644
--- a/frontend/e2e/design.test.ts
+++ b/frontend/e2e/design.test.ts
@@ -1794,6 +1794,26 @@ describe('设计决定', () => {
await opened.page.waitForFunction(() => !!document.querySelector('[data-review-key] .can-scroll-top.can-scroll-bottom'));
assert.equal(await edges.evaluate((node) => getComputedStyle(node).pointerEvents), 'none');
assert.equal(await edges.locator('.ov-edge-top').evaluate((node) => getComputedStyle(node).backdropFilter), 'blur(2px)');
+ const track = scroller.locator('..').locator('.ovtrack.ov-y');
+ for (const viewport of [DESKTOP, MOBILE]) {
+ await opened.page.setViewportSize({ width: viewport.width, height: viewport.height });
+ const bounds = await track.evaluate((node) => {
+ const scroll = node.parentElement!.querySelector('[data-overlay-scrollbar]')!.getBoundingClientRect();
+ const rail = node.getBoundingClientRect();
+ const card = node.closest('section')!.getBoundingClientRect();
+ return { gap: rail.left - scroll.right, inset: card.right - rail.right };
+ });
+ assert.ok(bounds.gap >= -1, `滚动条命中区覆盖正文:${JSON.stringify(bounds)}`);
+ assert.ok(bounds.inset >= 1, `滚动条越出卡片:${JSON.stringify(bounds)}`);
+ }
+ await opened.page.setViewportSize({ width: DESKTOP.width, height: DESKTOP.height });
+ const thumb = await track.locator('.ovthumb').boundingBox();
+ assert.ok(thumb);
+ await opened.page.mouse.move(thumb.x + thumb.width / 2, thumb.y + thumb.height / 2);
+ await opened.page.mouse.down();
+ await opened.page.mouse.move(thumb.x + thumb.width / 2, thumb.y + thumb.height / 2 + 30);
+ await opened.page.mouse.up();
+ assert.ok(await scroller.evaluate((node) => node.scrollTop > 100), '右侧轨道拖动没有滚动正文');
await scroller.evaluate((node) => { node.scrollTop = node.scrollHeight });
await opened.page.waitForFunction(() => !document.querySelector('[data-review-key] .can-scroll-bottom'));
await scroller.locator('[data-scroll-test]').evaluate((node) => node.remove());
diff --git a/web/css/01-base.css b/web/css/01-base.css
index 029f60809..e3c298d8e 100644
--- a/web/css/01-base.css
+++ b/web/css/01-base.css
@@ -394,6 +394,8 @@ button.danger.danger:disabled{
@media (pointer:fine){.ovtrack{pointer-events:auto}}
.ovtrack.ov-y{right:0;top:8px;bottom:8px;width:12px}
.ovtrack.ov-x{left:8px;right:8px;bottom:0;height:12px}
+/* 复核卡正文的纵向轨道位于右侧内边距中,12px 命中区完整留在内容之外。 */
+[data-review-key]>div:has(>div[data-overlay-scrollbar])>.ovtrack.ov-y{translate:12px 0}
.ovthumb{position:absolute;border-radius:var(--pill-radius);background:var(--field-ring-hover);
cursor:default;transition:width .15s cubic-bezier(.4,0,.2,1),height .15s cubic-bezier(.4,0,.2,1)}
.ov-y .ovthumb{right:0;top:0;width:3px}