Skip to content

feat(site/src/pages/AgentsPage): make links in chat prompts clickable#27169

Draft
ibetitsmike wants to merge 1 commit into
mainfrom
mike/agents-ui-clickable-links
Draft

feat(site/src/pages/AgentsPage): make links in chat prompts clickable#27169
ibetitsmike wants to merge 1 commit into
mainfrom
mike/agents-ui-clickable-links

Conversation

@ibetitsmike

Copy link
Copy Markdown
Collaborator

URLs typed into Agents chat prompts rendered as inert text. This PR makes them clickable while keeping prompt text otherwise literal. Assistant responses already autolink via Streamdown + remark-gfm; that behavior is unchanged and now locked in by a story.

Changes

  • Add LinkifiedText with a pure tokenizer that turns http(s):// and www. URLs in user prompt text into anchors (target="_blank", rel="noopener noreferrer", response-matching styling, urlTransform support for workspace proxy rewrites). Trailing punctuation and unbalanced closing parens are excluded from the link; scheme-less bare domains are intentionally not linked; only http/https hrefs can be produced. Markdown syntax in prompts stays literal.
  • Render both UserMessageContent text paths (inline content blocks and the plain-string fallback) through LinkifiedText, preserving file-reference chip interleaving; thread urlTransform from ConversationTimeline.
  • Tests: 12 tokenizer unit cases; stories with play assertions for prompt links (literal markdown, XSS text stays inert, chips + links coexist) and the existing assistant autolink contract.

Validation

  • make pre-commit, targeted vitest (12/12), storybook vitest for ConversationTimeline.stories.tsx (56/56).
  • Dogfood UAT against a live dev instance via browser automation: prompt URLs (bare, www., trailing punctuation, literal [md](url), script-tag text) render and click through correctly; assistant response links verified through the real UI with DOM attribute checks and click-through.

Mux, working on Mike's behalf.

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: e8b608e3fe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

1 participant