Skip to content

Show bare web addresses as links in the composer and sent messages - #517

Open
shubhook wants to merge 2 commits into
DuskBotAI:devfrom
shubhook:fix/bare-url-autolinks
Open

shubhook wants to merge 2 commits into
DuskBotAI:devfrom
shubhook:fix/bare-url-autolinks

Conversation

@shubhook

@shubhook shubhook commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Closes #514

A bare URL such as https://github.com/shubhook looked like plain text in the message box and in the sender's own bubble.

The detection already worked. linkRanges finds the address, MentionText renders it as an <a href> in the sent bubble and as a link span in the composer mirror, and a click opens it. The problem was CSS. .link-pill set color: inherit and text-decoration: none, so the link had the same color as the text around it until the pointer was over it. Reply bubbles looked right because .chat-link overrides the color there.

Changes, all in src/styles.css:

  • .link-pill now uses --color-accent-text, the color reply links already use. Only the color changes, so the composer mirror's glyphs stay under the caret.
  • Inside .user-bubble-colored, the link keeps the bubble's text color and gets a 1px underline at 40% of that color. The bubble background can be the accent color, and an accent-colored link would not show on it.

No changes to remark plugins or link detection.

Screenshots

Composer:

Composer with a bare GitHub URL shown in the link color

Sent message:

Sent bubble with the GitHub URL underlined

Verification

Isolated fixture (control-dusk ui launch, fake engine):

  • Typed draft https://github.com/shubhook in the composer. The link span computes to rgb(11, 105, 204) against rgb(28, 28, 28) text. Before the change both were rgb(28, 28, 28).
  • Sent the URL. The bubble has link "https://github.com/shubhook" in the accessibility tree, underlined at 1px in color(srgb 1 1 1 / 0.4) on white text. Before the change it had no underline.
  • A mouse click on the composer link called window.open("https://github.com/shubhook").
  • No console errors.
  • vitest on the 28 test files that cover link-pill, MentionText, link-ranges, styles.css and the user bubble: 570 passed.

Also checked by hand in a local dev build (screenshots above).

…link colour at rest, not only on hover; a coloured bubble underlines it instead
@shubhook
shubhook marked this pull request as draft December 4, 2026 08:15
@shubhook
shubhook marked this pull request as ready for review December 4, 2026 08:34
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