Skip to content

Conversation

@amir-ghasemi
Copy link
Collaborator

@amir-ghasemi amir-ghasemi commented Feb 5, 2026

This pull request enhances the chat UI by improving how context quotes (selected text or referenced message snippets) are handled and displayed in user messages, and by adding robust support for highlighting quoted text in AI messages. The changes streamline context quote passing, ensure better separation of quoted content from user input, and introduce automatic, transient highlighting of referenced text in chat messages for improved user experience.

Context Quote Handling and UI Improvements:

  • Added a sourceTaskId to the text selection context and passed it to SelectionContextMenu and ChatInputArea, enabling the system to track the origin of quoted text selections. [1] [2] [3]
  • Updated the follow-up event handler in ChatInputArea to capture and store the sourceMessageId when quoting text, and ensure it is cleared after submission. [1] [2] [3]
  • Modified message submission logic to pass context quote and its source ID separately, so quoted context is displayed above the message bubble, not embedded in the message content. [1] [2]
  • Changed the context quote badge icon from MessageSquarePlus to Quote for clearer visual indication. [1] [2] [3]

Message Rendering and Highlighting Enhancements:

  • In ChatMessage.tsx, added logic to highlight quoted text in AI messages when referenced, using a robust, multi-strategy DOM search and highlight mechanism that works across line breaks and multiple nodes. Highlights fade out after a few seconds for a smooth user experience.
  • For user messages, stripped the context quote ("Context: ...") from the main message text and ensured it is displayed only in the dedicated badge above the bubble. Also, removed any embedded context quote HTML from displayHtml for backward compatibility. [1] [2]
  • Allowed additional HTML tags and attributes in sanitized message content to support richer rendering, including SVG icons.

Component and Prop Updates:

  • Updated SelectableMessageContent to receive taskId for improved traceability of AI messages.

These changes collectively improve the clarity, usability, and maintainability of context quoting and referencing in the chat interface.

image image

@github-actions
Copy link

github-actions bot commented Feb 5, 2026

WhiteSource Policy Violation Summary

✅︎ No Blocking Whitesource Policy Violations found in solaceai/solace-agent-mesh-ui-pr-978!

@amir-ghasemi amir-ghasemi force-pushed the amir/DATAGO-124269/include-quote-in-followup branch from e6cab36 to eb8d206 Compare February 5, 2026 01:29
- Add contextQuote field to MessageFE and MessageBubble types for storing
  the original quoted text separately from the message content
- Update ChatInputArea to pass contextQuote to handleSubmit
- Update ChatProvider serialization/deserialization to persist contextQuote
- Update ChatMessage to render context quote as styled badge above user
  message bubble (with Quote icon, border, background)
- Strip 'Context: ...' prefix from displayed message text when contextQuote
  is present to avoid duplication
- Update TaskLoggerService to preserve frontend-only fields (contextQuote,
  displayHtml) when backend saves background tasks, ensuring styling
  persists after page refresh
- Change context badge icon from MessageSquarePlus to Quote
@amir-ghasemi amir-ghasemi force-pushed the amir/DATAGO-124269/include-quote-in-followup branch from eb8d206 to 41be18d Compare February 5, 2026 03:28
@amir-ghasemi amir-ghasemi force-pushed the amir/DATAGO-124269/include-quote-in-followup branch from a3cc96c to 6bc8b8f Compare February 11, 2026 19:19
@amir-ghasemi amir-ghasemi changed the title fix(DATAGO-124269): include original quote in follow-up action messages fix(DATAGO-124287): Enhance styling of 'Follow Up' action message quotes Feb 11, 2026
- Add contextQuote and contextQuoteSourceId to message serialization/deserialization
- Update handleSubmit to accept contextQuote parameters
- Backend preserves frontend-only fields when saving tasks
- Keep main's save-inside-setMessages approach with quote field additions
@amir-ghasemi amir-ghasemi force-pushed the amir/DATAGO-124269/include-quote-in-followup branch from 6bc8b8f to 8ab6619 Compare February 11, 2026 19:57
…mir/DATAGO-124269/include-quote-in-followup-clean
@sonarqube-solacecloud
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 70%)
D Maintainability Rating on New Code (required ≥ A)
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE SonarQube for IDE

selectionRange: Range | null;
menuPosition: { x: number; y: number } | null;
sourceMessageId: string | null;
sourceTaskId: string | null; // Task ID for scroll-to-source functionality
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may not need these repeated comments?

}
},
[
addNotification,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we could add this? It continues to pop up on ever PR, unless there is a reason not to?

}

/* Context quote badge styles (for follow-up questions) */
.context-quote-badge {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double check this feature when it hits enterprise - may need to update the css file there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants