Skip to content

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

:bug: Prevent bottom backlink panel jitter https://github.com/siyuan-note/siyuan/issues/18461

Daniel1d77106dda14
diff --git a/app/src/assets/scss/protyle/_protyle.scss b/app/src/assets/scss/protyle/_protyle.scss
index 9bf0878d80..3b8df9aedf 100644
--- a/app/src/assets/scss/protyle/_protyle.scss
+++ b/app/src/assets/scss/protyle/_protyle.scss
@@ -409,12 +409,6 @@
transition: none;
}
}
-
- &--backlink-bottom {
- > .protyle-wysiwyg {
- min-height: var(--b3-protyle-bottom-backlink-min-height);
- }
- }
}
.sy__backlink {
diff --git a/app/src/editor/index.ts b/app/src/editor/index.ts
index 75eded6b34..d606337b80 100644
--- a/app/src/editor/index.ts
+++ b/app/src/editor/index.ts
@@ -19,7 +19,6 @@ export class Editor extends Model {
private backlinkElement?: HTMLElement;
private backlinkIntersectionObserver?: IntersectionObserver;
private backlinkMutationObserver?: MutationObserver;
- private backlinkTopResizeObserver?: ResizeObserver;
private backlinkEmpty = false;
constructor(options: {
@@ -152,15 +151,6 @@ export class Editor extends Model {
attributes: true,
attributeFilter: ["data-bottom-eof"],
});
- const topElement = this.editor.protyle.contentElement.querySelector(".protyle-top");
- if (topElement) {
- this.backlinkTopResizeObserver = new ResizeObserver(() => {
- if (this.backlinkElement === backlinkElement) {
- setPadding(this.editor.protyle);
- }
- });
- this.backlinkTopResizeObserver.observe(topElement);
- }
this.updateBacklinkVisibility();
}
@@ -209,12 +199,10 @@ export class Editor extends Model {
const hasBacklinkElement = !!this.backlinkElement;
this.backlinkIntersectionObserver?.disconnect();
this.backlinkMutationObserver?.disconnect();
- this.backlinkTopResizeObserver?.disconnect();
this.backlink?.destroy();
this.backlinkElement?.remove();
this.backlinkIntersectionObserver = undefined;
this.backlinkMutationObserver = undefined;
- this.backlinkTopResizeObserver = undefined;
this.backlink = undefined;
this.backlinkElement = undefined;
this.backlinkEmpty = false;
diff --git a/app/src/protyle/ui/initUI.ts b/app/src/protyle/ui/initUI.ts
index 32ea4cfd21..680f9d5f19 100644
--- a/app/src/protyle/ui/initUI.ts
+++ b/app/src/protyle/ui/initUI.ts
@@ -344,14 +344,6 @@ export const setPadding = (protyle: IProtyle) => {
const backlinkBottomVisible = backlinkBottomElement &&
!backlinkBottomElement.classList.contains("fn__none") &&
!backlinkBottomElement.classList.contains("sy__backlink--pending");
- protyle.contentElement.classList.toggle("protyle-content--backlink-bottom", Boolean(backlinkBottomVisible));
- if (backlinkBottomVisible) {
- const topHeight = (protyle.contentElement.querySelector(".protyle-top") as HTMLElement)?.offsetHeight || 0;
- const minHeight = Math.max((protyle.contentElement.clientHeight - topHeight) * .5, 0);
- protyle.contentElement.style.setProperty("--b3-protyle-bottom-backlink-min-height", `${minHeight}px`);
- } else {
- protyle.contentElement.style.removeProperty("--b3-protyle-bottom-backlink-min-height");
- }
if (protyle.options.backlinkData) {
protyle.wysiwyg.element.style.padding = `4px ${paddingRight}px 4px ${paddingLeft}px`;