An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: https://github.com/siyuan-note/siyuan/issues/4612
Vanessab75b878ff38a
diff --git a/app/src/protyle/scroll/event.ts b/app/src/protyle/scroll/event.tsindex bda9f72f3a..58721b3049 100644--- a/app/src/protyle/scroll/event.ts+++ b/app/src/protyle/scroll/event.ts@@ -42,6 +42,26 @@ export const scrollEvent = (protyle: IProtyle, element: HTMLElement) => {// 悬浮窗需展开上下文后才能进行滚动 https://github.com/siyuan-note/siyuan/issues/2311return;}+ if (protyle.scroll && !protyle.scroll.element.classList.contains("fn__none")) {+ clearTimeout(getIndexTimeout);+ getIndexTimeout = window.setTimeout(() => {+ elementRect = element.getBoundingClientRect();+ const targetElement = document.elementFromPoint(elementRect.left + elementRect.width / 2, elementRect.top + 10)+ console.log(targetElement, hasClosestBlock(targetElement), event);+ const blockElement = hasClosestBlock(targetElement);+ if (!blockElement) {+ return;+ }+ fetchPost("/api/block/getBlockIndex", {id: blockElement.getAttribute("data-node-id")}, (response) => {+ if (!response.data) {+ return;+ }+ const inputElement = protyle.scroll.element.querySelector(".b3-slider") as HTMLInputElement+ inputElement.value = response.data;+ protyle.scroll.element.setAttribute("aria-label", `Blocks ${response.data}/${protyle.block.blockCount}`);+ });+ }, Constants.TIMEOUT_BLOCKLOAD);+ }if (protyle.wysiwyg.element.getAttribute("data-top") || protyle.block.showAll || protyle.scroll.lastScrollTop === element.scrollTop || protyle.scroll.lastScrollTop === -1) {return;}@@ -75,26 +95,6 @@ export const scrollEvent = (protyle: IProtyle, element: HTMLElement) => {});}protyle.scroll.lastScrollTop = Math.max(element.scrollTop, 0);- if (protyle.scroll && !protyle.scroll.element.classList.contains("fn__none")) {- clearTimeout(getIndexTimeout);- getIndexTimeout = window.setTimeout(() => {- elementRect = element.getBoundingClientRect();- const targetElement = document.elementFromPoint(elementRect.left + elementRect.width / 2, elementRect.top + 10)- console.log(targetElement, hasClosestBlock(targetElement), event);- const blockElement = hasClosestBlock(targetElement);- if (!blockElement) {- return;- }- fetchPost("/api/block/getBlockIndex", {id: blockElement.getAttribute("data-node-id")}, (response) => {- if (!response.data) {- return;- }- const inputElement = protyle.scroll.element.querySelector(".b3-slider") as HTMLInputElement- inputElement.value = response.data;- protyle.scroll.element.setAttribute("aria-label", `Blocks ${response.data}/${protyle.block.blockCount}`);- });- }, Constants.TIMEOUT_BLOCKLOAD);- }}, {capture: false,passive: true,