Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/11804

Vanessa9ba4afdf2ff0
diff --git a/app/src/protyle/render/av/row.ts b/app/src/protyle/render/av/row.ts
index a8bf23d647..77f24b8457 100644
--- a/app/src/protyle/render/av/row.ts
+++ b/app/src/protyle/render/av/row.ts
@@ -2,7 +2,14 @@ import {hasClosestBlock, hasClosestByClassName} from "../../util/hasClosest";
import {focusBlock} from "../../util/selection";
import {Menu} from "../../../plugin/Menu";
import {transaction} from "../../wysiwyg/transaction";
-import {genCellValueByElement, getTypeByCellElement, popTextCell, renderCell, renderCellAttr} from "./cell";
+import {
+ addDragFill,
+ genCellValueByElement,
+ getTypeByCellElement,
+ popTextCell,
+ renderCell,
+ renderCellAttr
+} from "./cell";
import {fetchPost} from "../../../util/fetch";
import {showMessage} from "../../../dialog/message";
import * as dayjs from "dayjs";
@@ -125,9 +132,19 @@ ${getTypeByCellElement(item) === "block" ? ' data-detached="true"' : ""}><span c
});
let html = "";
srcIDs.forEach((id) => {
- html += `<div class="av__row" data-type="ghost" data-id="${id}" data-avid="${avId}" data-previous-id="${previousId}">
+ const blockCellElement = blockElement.querySelector(`[data-block-id="${id}"]`)
+ if (!blockCellElement) {
+ html += `<div class="av__row" data-type="ghost" data-id="${id}" data-avid="${avId}" data-previous-id="${previousId}">
${colHTML}
</div>`;
+ } else {
+ blockElement.querySelectorAll(".av__cell--select, .av__cell--active").forEach(item => {
+ item.classList.remove("av__cell--select", "av__cell--active");
+ item.querySelector(".av__drag-fill")?.remove();
+ });
+ addDragFill(blockCellElement);
+ blockCellElement.classList.add("av__cell--select");
+ }
});
previousElement.insertAdjacentHTML("afterend", html);
if (avId) {