Skip to content

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

:arrow_up: https://github.com/siyuan-note/siyuan/pull/17844

Daniel37e7f124daa6
diff --git a/app/src/assets/scss/business/_agentChat.scss b/app/src/assets/scss/business/_agentChat.scss
index 19e9078407..cddd8771d8 100644
--- a/app/src/assets/scss/business/_agentChat.scss
+++ b/app/src/assets/scss/business/_agentChat.scss
@@ -44,7 +44,7 @@
border-radius: 50%;
background: var(--b3-theme-background);
border: 1px solid var(--b3-border-color);
- box-shadow: var(--b3-dialog-shadow);
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
display: flex;
align-items: center;
justify-content: center;
diff --git a/app/src/layout/dock/AgentChat.ts b/app/src/layout/dock/AgentChat.ts
index 86484ef8b4..4d5e75a4e0 100644
--- a/app/src/layout/dock/AgentChat.ts
+++ b/app/src/layout/dock/AgentChat.ts
@@ -10,6 +10,7 @@ import {updateHotkeyAfterTip} from "../../protyle/util/compatibility";
import {escapeHtml} from "../../util/escape";
import {fetchPost} from "../../util/fetch";
import {confirmDialog} from "../../dialog/confirmDialog";
+import {showMessage} from "../../dialog/message";
import * as dayjs from "dayjs";
import {sendNotification} from "../../plugin/platformUtils";
import {
@@ -827,7 +828,11 @@ export class AgentChat extends Model {
el.innerHTML = html;
el.querySelector(".block__icon")?.addEventListener("click", (e) => {
e.stopPropagation();
- navigator.clipboard.writeText(text).catch(() => {});
+ navigator.clipboard.writeText(text).then(() => {
+ showMessage(window.siyuan.languages.copied, 2000);
+ }).catch(() => {
+ showMessage(window.siyuan.languages.copied, 2000);
+ });
});
this.messagesContainer.appendChild(el);
this.scrollToBottom(true);
@@ -1114,7 +1119,10 @@ export class AgentChat extends Model {
copyBtn.innerHTML = '<svg><use xlink:href="#iconCopy"></use></svg>';
copyBtn.addEventListener("click", (e: Event) => {
e.stopPropagation();
- navigator.clipboard.writeText(content).catch(() => {
+ navigator.clipboard.writeText(content).then(() => {
+ showMessage(window.siyuan.languages.copied, 2000);
+ }).catch(() => {
+ showMessage(window.siyuan.languages.copied, 2000);
});
});
actions.appendChild(copyBtn);