Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/9274

Vanessa6f58d1387fe3
diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts
index 72662e23ca..334e544884 100644
--- a/app/src/protyle/render/av/action.ts
+++ b/app/src/protyle/render/av/action.ts
@@ -278,13 +278,25 @@ export const avContextmenu = (protyle: IProtyle, event: MouseEvent & { detail: a
menu.addSeparator();
const editAttrSubmenu: IMenu[] = [];
rowElement.parentElement.querySelectorAll(".av__row--header .av__cell").forEach((cellElement: HTMLElement) => {
- editAttrSubmenu.push({
- icon: getColIconByType(cellElement.getAttribute("data-dtype") as TAVCol),
- label: cellElement.textContent.trim(),
- click() {
- popTextCell(protyle, Array.from(blockElement.querySelectorAll(`.av__row--select:not(.av__row--header) .av__cell[data-col-id="${cellElement.dataset.colId}"]`)));
- }
- });
+ let hideBlock = false
+ const selectElements: HTMLElement[] = Array.from(blockElement.querySelectorAll(`.av__row--select:not(.av__row--header) .av__cell[data-col-id="${cellElement.dataset.colId}"]`))
+ if (cellElement.dataset.dtype === "block") {
+ selectElements.find(item => {
+ if (!item.dataset.detached) {
+ hideBlock = true;
+ return true;
+ }
+ })
+ }
+ if (!hideBlock) {
+ editAttrSubmenu.push({
+ icon: getColIconByType(cellElement.getAttribute("data-dtype") as TAVCol),
+ label: cellElement.textContent.trim(),
+ click() {
+ popTextCell(protyle, selectElements);
+ }
+ });
+ }
});
menu.addItem({
icon: "iconAttr",