fix(chat): the action icons under your own message match the reply's size

This commit is contained in:
esengine committed 2026-10-17 20:05:22 -07:00
1 parent 4840df9825
commit e24b481e40
4 files changed
+47 -2

No files matched your search

+1
View File
@@ -145,6 +145,7 @@ jobs:
node perf/modelrows.mjs
node perf/explorersize.mjs
node perf/codeeditor-size.mjs
node perf/action-icons.mjs
node perf/rowhit.mjs
node perf/tab-pip.mjs
node perf/context-card-hover.mjs
@@ -0,0 +1,42 @@
// The row of actions under a reply and the row under the person's own message read as one family: the same
// button and the same icon size. A smaller icon under one of them is the kind of slip a reader sees at once.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html?pref=zh&ws=2&sess=6&turns=2";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const size = (el) => el.evaluate((e) => {
const b = e.getBoundingClientRect();
return `${Math.round(b.width * 10) / 10}x${Math.round(b.height * 10) / 10}`;
});
const browser = await chromium.launch();
try {
for (const scheme of ["light", "dark"]) {
const page = await browser.newPage({ colorScheme: scheme, viewport: { width: 1200, height: 900 } });
await page.goto(BASE, { waitUntil: "networkidle" });
await page.waitForSelector(".user-acts");
await page.waitForSelector(".call[data-k=\"say\"] .acts");
const mine = page.locator(".user-acts .studio-icon");
const reply = page.locator(".call[data-k=\"say\"] .acts .studio-icon");
check(`${scheme}: both rows were found`, (await mine.count()) > 0 && (await reply.count()) > 0);
const replyIcon = await size(reply.first());
const replyButton = await size(page.locator(".call[data-k=\"say\"] .acts > button").first());
for (let i = 0; i < await mine.count(); i++) {
check(`${scheme}: icon ${i + 1} of the message's own row matches the reply's`, await size(mine.nth(i)) === replyIcon, `${await size(mine.nth(i))} vs ${replyIcon}`);
}
check(`${scheme}: the buttons are the same size`, await size(page.locator(".user-acts > button").first()) === replyButton);
await page.close();
}
} finally {
await browser.close();
}
if (fails.length) {
console.error(`\n${fails.length} failed: ${fails.join("; ")}`);
process.exit(1);
}
console.log("\nall passed");
+2 -2
View File
@@ -841,10 +841,10 @@ body { background: var(--page) !important; }
.flow .user-acts > button,
.flow .user-acts .stepctl button {
display: inline-flex; align-items: center; justify-content: center; flex: none;
width: 26px; height: 26px; padding: 0; opacity: 1; line-height: 12px;
width: 26px; height: 26px; padding: 0; opacity: 1; line-height: 15px;
border: 0; border-radius: 6px; background: transparent; color: var(--muted);
}
.flow .user-acts .studio-icon { width: 12px; height: 12px; }
.flow .user-acts .studio-icon { width: 15px; height: 15px; }
.flow .call[data-k="me"] .user-acts > button:hover,
.flow .call[data-k="me"] .user-acts .stepctl button:hover { background: var(--overlay); color: var(--text); }
.flow .user-acts > .copy[data-feedback] { width: auto; gap: 5px; padding: 0 6px; white-space: nowrap; }
@@ -0,0 +1,2 @@
- 修复:你自己发的消息下面的操作图标(复制、改写、回退)和 AI 回复下面的一样大,不再偏小。关联 #13699。
- Fixed: The action icons under your own messages (copy, edit, rewind) are now the same size as those under a reply instead of smaller. Refs #13699.