Skip to content

fix(DATAGO-124269): include original quote in follow-up action messages#978

Open
amir-ghasemi wants to merge 3 commits intomainfrom
amir/DATAGO-124269/include-quote-in-followup
Open

fix(DATAGO-124269): include original quote in follow-up action messages#978
amir-ghasemi wants to merge 3 commits intomainfrom
amir/DATAGO-124269/include-quote-in-followup

Conversation

@amir-ghasemi
Copy link
Collaborator

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

What is the purpose of this change?

When users select text and use the 'Ask Followup' action, the original quoted text was not visible in the user's message bubble in the chat UI, even though it was being sent to the backend. This fix ensures the quoted context is displayed in the chat UI so users can see what their follow-up question is referring to.

How was this change implemented?

  • ChatInputArea.tsx: Modified the onSubmit function to include the context text in the displayHtml when there's a context badge. Previously, only the fullMessage (sent to the backend) included the context, but the displayHtml (shown in the chat UI) did not.
  • index.css: Added CSS styles for the .context-quote class to display the quoted text in italic with a muted gray color, matching the visual style of the context badge shown above the input.

How was this change tested?

  • Manual testing: Verified that selecting text, clicking 'Ask Followup', typing a question, and submitting now shows both the quoted context and the follow-up question in the user's message bubble
  • Build verification: npm run build passes successfully

Is there anything the reviewers should focus on?

The HTML sanitization in ChatMessage.tsx already allows span tags with class attributes, so the new context-quote class is preserved when rendering.

AFTER (context from follow up included):
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
@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

// The context quote is now rendered separately above the message bubble
let htmlToRender = message.displayHtml;
// Remove context-quote-badge div and its contents
htmlToRender = htmlToRender.replace(/<div class="context-quote-badge">[\s\S]*?<\/div>/g, "");
Copy link
Contributor

Choose a reason for hiding this comment

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

This is pretty fragile. Can you ask Claude if we can do this more safely

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed. Already have an enhancement that will supersede this.

{message.isUser && message.contextQuote && (
<div className="flex justify-end pr-4">
<div className="bg-muted/50 flex max-w-fit items-center gap-2 overflow-hidden rounded-md border px-3 py-2 text-sm">
<Quote className="text-muted-foreground h-4 w-4 flex-shrink-0" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see this image in the screenshot?

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