fix(chat): render URLs in messages as clickable links#60
Merged
Conversation
Backend recommendation messages embed raw application URLs, but the frontend rendered all message text as plain text, so job links were not clickable. Auto-linkify http(s)/www URLs in string messages in ChatBubble, opening in a new tab. Add a Storybook story.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In the recommendation phase, the backend (
backend/app/agent/recommender_advisor_agent/agent.py:524) embeds raw application URLs in the message (Apply here: https://…). The frontend rendered all message text as plain text via MUITypographyinChatBubble.tsx, so users could not click job links and struggled to navigate to applications.Fix
ChatBubble.tsx: auto-linkifyhttp(s)andwww.URLs in string messages, rendering them as<Link target="_blank" rel="noopener noreferrer">. Line-break behavior (whiteSpace: pre-line) is preserved;ReactNodemessages pass through unchanged.ChatBubble.stories.tsx: added aWithClickableLinksstory showing a recommendation-style message.Applies to all Compass messages, not just recommendations.
Verification
yarn compile(tsc) passes.