Skip to content

armgit / peach

Public Imported from GitHub
0

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

fix(web): 提示说明与右侧操作垂直居中

Peach local maintenance9100124160f4
diff --git a/frontend/e2e/library-completion.test.ts b/frontend/e2e/library-completion.test.ts
index ba51c6519..b731adb94 100644
--- a/frontend/e2e/library-completion.test.ts
+++ b/frontend/e2e/library-completion.test.ts
@@ -59,6 +59,10 @@ describe('缺预览时的统一补全入口', () => {
`宽容器中按钮应位于说明右侧:${JSON.stringify(placement)}`);
assert.ok(placement.action.top < placement.text.bottom,
`宽容器中按钮不应另起一行:${JSON.stringify(placement)}`);
+ const textCenter = placement.text.top + placement.text.height / 2;
+ const actionCenter = placement.action.top + placement.action.height / 2;
+ assert.ok(Math.abs(textCenter - actionCenter) <= 1,
+ `说明文字应与按钮垂直居中:${JSON.stringify(placement)}`);
}
await prompt.evaluate(element => { element.style.width = '320px' });
const narrowText = await prompt.locator('p').boundingBox();
diff --git a/frontend/src/react/components/note.tsx b/frontend/src/react/components/note.tsx
index 4fe040687..361ef580d 100644
--- a/frontend/src/react/components/note.tsx
+++ b/frontend/src/react/components/note.tsx
@@ -22,7 +22,7 @@ export function Note(
{/* 窄屏放不下时按钮换到下一行:挤成两个字一行的按钮比换行更难认。 */}
<div data-note-layout="" className={cx('flex flex-col items-start gap-3',
actionLayout === 'inline' && '@xl:flex-row @xl:items-center @xl:justify-between')}>
- <div className="flex min-w-0 flex-1 flex-col gap-0.5 self-stretch">
+ <div className="flex min-w-0 flex-1 flex-col justify-center gap-0.5 self-stretch">
{/* 正文常是服务端原话:长 URL、堆栈和多行原因照原样换行,不撑宽所在的卡。 */}
{title ? <p className="text-body-medium wrap-anywhere">{title}</p> : null}
<p className="whitespace-pre-line text-body-2-regular wrap-anywhere">{children}</p>
diff --git a/web/dist/peach-app.js b/web/dist/peach-app.js
index 158d7e8a3..8284b6965 100644
--- a/web/dist/peach-app.js
+++ b/web/dist/peach-app.js
@@ -37319,7 +37319,7 @@ function J({ tone: e, title: t, action: n, extra: r, children: i, actionLayout:
"data-note-layout": "",
className: SA("flex flex-col items-start gap-3", a === "inline" && "@xl:flex-row @xl:items-center @xl:justify-between"),
children: [/* @__PURE__ */ (0, C.jsxs)("div", {
- className: "flex min-w-0 flex-1 flex-col gap-0.5 self-stretch",
+ className: "flex min-w-0 flex-1 flex-col justify-center gap-0.5 self-stretch",
children: [t ? /* @__PURE__ */ (0, C.jsx)("p", {
className: "text-body-medium wrap-anywhere",
children: t
diff --git a/web/dist/peach-pages.js b/web/dist/peach-pages.js
index 1b4196271..186ba7b21 100644
--- a/web/dist/peach-pages.js
+++ b/web/dist/peach-pages.js
@@ -19248,7 +19248,7 @@ function Up({ tone: e, title: t, action: n, extra: r, children: i, actionLayout:
"data-note-layout": "",
className: R("flex flex-col items-start gap-3", a === "inline" && "@xl:flex-row @xl:items-center @xl:justify-between"),
children: [/* @__PURE__ */ (0, z.jsxs)("div", {
- className: "flex min-w-0 flex-1 flex-col gap-0.5 self-stretch",
+ className: "flex min-w-0 flex-1 flex-col justify-center gap-0.5 self-stretch",
children: [t ? /* @__PURE__ */ (0, z.jsx)("p", {
className: "text-body-medium wrap-anywhere",
children: t