Skip to content
This repository was archived by the owner on Jul 15, 2026. It is now read-only.
This repository was archived by the owner on Jul 15, 2026. It is now read-only.

Add click-to-copy to the URL/link tile used across the UI #14

Description

@joestump-agent

Context

The link "tile" that shows a URL's domain with a link glyph appears throughout the UI, but there's no way to copy the underlying URL — you can only click through to open it. We should add a small click-to-copy icon + behavior so the URL can be grabbed without navigating.

This is the same component shown in a message transcript (the github.com chip under a link) and on the Media → Links tab.

Where it renders

  • Transcript link pillinternal/web/templates/partials.html (the msg-links block):
    <a class="link-pill" href="{{.URL}}" target="_blank" rel="noopener noreferrer nofollow">{{template "icon-link" $}}<span>{{.Domain}}</span></a>
  • Media → Links tabinternal/web/templates/gallery.html:
    <a class="media-link-url" href="{{.URL}}" target="_blank" rel="noopener noreferrer nofollow">{{.URL}}</a>

Proposed solution

Reuse the existing copy affordance so there's no new JS or CSP change:

  • internal/web/static/copy.js already powers copy buttons via data-copy-target + a .copy-btn with a copy→check icon swap (see the MCP blocks in internal/web/templates/settings.html). It reads the target element's text.
  • Add a small .copy-btn (icon-only, icon-copy) beside the link tile that copies the full URL. Because copy.js copies the target element's text, either point it at an element holding the full {{.URL}} or extend copy.js to accept a data-copy-value attribute for cases where the visible text is just the domain (the transcript pill shows {{.Domain}}, not the full URL).

Acceptance criteria

  • A copy icon appears on the link tile (transcript pill + Media Links row), keyboard-operable with an aria-label (e.g. "Copy link").
  • Clicking it copies the full URL to the clipboard (not just the domain), with the existing copy→check confirmation and the #copy-announce aria-live announcement.
  • No inline JS / no CSP change (reuse copy.js; script-src 'self').
  • Works in both light and dark themes and doesn't break the tile's click-through-to-open behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions