Skip to content

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

:sparkles: AI Agent https://github.com/siyuan-note/siyuan/issues/17797

Daniel11cf493e7404
diff --git a/app/src/layout/dock/AgentChat.ts b/app/src/layout/dock/AgentChat.ts
index 8f73f41324..0b994a6a8f 100644
--- a/app/src/layout/dock/AgentChat.ts
+++ b/app/src/layout/dock/AgentChat.ts
@@ -359,6 +359,19 @@ export class AgentChat extends Model {
this.parent.panelElement.addEventListener("click", (e: MouseEvent) => {
const t = e.target as HTMLElement;
+ let target = t;
+ while (target && !target.isEqualNode(this.parent.panelElement)) {
+ if (target.classList.contains("block__icon")) {
+ const type = target.getAttribute("data-type");
+ if (type === "min") {
+ e.stopPropagation();
+ getDockByType("agentChat").toggleModel("agentChat", false, true);
+ return;
+ }
+ break;
+ }
+ target = target.parentElement;
+ }
if (t.closest(".block__icons")) {
return;
}
@@ -371,11 +384,6 @@ export class AgentChat extends Model {
if (t.closest(".agent-session-popup")) {
return;
}
- if (t.closest('[data-type="min"]')) {
- e.stopPropagation();
- getDockByType("agentChat").toggleModel("agentChat", false, true);
- return;
- }
if (t.closest(".agent-chat__model-trigger") || t.closest(".agent-chat__model-menu")) {
return;
}