Skip to content

desktop: URLs in user message bubbles are never links #2269

Done

Description

@zce

Summary

Plain URLs in user message bubbles are never links, in any language. Typing https://example.com in a prompt shows plain text. The same URL in an assistant reply (as [label](https://example.com), or after the Rune autolink fix as a bare URL) is clickable.

The official desktop linkifies plain user text: packages/session-ui/src/message/message-content.tsx CurrentHighlightedText → components/link-segments.ts / linked-text.tsx, with the underline and pointer from [data-slot="user-message-link"] in message-part.css.

Root cause

  • crates/session-view/src/user_parts.rs::bubble_badges only creates rune::Links for session mentions.
  • crates/session-view/src/timeline/parts.rs::user_bubble renders the prompt body with plain text(...).

Proposed fix

  • Reuse crates/session-view/src/tools/plain.rs::urls (the linkSegments scan already used for tool output).
  • Add a 40%-opacity underline span and a rune::Link for each URL, skipping ranges inside mention badges.
  • Route a primary click to open_link; right-click uses the reply link menu.

This covers English and CJK URLs. Assistant replies additionally need the rune-kit autolink fix for URLs after quotes, colons, equals signs, em dashes, and CJK text: anomalyco/rune#3369

The personal Fedora branch has been rebased onto the upstream fixes (#2280 and anomalyco/rune#3381); no local URL-link patch remains.

Verification

Headless element tree on the built binary:

  • Timeline/Long prompt → Long link: the user bubble now has a link node for the Slack URL.
  • A mixed prompt with "https://…", 'https://…', See:https://…, CJK text and https://…。下一句 gets a link for each URL; the final link label is exactly https://example.com/zhpunct and 。下一句 stays text.
  • The same mixed text in an assistant reply gets links for every URL; [文档](https://example.com/md) still works.

Activity

  1. Hona commented on Dec 3, 2026

    @Hona
    Member

    Fixed in #2280 (e24a874476bda84692497f60118c4136a37284d7).

    What shipped

    • Plain http:// and https:// URLs inside user message bubbles are now linkified via session_view::tools::plain::urls, skipping ranges that overlap mention badges.
    • URL spans render with a 40%-opacity underline in the bubble's ink color that becomes solid on hover, with primary/middle clicks routed to open_link and right-clicks routed to the reply link menu (falling back to the message menu when a host has no link menu).
    • tools/plain.rs::urls now stops at CJK, fullwidth, and typographic prose punctuation/brackets (so text such as https://example.com/zhpunct。下一句 stops before 。) while preserving balanced parentheses/brackets and non-ASCII IRI paths.
    • Note: Bare URLs in assistant replies immediately following quotes, colons, equals signs, em dashes, or CJK text/punctuation depend on the upstream rune-kit Markdown autolink fix tracked in rune-kit Markdown: bare URLs stay plain after quotes, punctuation and CJK text rune#3369.

    Verification

    • Verified locally with scripts/guardrails.ps1 (11/11), cargo check -p opencode-desktop, cargo clippy -p session-view --no-deps, cargo clippy -p opencode-desktop --no-deps, and cargo check -p session-view --examples.
    • Verified in GitHub CI across Windows (x64/arm64), macOS, Linux (x64/arm64), and guardrails.
    • Not verified on hardware: Interactive GUI rendering and click/right-click checks were not run in a live desktop window. Please reopen if anything still behaves unexpectedly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions