Skip to content

Restore partial text selection in agent messages without the AttributeGraph cycle #32

Description

@bnaylor

Follow-up from #28. The cycle was fixed by removing .textSelection(.enabled) from the agent Markdown view (MessageView, ChatView.swift), because MarkdownUI's layout + SwiftUI text selection on a large message form an AttributeGraph cycle.

What was lost: dragging to select part of an agent message's text (e.g. grabbing one line out of a reply). Whole-message copy still works (row-select + Cmd-C / context menu), and text selection on user + system messages is unaffected.

Goal: restore in-bubble partial text selection for agent (Markdown) messages without reintroducing the cycle. Candidate approaches, all uncertain:

  • Bump MarkdownUI to a version where the textSelection layout cycle is fixed (verify with cycle count → 0).
  • A custom selectable text/code view for the markdown content.
  • Selection scoped to code blocks only (which is where partial-copy matters most), avoiding the whole-message selection layout.

Acceptance: partial text selection works in agent bubbles AND a large-agent-message click produces 0 AttributeGraph cycles.

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