Skip to content

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

:bug: Keep agent session actions working in floating docks https://github.com/siyuan-note/siyuan/issues/18758

Daniel8e2e5de88533
diff --git a/app/src/layout/dock/agent/AgentSessionPanel.ts b/app/src/layout/dock/agent/AgentSessionPanel.ts
index d0b48ecf9b..e17ced551c 100644
--- a/app/src/layout/dock/agent/AgentSessionPanel.ts
+++ b/app/src/layout/dock/agent/AgentSessionPanel.ts
@@ -131,7 +131,12 @@ export class AgentSessionPanel {
}
});
- this.host.appendChild(this.popup);
+ // 桌面端浮层使用视口坐标定位,挂到顶层可避免受浮动 Dock 的变换坐标系和裁剪影响。
+ if (this.mobile) {
+ this.host.appendChild(this.popup);
+ } else {
+ document.body.appendChild(this.popup);
+ }
this.popup.style.zIndex = (++window.siyuan.zIndex).toString();
if (!this.mobile) {
@@ -432,8 +437,8 @@ export class AgentSessionPanel {
}
}
- private closeAllSubmenus(except?: HTMLElement) {
- this.host.querySelectorAll(".agent-session-more.b3-menu__item--show").forEach((el) => {
+ private closeAllSubmenus(except?: HTMLElement) {
+ this.popup?.querySelectorAll(".agent-session-more.b3-menu__item--show").forEach((el) => {
if (el !== except) {
el.classList.remove("b3-menu__item--show");
}