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

Daniel0db095eafd56
diff --git a/app/src/assets/scss/business/_agentChat.scss b/app/src/assets/scss/business/_agentChat.scss
index b6011bc4f9..79218a82e9 100644
--- a/app/src/assets/scss/business/_agentChat.scss
+++ b/app/src/assets/scss/business/_agentChat.scss
@@ -28,7 +28,7 @@
flex-direction: column;
gap: 12px;
user-select: text;
- transition: opacity 0.2s ease;
+ transition: var(--b3-transition);
}
.agent-chat__messages--switching {
@@ -44,14 +44,14 @@
border-radius: 50%;
background: var(--b3-theme-background);
border: 1px solid var(--b3-border-color);
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
+ box-shadow: var(--b3-tooltips-shadow);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
opacity: 0;
visibility: hidden;
- transition: opacity 0.2s ease, visibility 0.2s ease;
+ transition: var(--b3-transition);
z-index: 5;
svg {
@@ -151,7 +151,6 @@
}
.agent-chat__msg--user .agent-chat__body {
- border: none;
border-radius: var(--b3-border-radius-b);
background: var(--b3-theme-surface);
padding: 8px 12px;
@@ -181,7 +180,7 @@
gap: 4px;
width: 100%;
opacity: 0;
- transition: opacity 150ms linear;
+ transition: var(--b3-transition);
}
.agent-chat__msg-stats {
@@ -296,10 +295,10 @@
font-size: 12px;
color: var(--b3-theme-on-surface-light);
opacity: 0;
- transition: opacity 0.2s;
- }
+ transition: var(--b3-transition);
+}
- pre:hover[data-language]::before {
+pre:hover[data-language]::before {
opacity: 0.86;
}
@@ -556,7 +555,7 @@
right: 4px;
z-index: 1;
opacity: 0;
- transition: opacity 0.2s ease;
+ transition: var(--b3-transition);
}
.agent-chat__copy-btn {
@@ -574,7 +573,7 @@
height: 14px;
}
- &:hover {
+ &:hover, &:focus-visible {
background-color: var(--b3-theme-surface-lighter);
}
}
@@ -593,7 +592,7 @@ pre:hover .agent-chat__copy-wrap {
}
.agent-chat__error-icon {
- width: 16px; height: 16px;
+ width: 14px; height: 14px;
flex-shrink: 0;
display: flex;
align-items: center;
@@ -604,7 +603,6 @@ pre:hover .agent-chat__copy-wrap {
display: flex;
align-items: center;
gap: 6px;
- padding: 0;
color: var(--b3-theme-on-surface-light);
}
@@ -631,7 +629,7 @@ pre:hover .agent-chat__copy-wrap {
height: 14px;
}
- &:hover {
+ &:hover, &:focus-visible {
background: var(--b3-list-hover);
}
}
@@ -658,7 +656,6 @@ pre:hover .agent-chat__copy-wrap {
.agent-chat__thinking-card {
border: none;
border-radius: var(--b3-border-radius);
- background: transparent;
}
.agent-chat__msg--thinking-done {
@@ -671,7 +668,6 @@ pre:hover .agent-chat__copy-wrap {
gap: 6px;
padding: 4px 0;
cursor: pointer;
- background: transparent;
color: var(--b3-theme-on-surface-light);
user-select: none;
}
@@ -706,10 +702,9 @@ pre:hover .agent-chat__copy-wrap {
max-height: 0;
overflow: hidden;
contain: layout paint;
- background: transparent;
border-top: 1px solid transparent;
padding: 0;
- transition: max-height 0.25s ease, padding 0.25s ease, border-color 0.25s ease;
+ transition: max-height .2s cubic-bezier(0, 0, .2, 1), padding .2s cubic-bezier(0, 0, .2, 1), border-color .2s cubic-bezier(0, 0, .2, 1);
& > *:last-child {
margin-bottom: 0;
@@ -735,7 +730,6 @@ pre:hover .agent-chat__copy-wrap {
color: var(--b3-theme-on-surface);
line-height: 1.5;
margin-bottom: 8px;
- background: transparent;
border: none;
border-radius: 0;
@@ -774,14 +768,13 @@ pre:hover .agent-chat__copy-wrap {
.agent-chat__confirm-card {
font-size: 13px;
- background: transparent;
}
.agent-chat__confirm-header {
display: flex;
align-items: center;
gap: 6px;
- padding: 8px 8px;
+ padding: 8px 12px;
color: var(--b3-theme-on-background);
line-height: 1.5;
@@ -882,7 +875,7 @@ pre:hover .agent-chat__copy-wrap {
display: flex; align-items: center; gap: 2px;
font-size: 13px; padding: 0 8px; height: 24px;
border-radius: var(--b3-border-radius);
- background: transparent; cursor: pointer;
+ cursor: pointer;
white-space: nowrap;
position: relative;
outline: none;
@@ -917,7 +910,6 @@ pre:hover .agent-chat__copy-wrap {
.agent-session-popup {
position: fixed;
- z-index: 9999;
width: 280px;
max-height: 360px;
display: flex;
@@ -959,7 +951,7 @@ pre:hover .agent-chat__copy-wrap {
height: 12px;
color: var(--b3-theme-error);
- &:hover {
+ &:hover, &:focus-visible {
opacity: 0.7;
}
}
@@ -968,7 +960,7 @@ pre:hover .agent-chat__copy-wrap {
width: 12px;
height: 12px;
- &:hover {
+ &:hover, &:focus-visible {
opacity: 0.7;
}
}
@@ -985,20 +977,16 @@ pre:hover .agent-chat__copy-wrap {
}
// Todo list styles
-.agent-chat__tool-card--todo {
- background: transparent;
-}
.agent-chat__todo-header {
display: flex;
align-items: center;
gap: 6px;
- padding: 10px 12px;
+ padding: 8px 12px;
font-size: 13px;
font-weight: 500;
color: var(--b3-theme-on-surface);
border-bottom: 1px solid var(--b3-border-color);
- background: transparent;
}
.agent-chat__todo-items {
@@ -1045,7 +1033,6 @@ pre:hover .agent-chat__copy-wrap {
// Question card styles
.agent-chat__question-card {
font-size: 13px;
- background: transparent;
}
.agent-chat__question-item {
@@ -1081,7 +1068,7 @@ pre:hover .agent-chat__copy-wrap {
border-radius: var(--b3-border-radius);
cursor: pointer;
transition: var(--b3-transition);
- &:hover { background: var(--b3-theme-surface-light); }
+ &:hover, &:focus-visible { background: var(--b3-theme-surface-light); }
input { flex-shrink: 0; }
}
@@ -1161,7 +1148,8 @@ pre:hover .agent-chat__copy-wrap {
border-radius: var(--b3-border-radius-b);
transition: width 200ms ease-out, height 200ms ease-out,
opacity 200ms ease-out 50ms, padding 200ms ease-out,
- background 200ms ease-out;
+ background 200ms ease-out, line-height 200ms ease-out,
+ border-radius 200ms ease-out;
}
.agent-chat__nav-rail--expanded {
diff --git a/app/src/layout/dock/AgentSessionPanel.ts b/app/src/layout/dock/AgentSessionPanel.ts
index 13993f68af..2c0d6bf25d 100644
--- a/app/src/layout/dock/AgentSessionPanel.ts
+++ b/app/src/layout/dock/AgentSessionPanel.ts
@@ -87,6 +87,7 @@ export class AgentSessionPanel {
});
this.host.appendChild(this.popup);
+ this.popup.style.zIndex = (++window.siyuan.zIndex).toString();
const btnRect = this.triggerBtn.getBoundingClientRect();
setPosition(this.popup, btnRect.right - 280, btnRect.bottom, btnRect.height, btnRect.width);