Skip to content

Rune Agent: make markdown links clickable in the dialogue TUI #7

Closed

Description

@ernestrc

Markdown links rendered in the Rune Agent dialogue TUI are not clickable. Clicking one starts a text selection instead of following the link.

The SDK already supports link clicks: the markdown handler accepts an OnLinkClick option and the markdown component can hit-test a coordinate to a link. The dialogue TUI simply never wires clicks to its markdown components.

Current state

  • All mouse events route through the dialogue's mouse delegate, whose OnAction always returns false. It only handles selection and scrolling on a flattened cell grid.
  • Sent messages and prompt bodies render a bare markdown component with no handler at all.
  • Streamed received messages do wrap markdown in the SDK markdown handler, but without a link-click option, and the delegate never invokes that handler's OnAction.

Proposal

  1. Accept a link-click callback in the component config (func(*url.URL) bool), documented so that nil ignores clicks and the package stays service-agnostic.
  2. Add a hit-test that maps a click coordinate to the specific markdown component in the message list and asks it for the link at that point.
  3. Handle left clicks in the mouse delegate: resolve a link, parse it, and invoke the callback. Returning true suppresses selection-start so the click does not also begin a drag.
  4. Wire the real callback at the extension's dialogue construction site, copying http/https URLs to the clipboard and notifying, mirroring the equivalent behavior in the IDE.

Local #anchor scrolling is out of scope; bare fragment links should fall through harmlessly.

Where to look

  • cmd/rune-agent/dialogue/dialoguetui/config.go - where the new config field belongs, next to the existing markdown config.
  • cmd/rune-agent/dialogue/dialoguetui/component.go - the three markdown render sites (sent message, streamed receive, prompt body) and the message-list iteration patterns to copy for the hit-test.
  • cmd/rune-agent/dialogue/dialoguetui/mouse_delegate.go - the delegate and its OnAction.
  • cmd/rune-agent/dialogue/dialoguetui/handler.go - delegate construction, and the place where the message-area offset is already subtracted from the event, so the delegate's coordinates are already in message-viewport space.

Notes for contributors

Tests belong in the existing mouse test files, using a capturing callback. Worth covering: a click on a link fires the callback and returns true; a click on plain text in the same message does not and returns false so selection still starts; links work in all three render sites; out-of-bounds clicks return false.

Activity

  1. added
    enhancement
    help wanted
    on Sep 11, 2026
  2. added a commit that references this issue on Oct 8, 2026
    e4cef24
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

    enhancementhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions