Skip to content

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

:sparkles: https://github.com/siyuan-note/siyuan/issues/8665

Vanessa2946bd4b9cdc
diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts
index c9a960a45e..e96599eafd 100644
--- a/app/src/protyle/render/av/action.ts
+++ b/app/src/protyle/render/av/action.ts
@@ -9,6 +9,7 @@ import {emitOpenMenu} from "../../../plugin/EventBus";
import {addCol} from "./addCol";
import {openMenuPanel} from "./openMenuPanel";
import {hintRef} from "../../hint/extend";
+import {hideElements} from "../../ui/hideElements";
export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLElement }) => {
const blockElement = hasClosestBlock(event.target);
@@ -131,9 +132,13 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
const addRowElement = hasClosestByClassName(event.target, "av__row--add");
if (addRowElement) {
- protyle.toolbar.range = document.createRange()
- protyle.toolbar.range.selectNodeContents(blockElement.querySelector(".av__title"));
- hintRef("", protyle, "av");
+ if (protyle.hint.element.classList.contains("fn__none")) {
+ protyle.toolbar.range = document.createRange();
+ protyle.toolbar.range.selectNodeContents(blockElement.querySelector(".av__title"));
+ hintRef("", protyle, "av");
+ } else {
+ hideElements(["hint"], protyle);
+ }
event.preventDefault();
event.stopPropagation();
return true;
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index 4978e53f48..d13a9cf397 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -1563,7 +1563,14 @@ export class WYSIWYG {
event
});
});
- hideElements(["hint", "util"], protyle);
+
+ const addRowElement = hasClosestByClassName(event.target, "av__row--add");
+ if (addRowElement) {
+ hideElements(["util"], protyle);
+ } else {
+ hideElements(["hint", "util"], protyle);
+ }
+
const ctrlIsPressed = event.metaKey || event.ctrlKey;
/// #if !MOBILE
const backlinkBreadcrumbItemElement = hasClosestByClassName(event.target, "protyle-breadcrumb__item");