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/3499

Vanessa33b41c202a7a
diff --git a/app/src/assets/scss/_layout.scss b/app/src/assets/scss/_layout.scss
index f92ceaad7d..da61afe77f 100644
--- a/app/src/assets/scss/_layout.scss
+++ b/app/src/assets/scss/_layout.scss
@@ -275,6 +275,7 @@
padding: 0 42px;
user-select: none;
background-color: var(--b3-theme-surface);
+ box-sizing: border-box;
&#dockLeft {
border-right: .5px solid var(--b3-border-color);
diff --git a/app/src/assets/template/desktop/index.tpl b/app/src/assets/template/desktop/index.tpl
index f0e940dc82..bf410d0ee7 100644
--- a/app/src/assets/template/desktop/index.tpl
+++ b/app/src/assets/template/desktop/index.tpl
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html>
+<html style="position: fixed;top: 0;right: 0;left: 0;">
<head>
<meta charset="UTF-8">
<meta name="viewport"
diff --git a/app/src/layout/dock/index.ts b/app/src/layout/dock/index.ts
index 9790806e46..2588693c0c 100644
--- a/app/src/layout/dock/index.ts
+++ b/app/src/layout/dock/index.ts
@@ -91,18 +91,19 @@ export class Dock {
if (this.position === "Left" || this.position === "Right") {
this.layout.element.setAttribute("style", `width:${this.layout.element.clientWidth}px;
opacity: ${hasActive ? 1 : 0};
-${this.position === "Right" ? "right" : "left"}:${this.element.clientWidth + .5}px;
-top: ${.5 + document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight}px;
-bottom: ${document.getElementById("status").clientHeight + document.getElementById("dockBottom").clientHeight + 1}px;`);
+${this.position === "Right" ? "right" : "left"}:${this.element.clientWidth}px;
+top: ${document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight}px;
+bottom: ${document.getElementById("status").clientHeight + document.getElementById("dockBottom").clientHeight}px;`);
} else {
this.layout.element.setAttribute("style", `height:${this.layout.element.clientHeight}px;
opacity: ${hasActive ? 1 : 0};
left:0;
right:0;
-${this.position === "Top" ? ("top:" + (.5 + this.element.clientHeight + document.getElementById("toolbar").clientHeight) + "px") : ("bottom:" + (1 + this.element.clientHeight + document.getElementById("status").clientHeight) + "px")};`);
+${this.position === "Top" ? ("top:" + (this.element.clientHeight + document.getElementById("toolbar").clientHeight) + "px") : ("bottom:" + (this.element.clientHeight + document.getElementById("status").clientHeight) + "px")};`);
}
target.setAttribute("aria-label", window.siyuan.languages.pin);
this.resizeElement.classList.add("fn__none");
+ resizeTabs();
} else {
target.setAttribute("aria-label", window.siyuan.languages.unpin);
this.layout.element.style.opacity = "";
@@ -144,8 +145,8 @@ ${this.position === "Top" ? ("top:" + (.5 + this.element.clientHeight + document
if (this.position === "Left" || this.position === "Right") {
this.layout.element.setAttribute("style", `opacity:0px;
width:${this.layout.element.clientWidth}px;${this.position === "Right" ? "right" : "left"}:-${this.layout.element.clientWidth}px;
-top: ${.5 + document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight}px;
-bottom: ${document.getElementById("status").clientHeight + document.getElementById("dockBottom").clientHeight + 1}px;`);
+top: ${document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight}px;
+bottom: ${document.getElementById("status").clientHeight + document.getElementById("dockBottom").clientHeight}px;`);
} else {
this.layout.element.setAttribute("style", `
opacity:0px;
@@ -174,13 +175,13 @@ ${this.position === "Top" ? "top" : "bottom"}:-${this.layout.element.clientHeigh
}
this.layout.element.style.opacity = "1";
if (this.position === "Left") {
- window.siyuan.layout.leftDock.layout.element.style.left = (window.siyuan.layout.leftDock.element.clientWidth + .5) + "px";
+ this.layout.element.style.left = this.element.clientWidth + "px";
} else if (this.position === "Right") {
- this.layout.element.style.right = (window.siyuan.layout.rightDock.element.clientWidth + .5) + "px";
+ this.layout.element.style.right = this.element.clientWidth + "px";
} else if (this.position === "Top") {
- this.layout.element.style.top = (document.getElementById("dockTop").clientHeight + document.getElementById("toolbar").clientHeight + .5) + "px";
+ this.layout.element.style.top = (this.element.clientHeight + document.getElementById("toolbar").clientHeight) + "px";
} else if (this.position === "Bottom") {
- this.layout.element.style.bottom = (document.getElementById("dockBottom").clientHeight + document.getElementById("status").clientHeight + 1) + "px";
+ this.layout.element.style.bottom = (this.element.clientHeight + document.getElementById("status").clientHeight) + "px";
}
}
diff --git a/app/src/layout/dock/util.ts b/app/src/layout/dock/util.ts
index fb955fe24a..dd7c19b96a 100644
--- a/app/src/layout/dock/util.ts
+++ b/app/src/layout/dock/util.ts
@@ -88,23 +88,23 @@ export const openOutline = (protyle: IProtyle) => {
export const resetFloatDockSize = () => {
if (!window.siyuan.layout.leftDock.pin) {
- window.siyuan.layout.leftDock.layout.element.style.top = (.5 + document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight) + "px";
- window.siyuan.layout.leftDock.layout.element.style.bottom = (document.getElementById("status").clientHeight + document.getElementById("dockBottom").clientHeight + 1) + "px";
+ window.siyuan.layout.leftDock.layout.element.style.top = (document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight) + "px";
+ window.siyuan.layout.leftDock.layout.element.style.bottom = (document.getElementById("status").clientHeight + document.getElementById("dockBottom").clientHeight) + "px";
if (window.siyuan.layout.leftDock.layout.element.style.opacity === "1") {
- window.siyuan.layout.leftDock.layout.element.style.left = (window.siyuan.layout.leftDock.element.clientWidth + .5) + "px";
+ window.siyuan.layout.leftDock.layout.element.style.left = window.siyuan.layout.leftDock.element.clientWidth + "px";
}
}
if (!window.siyuan.layout.rightDock.pin) {
- window.siyuan.layout.rightDock.layout.element.style.top = (.5 + document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight) + "px";
- window.siyuan.layout.rightDock.layout.element.style.bottom = (document.getElementById("status").clientHeight + document.getElementById("dockBottom").clientHeight + 1) + "px";
+ window.siyuan.layout.rightDock.layout.element.style.top = (document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight) + "px";
+ window.siyuan.layout.rightDock.layout.element.style.bottom = (document.getElementById("status").clientHeight + document.getElementById("dockBottom").clientHeight) + "px";
if (window.siyuan.layout.rightDock.layout.element.style.opacity === "1") {
- window.siyuan.layout.rightDock.layout.element.style.right = (window.siyuan.layout.rightDock.element.clientWidth + .5) + "px";
+ window.siyuan.layout.rightDock.layout.element.style.right = window.siyuan.layout.rightDock.element.clientWidth + "px";
}
}
if (!window.siyuan.layout.topDock.pin && window.siyuan.layout.topDock.layout.element.style.opacity === "1") {
- window.siyuan.layout.topDock.layout.element.style.top = (document.getElementById("dockTop").clientHeight + document.getElementById("toolbar").clientHeight + .5) + "px";
+ window.siyuan.layout.topDock.layout.element.style.top = (document.getElementById("dockTop").clientHeight + document.getElementById("toolbar").clientHeight) + "px";
}
if (!window.siyuan.layout.bottomDock.pin && window.siyuan.layout.bottomDock.layout.element.style.opacity === "1") {
- window.siyuan.layout.bottomDock.layout.element.style.bottom = (document.getElementById("dockBottom").clientHeight + document.getElementById("status").clientHeight + 1) + "px";
+ window.siyuan.layout.bottomDock.layout.element.style.bottom = (document.getElementById("dockBottom").clientHeight + document.getElementById("status").clientHeight) + "px";
}
};