Skip to content

fix(session-view): linkify plain URLs in user message bubbles - #2280

Merged
Hona merged 1 commit into
devfrom
fix/user-bubble-url-links
Dec 3, 2026
Merged

Hona merged 1 commit into
devfrom
fix/user-bubble-url-links

Conversation

@Hona

@Hona Hona commented Dec 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Linkify plain http:// and https:// URLs inside user message bubbles by reusing session_view::tools::plain::urls, skipping any range that overlaps a mention badge.
  • Style URL spans with a 40%-opacity underline in the bubble ink color that turns solid on hover (matching official packages/session-ui/src/components/message-part.css:195-213 [data-slot="user-message-link"] and packages/session-ui/src/message/message-content.tsx CurrentHighlightedText), keeping pointer cursor and text-order Tab stops alongside session mention links.
  • Route primary/middle clicks on user-bubble URLs to TimelineHost::open_link and secondary clicks to TimelineHost::reply_link_menu (falling back to the message context menu when the host provides no link menu).
  • Extend tools/plain.rs::urls to stop at CJK, fullwidth, and typographic prose punctuation/brackets (e.g. https://example.com/zhpunct。下一句 stops cleanly before 。) while preserving balanced parentheses/brackets and non-ASCII IRI path characters.

Fixes #2269

Note: Assistant-reply bare URLs immediately after quotes, colons, equals signs, em dashes, or CJK text/punctuation are tracked separately upstream in anomalyco/rune#3369.

Verification

  • pwsh scripts/guardrails.ps1 — 11/11 passed (including arch-check and cursor-allow).
  • cargo check -j 1 -p opencode-desktop — passed.
  • cargo clippy -j 1 -p session-view --no-deps and cargo clippy -j 1 -p opencode-desktop --no-deps — passed with zero diagnostics in touched files.
  • cargo check -j 1 -p session-view --examples — passed.
  • Not run locally: GUI window / interactive visual verification on Windows, macOS, and Linux (relied on CI cross-platform builds).

Copilot AI balanced review requested due to automatic review settings December 3, 2026 10:18

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@Hona
Hona merged commit e24a874 into dev Dec 3, 2026
8 checks passed
@Hona
Hona deleted the fix/user-bubble-url-links branch December 3, 2026 10:42
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.

desktop: URLs in user message bubbles are never links

2 participants