Skip to content

fix(site): make links in chat prompts clickable - #28187

Draft
ibetitsmike wants to merge 6 commits into
mainfrom
mike/codagt-478-clickable-prompt-links
Draft

fix(site): make links in chat prompts clickable#28187
ibetitsmike wants to merge 6 commits into
mainfrom
mike/codagt-478-clickable-prompt-links

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

URLs typed into Agents chat prompts rendered as dead plain text. This makes bare http(s) URLs in sent prompt bubbles clickable: they render as safe anchors (target="_blank", rel="noopener noreferrer") and honor the chat's urlTransform, so localhost URLs rewrite to port-forward links the same way assistant responses do. Assistant responses already render clickable links via Streamdown and are unchanged. The ticket's cmd/ctrl-press suggestion was not needed: sent bubbles have no competing click interaction (copy/edit are separate buttons).

Closes CODAGT-478.

Changes

  • New linkify.ts (splitTextForLinks): plain-text URL segmentation built on linkifyjs (4.3.3, MIT), with a validate option requiring an explicit http(s) scheme so bare domains, emails, and filenames with TLD-like extensions (README.md, deploy.sh) are not linkified. Detection is best effort: known linkifyjs tokenizer limitations (trailing Markdown emphasis delimiters kept in the URL, no IPv6 literal hosts, URLs adjacent to ANSI escapes not detected) are accepted and documented in the unit tests.
  • New LinkifiedText component: renders text segments with inline anchors and applies the optional urlTransform to hrefs while keeping the visible URL text.
  • UserMessageContent renders prompt text (inline blocks and the plain-markdown fallback) through LinkifiedText; ConversationTimeline passes urlTransform down.
  • Storybook: new UserPromptWithLinks story (href, target, rel, localhost rewrite, and real click activation with intercepted navigation) and a link assertion in UserMessageWithInlineFileRef covering linkification next to an inline file chip.

Testing

  • 17 unit tests for splitTextForLinks; whole-file Storybook run for ConversationTimeline.stories.tsx (63 tests).
  • pnpm -C site check and pnpm -C site lint:types pass.
  • Remote dogfood UAT on dev.coder.com passed: prompt links clickable and open in a new tab, trailing punctuation excluded, multi-line prompts preserved, copy/edit interactions unaffected, response links unchanged.

Mux created this PR on Mike's behalf.

@linear-code

linear-code Bot commented Aug 15, 2026

Copy link
Copy Markdown

CODAGT-478

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 87ed3260a8

ℹ️ 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".

Comment thread site/src/pages/AgentsPage/components/ChatElements/linkify.ts Outdated
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 498b1d9864

ℹ️ 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".

Comment thread site/src/pages/AgentsPage/components/ChatElements/linkify.ts Outdated
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 5b8131ba39

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@ibetitsmike ibetitsmike changed the title fix(site/src/pages/AgentsPage): make links in chat prompts clickable fix(site): make links in chat prompts clickable Aug 15, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 827410961f

ℹ️ 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".

Comment thread site/src/pages/AgentsPage/components/ChatElements/linkify.ts
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