Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Align automation rule selector and name input widths

Danielf9d4b3e8db61
diff --git a/app/src/assets/scss/business/_av.scss b/app/src/assets/scss/business/_av.scss
index 67986df673..5ab5b3f2e7 100644
--- a/app/src/assets/scss/business/_av.scss
+++ b/app/src/assets/scss/business/_av.scss
@@ -3133,7 +3133,10 @@ img.av__cellassetimg {
&-enabled,
&-tools {
align-self: flex-end;
+ flex-shrink: 0;
+ justify-content: flex-end;
min-height: 28px;
+ width: 52px;
}
&-remove {
diff --git a/app/tests/automationPanel.test.js b/app/tests/automationPanel.test.js
index 6955903113..77d35c3a6b 100644
--- a/app/tests/automationPanel.test.js
+++ b/app/tests/automationPanel.test.js
@@ -286,6 +286,10 @@ const runCases = async (sources, css, mobile) => {
for (const fontSize of ["", "28px"]) {
menu.style.fontSize = fontSize;
await tick();
+ const selectorRect = get("[data-rule]").getBoundingClientRect();
+ const nameInputRect = get("[data-name]").getBoundingClientRect();
+ assert.ok(Math.abs(selectorRect.left - nameInputRect.left) <= 1 && Math.abs(selectorRect.right - nameInputRect.right) <= 1,
+ `${mobile}/${width}/${fontSize}: rule selector and name input share their left and right edges`);
for (const element of [menu, get(".av__automation-body"), ...menu.querySelectorAll("section, [data-index]")]) {
assert.ok(element.scrollWidth <= element.clientWidth + 1, `${mobile}/${width}/${fontSize}: content overflows`);
}