Skip to content

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

:lipstick: https://github.com/siyuan-note/siyuan/issues/6197

Vanessab6b0f0c7b45d
diff --git a/app/src/constants.ts b/app/src/constants.ts
index 04d0d448e8..ecf4cc517e 100644
--- a/app/src/constants.ts
+++ b/app/src/constants.ts
@@ -75,6 +75,7 @@ export abstract class Constants {
public static readonly TIMEOUT_SEARCH = 300;
public static readonly TIMEOUT_INPUT = 256;
public static readonly TIMEOUT_BLOCKLOAD = 300;
+ public static readonly TIMEOUT_TRANSITION = 150;
// help path
public static readonly HELP_PATH = {
diff --git a/app/src/layout/Tab.ts b/app/src/layout/Tab.ts
index 00e9403ba1..04af60fe5e 100644
--- a/app/src/layout/Tab.ts
+++ b/app/src/layout/Tab.ts
@@ -30,6 +30,7 @@ export class Tab {
this.headElement = document.createElement("li");
this.headElement.setAttribute("data-type", "tab-header");
this.headElement.setAttribute("draggable", "true");
+ this.headElement.setAttribute("style", "flex: 0;width: 0;overflow: hidden");
this.headElement.setAttribute("data-id", this.id);
this.headElement.setAttribute("data-position", "center"); // showTooltip 位置标识
this.headElement.classList.add("item", "item--focus");
diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.ts
index 6438b4919d..9a494117fb 100644
--- a/app/src/layout/Wnd.ts
+++ b/app/src/layout/Wnd.ts
@@ -443,6 +443,10 @@ export class Wnd {
this.headersElement.children[oldFocusIndex].after(tab.headElement);
}
+ setTimeout(() => {
+ tab.headElement.removeAttribute("style")
+ }, Constants.TIMEOUT_TRANSITION);
+
tab.headElement.querySelector(".item__close").addEventListener("click", (event) => {
if (tab.headElement.classList.contains("item--pin")) {
tab.unpin();
@@ -611,7 +615,10 @@ export class Wnd {
this.switchTab(this.children[currentIndex].headElement, true);
}
}
- item.headElement.remove();
+ item.headElement.setAttribute("style", "flex: 0;width: 0;overflow: hidden");
+ setTimeout(() => {
+ item.headElement.remove();
+ }, Constants.TIMEOUT_TRANSITION);
}
item.panelElement.remove();
this.destroyModel(item.model);