diff --git a/electron/services/insightService.ts b/electron/services/insightService.ts
index f003bb3..1934e1c 100644
--- a/electron/services/insightService.ts
+++ b/electron/services/insightService.ts
@@ -259,7 +259,7 @@ function callApi(
}
const body = JSON.stringify(payload)
- const options = {
+ const requestOptions = {
hostname: urlObj.hostname,
port: urlObj.port || (urlObj.protocol === 'https:' ? 443 : 80),
path: urlObj.pathname + urlObj.search,
@@ -273,7 +273,7 @@ function callApi(
const isHttps = urlObj.protocol === 'https:'
const requestFn = isHttps ? https.request : http.request
- const req = requestFn(options, (res) => {
+ const req = requestFn(requestOptions, (res) => {
let data = ''
res.on('data', (chunk) => { data += chunk })
res.on('end', () => {
diff --git a/src/pages/Chat/ChatMessageBubble.tsx b/src/pages/Chat/ChatMessageBubble.tsx
index 59deed5..85bb827 100644
--- a/src/pages/Chat/ChatMessageBubble.tsx
+++ b/src/pages/Chat/ChatMessageBubble.tsx
@@ -101,13 +101,13 @@ function ChatMessageBubble({
{actionNode}
)}
- {!isGroupChat && !isSent && actionNode ? (
-
- {actionNode}
-
- ) : null}
{children}
+ {!isGroupChat && !isSent && actionNode ? (
+
+ {actionNode}
+
+ ) : null}
{isSelectionMode && isSent && }
diff --git a/src/pages/ChatPage.scss b/src/pages/ChatPage.scss
index 4bf7481..cb3f024 100644
--- a/src/pages/ChatPage.scss
+++ b/src/pages/ChatPage.scss
@@ -5846,12 +5846,14 @@
}
}
-.message-action-floating {
- height: 18px;
- margin: 0 0 3px 12px;
+.message-action-inline {
+ width: 24px;
+ height: 24px;
+ margin: 6px 0 0 4px;
display: flex;
align-items: center;
justify-content: flex-start;
+ flex-shrink: 0;
}
.message-insight-trigger {
@@ -5880,6 +5882,22 @@
color: var(--primary);
background: color-mix(in srgb, var(--primary) 10%, transparent);
}
+
+ &.compact {
+ width: 24px;
+ height: 24px;
+ padding: 0;
+ justify-content: center;
+ border-radius: 50%;
+ color: var(--primary);
+ background: transparent;
+ transform: none;
+
+ svg {
+ width: 14px;
+ height: 14px;
+ }
+ }
}
.message-wrapper-with-selection:hover .message-insight-trigger,
@@ -5887,6 +5905,16 @@
opacity: 0.78;
}
+.message-wrapper-with-selection:hover .message-insight-trigger.compact,
+.message-insight-trigger.compact:focus-visible {
+ opacity: 0.72;
+}
+
+.message-insight-trigger.compact:hover {
+ opacity: 1;
+ background: color-mix(in srgb, var(--primary) 10%, transparent);
+}
+
.message-insight-trigger:focus-visible {
outline: 2px solid color-mix(in srgb, var(--primary) 42%, transparent);
outline-offset: 2px;
diff --git a/src/pages/ChatPage.tsx b/src/pages/ChatPage.tsx
index 6589299..9ce09f3 100644
--- a/src/pages/ChatPage.tsx
+++ b/src/pages/ChatPage.tsx
@@ -8640,7 +8640,8 @@ function MessageInsightControl({
avatarUrl,
senderName,
targetText,
- contextCount
+ contextCount,
+ compact
}: {
message: Message
messageKey: string
@@ -8650,6 +8651,7 @@ function MessageInsightControl({
senderName?: string
targetText: string
contextCount: number
+ compact?: boolean
}) {
const anchorRef = useRef(null)
const cardRef = useRef(null)
@@ -8798,9 +8800,16 @@ function MessageInsightControl({
return (
<>
-