Skip to content

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

:bug: Remove empty icon placeholders from automation menus https://github.com/siyuan-note/siyuan/issues/20644

Vanessa8f9deb91c7fb
diff --git a/app/src/protyle/render/av/automation.ts b/app/src/protyle/render/av/automation.ts
index 95d3d2ac50..c13104aef9 100644
--- a/app/src/protyle/render/av/automation.ts
+++ b/app/src/protyle/render/av/automation.ts
@@ -220,9 +220,9 @@ export const openAutomationMenu = async (options: {
};
const chooseField = (target: HTMLElement, fields: IAVColumn[], callback: (field: IAVColumn) => void) => {
const menu = new Menu();
- fields.forEach(field => menu.addItem({label: escapeHtml(field.name), click: () => callback(field)}));
+ fields.forEach(field => menu.addItem({iconHTML: "", label: escapeHtml(field.name), click: () => callback(field)}));
if (!fields.length) {
- menu.addItem({type: "readonly", label: lang.emptyContent});
+ menu.addItem({type: "readonly", iconHTML: "", label: lang.emptyContent});
}
const rect = target.getBoundingClientRect();
menu.open({x: rect.left, y: rect.bottom, h: rect.height});
diff --git a/app/src/protyle/render/av/collectionConditions.ts b/app/src/protyle/render/av/collectionConditions.ts
index a252dbbc8d..80f9567dad 100644
--- a/app/src/protyle/render/av/collectionConditions.ts
+++ b/app/src/protyle/render/av/collectionConditions.ts
@@ -152,7 +152,7 @@ export const mountCollectionConditions = (host: HTMLElement, source: AVAutomatio
let menu: Menu;
toggleMenu({target, build: () => {
menu = new Menu();
- items.forEach(item => menu.addItem({label: item.label, checked: item.value === current, click: () => select(item.value)}));
+ items.forEach(item => menu.addItem({iconHTML: "", label: item.label, checked: item.value === current, click: () => select(item.value)}));
}, show: () => {
const rect = target.getBoundingClientRect();
menu.open({x: rect.left, y: rect.bottom, h: rect.height, target});
diff --git a/app/src/protyle/render/av/fieldValueEditor.ts b/app/src/protyle/render/av/fieldValueEditor.ts
index e5219bd83a..ffd44abe35 100644
--- a/app/src/protyle/render/av/fieldValueEditor.ts
+++ b/app/src/protyle/render/av/fieldValueEditor.ts
@@ -341,6 +341,7 @@ export const openFieldRelationMenu = (target: HTMLElement, column: IAVColumn) =>
return;
}
options.forEach(option => menu.addItem({
+ iconHTML: "",
label: escapeHtml(option.content),
checked: selectedSet.has(option.id),
click: element => {
@@ -360,7 +361,7 @@ export const openFieldRelationMenu = (target: HTMLElement, column: IAVColumn) =>
},
}));
if (!options.length) {
- menu.addItem({type: "readonly", label: window.siyuan.languages.emptyContent});
+ menu.addItem({type: "readonly", iconHTML: "", label: window.siyuan.languages.emptyContent});
}
const rect = target.getBoundingClientRect();
menu.open({x: rect.left, y: rect.bottom, h: rect.height, w: rect.width});