Skip to content

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

:art: Add stable identifiers to configurable menu separators https://github.com/siyuan-note/siyuan/issues/18484

Daniel12cbe9905d5c
diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts
index 5e8d7afec8..ebb007127d 100644
--- a/app/src/menus/protyle.ts
+++ b/app/src/menus/protyle.ts
@@ -267,7 +267,7 @@ export const fileAnnotationRefMenu = (protyle: IProtyle, refElement: HTMLElement
});
}
}).element);
- window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
+ window.siyuan.menus.menu.append(new MenuItem({id: "separator_turnInto", type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({
id: "turnInto",
label: window.siyuan.languages.turnInto,
@@ -821,6 +821,7 @@ export const contentMenu = (protyle: IProtyle, nodeElement: Element) => {
}).element);
}
window.siyuan.menus.menu.append(new MenuItem({
+ id: "separator_paste",
type: "separator",
}).element);
}
@@ -1277,6 +1278,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
});
}
}, {
+ id: "separator_reOCR",
type: "separator"
}, {
id: "reOCR",
@@ -2127,6 +2129,7 @@ export const iframeMenu = (protyle: IProtyle, nodeElement: Element) => {
const iframeSrc = iframeElement.getAttribute("src");
if (iframeSrc) {
subMenus.push({
+ id: "separator_openBy",
type: "separator"
});
return subMenus.concat(openMenu(protyle.app, iframeSrc, true, false) as IMenu[]);
@@ -2155,6 +2158,7 @@ export const videoMenu = (protyle: IProtyle, nodeElement: Element, type: string)
const src = videoElement.getAttribute("src");
if (src && src.startsWith("assets/")) {
subMenus.push({
+ id: "separator_rename",
type: "separator"
});
subMenus.push({
@@ -2342,6 +2346,7 @@ export const tableMenu = (protyle: IProtyle, nodeElement: Element, cellElement:
const menus: IMenu[] = [];
menus.push(...otherMenus);
menus.push({
+ id: "separator_insert",
type: "separator"
});
const hasNone = cellElement.parentElement.querySelector(".fn__none");
@@ -2579,6 +2584,7 @@ export const tableMenu = (protyle: IProtyle, nodeElement: Element, cellElement:
if ((cellElement.parentElement.parentElement.tagName !== "THEAD" &&
((!hasNone && !hasRowSpan) || (hasNone && !hasRowSpan && hasColSpan))) || colIsPure) {
menus.push({
+ id: "separator_delete",
type: "separator"
});
}
diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts
index 8813a85253..79c0978abc 100644
--- a/app/src/protyle/gutter/index.ts
+++ b/app/src/protyle/gutter/index.ts
@@ -2136,6 +2136,7 @@ export class Gutter {
protyle.toolbar.showRender(protyle, nodeElement);
}
}, {
+ id: "separator_breadcrumb",
type: "separator"
}, {
id: "embedBlockBreadcrumb",
@@ -2923,6 +2924,7 @@ export class Gutter {
});
});
styles.push({
+ id: "separator_1",
type: "separator"
});
const height = firstElement.style.height.endsWith("%") ? parseInt(firstElement.style.height) : 0;
@@ -2945,6 +2947,7 @@ export class Gutter {
this.updateNodeElements(nodeElements, protyle, rangeElement);
}
}, {
+ id: "separator_2",
type: "separator"
}, {
id: "default",