From 04da62a5541d446ccb2111dc4caed69f188806cc Mon Sep 17 00:00:00 2001
From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com>
Date: Fri, 1 May 2026 04:28:24 +0530
Subject: [PATCH] refactor(chat): improve AssistantMessage component with fixed
comment trigger slot and enhanced visibility handling
---
.../assistant-ui/assistant-message.tsx | 70 +++++++++++--------
1 file changed, 39 insertions(+), 31 deletions(-)
diff --git a/surfsense_web/components/assistant-ui/assistant-message.tsx b/surfsense_web/components/assistant-ui/assistant-message.tsx
index bfe0434b4..711bb2fe2 100644
--- a/surfsense_web/components/assistant-ui/assistant-message.tsx
+++ b/surfsense_web/components/assistant-ui/assistant-message.tsx
@@ -548,8 +548,10 @@ const AssistantMessageInner: FC = () => {
)}
-
-
+
);
@@ -642,35 +644,41 @@ export const AssistantMessage: FC = () => {
className="aui-assistant-message-root group fade-in slide-in-from-bottom-1 relative mx-auto w-full max-w-(--thread-max-width) animate-in py-3 duration-150"
data-role="assistant"
>
- {/* Comment trigger — right-aligned, just below user query on all screen sizes */}
- {showCommentTrigger && (
-
-
-
- )}
+ {/* Fixed trigger slot prevents any vertical reflow when visibility changes */}
+
+
+
{/* Desktop floating comment panel — overlays on top of chat content */}
{showCommentTrigger && isDesktop && isInlineOpen && dbMessageId && (